/* ==========================================================
   WXTER LUXURY DARK CHARCOAL THEME & MOTION SYSTEM
   ========================================================== */
:root {
    --bg: #090A0D;
    --bg-soft: #0E1016;
    --surface: #12151E;
    --surface-2: #181C28;
    --glass: rgba(18, 21, 30, 0.72);
    --border: rgba(226, 232, 240, 0.09);
    --border-strong: rgba(56, 189, 248, 0.35);
    --text: #E2E8F0;
    --text-bright: #F8FAFC;
    --muted: #94A3B8;
    --accent: #38BDF8;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --silver: #CBD5E1;
    --success: #22C55E;
    --danger: #EF4444;
    --warn: #F59E0B;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    font-family: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- پس‌زمینه موشن‌گرافیک زنده (Aurora + Grid) ---------- */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.ambient-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(226, 232, 240, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 25%, #000 10%, transparent 72%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    will-change: transform;
}

.orb-1 {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, #38BDF8, transparent 70%);
    top: -140px;
    right: -120px;
    animation: floatOrb1 16s ease-in-out infinite alternate;
}

.orb-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #94A3B8, transparent 70%);
    bottom: -120px;
    left: -100px;
    opacity: 0.14;
    animation: floatOrb2 20s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-70px, 60px, 0) scale(1.15); }
}

@keyframes floatOrb2 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(80px, -50px, 0) scale(1.12); }
}

/* ---------- انیمیشن ظاهر شدن هنگام اسکرول ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- هدر شیشه‌ای و ناوبری ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 10, 13, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 74px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--text-bright);
    white-space: nowrap;
}

.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--muted);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text-bright);
}

/* جستجوی زنده در هدر */
.search-wrap {
    position: relative;
    flex: 1;
    max-width: 340px;
}

.search-input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(24, 28, 40, 0.7);
    color: var(--text-bright);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    font-size: 14px;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: none;
    z-index: 250;
    max-height: 420px;
    overflow-y: auto;
}

.search-dropdown.open {
    display: block;
    animation: fadeSlideDown 0.2s ease;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.search-item:hover {
    background: var(--surface-2);
}

.search-item img {
    width: 46px;
    height: 46px;
    border-radius: 9px;
    object-fit: cover;
    background: #0B0D12;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 13px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.cart-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #090A0D;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- دکمه‌های مدرن با افکت Shimmer ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #38BDF8, #0284C7);
    color: #06090F;
    box-shadow: 0 10px 28px rgba(56, 189, 248, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(56, 189, 248, 0.34);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.btn-primary:hover::after {
    left: 140%;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
    color: var(--text-bright);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(56, 189, 248, 0.06);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: 9px;
}

/* ---------- هیرو موشن‌گرافیک صفحه اصلی ---------- */
.hero {
    position: relative;
    padding: 72px 0 58px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(28px, 4.4vw, 48px);
    font-weight: 900;
    line-height: 1.3;
    color: var(--text-bright);
}

.hero h1 span {
    background: linear-gradient(120deg, #F8FAFC 20%, #38BDF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--muted);
    font-size: 15.5px;
    margin: 0 0 28px;
    max-width: 540px;
}

.hero-visual {
    position: relative;
    height: 390px;
    border-radius: 26px;
    background: linear-gradient(155deg, #141926 0%, #0B0D13 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    overflow: hidden;
}

#heroMotionCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-center-emblem {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px 32px;
    border-radius: 22px;
    background: rgba(9, 10, 13, 0.62);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.25);
    animation: gentlePulse 4.5s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: translateY(0); box-shadow: 0 0 30px rgba(56, 189, 248, 0.1); }
    50%      { transform: translateY(-7px); box-shadow: 0 0 46px rgba(56, 189, 248, 0.22); }
}

.hero-center-emblem .wm {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #F8FAFC;
}

/* ---------- کارت‌های محصول و دسته‌بندی ---------- */
.section {
    padding: 48px 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.section-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-bright);
}

.section-head p {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: var(--muted);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 16px;
}

.cat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.cat-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    margin: 0 auto 12px;
    border: 1px solid var(--border);
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s, box-shadow 0.25s;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
}

.product-thumb {
    position: relative;
    aspect-ratio: 1 / 1.05;
    background: #0D0F15;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .product-thumb img {
    transform: scale(1.06);
}

.product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.pill-free { background: rgba(34, 197, 94, 0.2); color: #86EFAC; border: 1px solid rgba(34, 197, 94, 0.4); }
.pill-off  { background: rgba(239, 68, 68, 0.24); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.45); }
.pill-out  { background: rgba(15, 23, 42, 0.85); color: #CBD5E1; border: 1px solid rgba(148, 163, 184, 0.35); }

.product-body {
    padding: 14px 15px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-cat {
    font-size: 11.5px;
    color: var(--accent);
    margin-bottom: 4px;
}

.product-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-row {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.price-now {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-bright);
}

.price-old {
    font-size: 12px;
    color: var(--muted);
    text-decoration: line-through;
}

/* ---------- پنل عمومی و فرم‌ها ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 13px;
    color: var(--silver);
    margin-bottom: 6px;
    font-weight: 500;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid rgba(226, 232, 240, 0.14);
    background: #0B0D12;
    color: var(--text-bright);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

/* ---------- مسیر راهنما (Breadcrumb) ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin: 18px 0 22px;
}

.breadcrumb a:hover {
    color: var(--accent);
}

/* ---------- سبد خرید کشویی (Cart Drawer) ---------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 310;
    display: flex;
    flex-direction: column;
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.7);
}

.cart-drawer.open {
    transform: translateX(0);
}

.drawer-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.free-ship-box {
    padding: 12px 18px;
    background: rgba(56, 189, 248, 0.06);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
}

.free-ship-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 7px;
}

.free-ship-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38BDF8, #22C55E);
    transition: width 0.4s ease;
}

.guest-nudge {
    margin: 12px 18px 0;
    padding: 10px 13px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 12px;
    color: #FDE68A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}

.cart-item-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-row img {
    width: 64px;
    height: 64px;
    border-radius: 11px;
    object-fit: cover;
    background: #0B0D12;
    flex-shrink: 0;
}

.qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
}

.qty-ctrl button {
    width: 28px;
    height: 28px;
    border: 0;
    background: var(--surface-2);
    color: var(--text-bright);
    cursor: pointer;
    font-weight: 700;
}

.qty-ctrl span {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.drawer-foot {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.savings-pill {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86EFAC;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

/* ---------- مودال‌ها (ورود/ثبت‌نام و علت انصراف) ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.modal.open {
    display: grid;
}

.modal-card {
    width: 100%;
    max-width: 430px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    animation: fadeSlideDown 0.22s ease;
}

/* ---------- آکاردئون سوالات متداول و فوتر ---------- */
.faq-item {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-q {
    width: 100%;
    text-align: right;
    padding: 15px 18px;
    background: transparent;
    border: 0;
    color: var(--text-bright);
    font-size: 14.5px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-a {
    display: none;
    padding: 0 18px 16px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.85;
}

.faq-item.open .faq-a {
    display: block;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.trust-badge {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 9px 8px;
    text-align: center;
    font-size: 11.5px;
    color: var(--silver);
}

/* ---------- تایم‌لاین پیگیری سفارش ---------- */
.timeline {
    position: relative;
    padding-right: 24px;
    margin: 18px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 7px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-strong);
}

.timeline-step {
    position: relative;
    padding-bottom: 18px;
}

.timeline-dot {
    position: absolute;
    right: -23px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

/* ---------- Toast اعلان ---------- */
.toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 500;
    background: #161B26;
    border: 1px solid var(--border-strong);
    color: var(--text-bright);
    padding: 12px 18px;
    border-radius: 13px;
    box-shadow: var(--shadow);
    font-size: 13.5px;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.site-footer {
    margin-top: 60px;
    border-top: 1px solid var(--border);
    background: #07080B;
    padding: 44px 0 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 28px;
}

/* ---------- واکنش‌گرا موبایل ---------- */
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 1024px) {
    .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { height: 280px; }
}

@media (max-width: 780px) {
    .main-nav { display: none; }
    .main-nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 74px;
        right: 0;
        left: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
        gap: 14px;
    }
    .mobile-nav-toggle { display: inline-flex; }
    .search-wrap { max-width: none; }
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .form-grid, .footer-grid { grid-template-columns: 1fr; }
    .header-inner { gap: 8px; }
    .brand-logo { font-size: 18px; letter-spacing: 2px; }
}