* { font-family: var(--site-font, 'Vazirmatn'), Tahoma, sans-serif; }
body { font-size: var(--site-font-size, 16px); }

/* سایت کل عرض صفحه را بگیرد، بدون حاشیه سفید کنارها */
.container {
    max-width: 100% !important;
    padding-left: 28px;
    padding-right: 28px;
}
@media (max-width: 576px) {
    .container { padding-left: 14px; padding-right: 14px; }
}

.topbar { background: #111; color: #ddd; }

.banner-img { width: 100%; max-height: 420px; object-fit: cover; }

.category-chip { transition: .2s; }
.category-chip:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); border-color: var(--brand) !important; }

.category-banner-wrap {
    perspective: 1200px;
    display: flex;
    align-items: stretch;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(0,0,0,.14), 0 4px 10px rgba(0,0,0,.08);
    transition: box-shadow .35s ease;
    background: #fff;
}
.category-banner {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.category-banner-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
    transform-style: preserve-3d;
    animation: var(--category-anim, bannerSway3D) 6s ease-in-out infinite;
}
/* هر بنر با کمی تاخیر نسبت به بغلی‌اش می‌چرخد تا حرکت طبیعی‌تر و کمتر یکنواخت باشد */
.category-banner-wrap:nth-of-type(2) .category-banner-img,
.col:nth-child(2) .category-banner-img { animation-delay: -1.5s; }
.col:nth-child(3) .category-banner-img { animation-delay: -3s; }
.col:nth-child(4) .category-banner-img { animation-delay: -4.5s; }
.col:nth-child(5) .category-banner-img { animation-delay: -1s; }
.col:nth-child(6) .category-banner-img { animation-delay: -2.5s; }

@keyframes bannerSway3D {
    0%   { transform: perspective(1200px) rotateY(-30deg) scale(1.06); }
    50%  { transform: perspective(1200px) rotateY(30deg) scale(1.06); }
    100% { transform: perspective(1200px) rotateY(-30deg) scale(1.06); }
}

.category-banner-caption {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    background: var(--brand);
    color: #fff;
}
.category-banner-caption span { line-height: 1.4; }
.category-banner-wrap:hover {
    box-shadow: 0 28px 48px rgba(0,0,0,.24), 0 10px 20px rgba(0,0,0,.14);
}
.category-banner-wrap:hover .category-banner-img {
    animation-play-state: paused;
    transform: perspective(1200px) rotateY(0deg) scale(1.1);
    transition: transform .4s ease;
}
@media (max-width: 768px) {
    .category-banner-img { height: 200px; }
    .category-banner-caption { flex-basis: 80px; padding: 6px; font-size: .85rem; }
}
@media (max-width: 576px) {
    .category-banner-img { height: 170px; }
}
/* برای کاربرانی که ترجیح می‌دهند حرکت کمتری ببینند (تنظیمات سیستم‌عامل) */
@media (prefers-reduced-motion: reduce) {
    .category-banner-img { animation: none !important; }
}

.product-img { width: 100%; height: 200px; aspect-ratio: auto; object-fit: contain; padding: 10px; background: #fafafa; }
.product-main-img { width: 100%; aspect-ratio: 1 / 1; max-height: 480px; background: #fafafa; border: 1px solid #e5e5e5; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-main-img img { width: 100%; height: 100%; object-fit: contain; }
.product-thumb { width: 64px; height: 64px; object-fit: cover; cursor: pointer; background: #fafafa; }
.product-thumb:hover { border-color: var(--brand) !important; }
.product-title { font-size: .92rem; line-height: 1.4; min-height: 2.6em; overflow: hidden; }
.product-card { transition: .2s; }
.product-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); }

.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }

.site-footer a:hover { color: #fff !important; }

/* ===========================================================
   Aurora Background — پس‌زمینه راه‌راه نرم و پاستلی پشت کل صفحه
   =========================================================== */
body {
    position: relative;
    background-color: transparent !important;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    display: var(--bg-display, block);
    background-image: repeating-linear-gradient(100deg,
        var(--bg-color-1, #3b82f6) 10%,
        var(--bg-color-2, #6366f1) 18%,
        var(--bg-color-3, #0ea5e9) 26%,
        var(--bg-color-2, #6366f1) 34%,
        var(--bg-color-1, #3b82f6) 42%);
    background-size: 200% 200%;
    filter: blur(var(--bg-blur, 40px)) opacity(var(--bg-opacity, 38%)) saturate(140%);
    animation: auroraSmoothBg 22s ease-in-out infinite;
}
@keyframes auroraSmoothBg {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .aurora-hero-bg::after { animation: none; }
}

/* ===========================================================
   دکمه Liquid Metal — شبیه‌سازی CSS از افکت حلقه فلزی متحرک با آیکون
   =========================================================== */
.btn-liquid-metal {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    padding: 4px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 16px 40px -12px rgba(0,0,0,.3);
    transition: transform .15s ease;
    overflow: hidden;
    isolation: isolate;
    max-width: 100%;
}
.btn-liquid-metal:hover { transform: translateY(-2px); }
.btn-liquid-metal:active { transform: translateY(0) scale(.98); }
.btn-liquid-metal:disabled { opacity: .5; cursor: not-allowed; }

.btn-liquid-metal::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 300%; aspect-ratio: 1 / 1;
    margin: 0;
    translate: -50% -50%;
    z-index: -1;
    background: conic-gradient(from 0deg, #7a7a7d, #f5f5f7, #9a9a9d, #ffffff, #6b6b6e, #e8e8ea, #7a7a7d);
    animation: liquidMetalSpin 3.5s linear infinite;
}
@keyframes liquidMetalSpin {
    to { transform: rotate(360deg); }
}

.btn-liquid-metal-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 999px;
    padding: 10px 26px 10px 10px;
    transition: background .2s ease;
}
.btn-liquid-metal:hover .btn-liquid-metal-inner { background: #fafafa; }
.btn-liquid-metal-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f0f0f1;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.1rem;
}
.btn-liquid-metal-label {
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    .btn-liquid-metal::before { animation: none; }
}

/* ===========================================================
   لودر متحرک (Kinetic Loader) — برای عملیات‌های در حال بارگذاری
   =========================================================== */
.kinetic-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.kinetic-loader-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.kinetic-loader-text {
    display: flex;
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--brand, #0d6efd);
    letter-spacing: 6px;
}
.kinetic-loader-text span {
    display: inline-block;
    transform-origin: 100% 70%;
    animation: kineticLetterStretch 1800ms cubic-bezier(.25,.23,.73,.75) infinite;
}
@keyframes kineticLetterStretch {
    0%, 100% { transform: scale(1, .55); opacity: .55; }
    25% { transform: scale(1, 1.25); opacity: 1; }
    50% { transform: scale(1, .8); opacity: .8; }
    75% { transform: scale(1, 1.05); opacity: .95; }
}

/* ===========================================================
   شمارشگر انیمیشنی تعداد (Animated Number) - برای انتخاب تعداد خرید
   =========================================================== */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}
.qty-stepper button {
    background: #f8f9fa;
    border: none;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.qty-stepper button:hover { background: #e9ecef; }
.qty-stepper button:active { transform: scale(.92); }
.qty-stepper .qty-value {
    width: 48px;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    position: relative;
    height: 1.4em;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.qty-stepper .qty-value .digit-in {
    animation: digitRollIn .35s ease-out;
}
@keyframes digitRollIn {
    from { transform: translateY(var(--roll-from, 100%)); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ===========================================================
   مودال جستجوی سریع (⌘K) - پنل شیشه‌ای مطابق کامپوننت SearchModal
   =========================================================== */
#quickSearchModal .modal-content {
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,.07);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px -14px rgba(0,0,0,.28);
    overflow: hidden;
}
.qs-searchbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.qs-searchbar input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: .95rem;
}
.qs-kbd {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.03);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    color: #9a9a9a;
}
.qs-section-label {
    padding: 12px 18px 6px;
    font-size: 12px;
    color: #9a9a9a;
}
.qs-result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 0 8px 2px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}
.qs-result-row:hover { background: rgba(0,0,0,.035); color: inherit; }
.qs-result-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0,0,0,.05);
}
.qs-result-name { font-size: .9rem; }
.qs-result-meta { font-size: .82rem; color: #9a9a9a; margin-right: 6px; }
.qs-quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 0 8px 2px;
    border-radius: 10px;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    text-align: right;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}
.qs-quick-action:hover { background: rgba(0,0,0,.035); }
.qs-quick-action-icon {
    width: 30px; height: 30px; border-radius: 8px;
    background: rgba(0,0,0,.04);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 15px;
}

/* صفحه حساب کاربری */
.account-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: bold;
}
.account-sidebar .list-group-item.active { background: var(--brand); border-color: var(--brand); }
.account-sidebar .list-group-item { border-left: none; border-right: none; }

/* پیش‌فاکتور ساز */
.qb-pick-card { transition: .15s; }
.qb-pick-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.1); transform: translateY(-2px); }

/* ===========================================================
   هیرو اسکرول-اسکراب - ویدیوی کنترل‌شده با اسکرول (مثل صفحات معرفی محصول اپل)
   =========================================================== */
.hero-scrub {
    position: relative;
    height: 300vh;
}
.hero-scrub__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.hero-scrub__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .8;
}
.hero-scrub__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,11,.35) 0%, rgba(10,10,11,.15) 40%, rgba(10,10,11,.85) 100%);
}
.hero-scrub__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 20px;
    max-width: 760px;
}
.hero-scrub__content h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 800;
    margin-bottom: 20px;
}
.hero-scrub__content p {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    color: rgba(255,255,255,.85);
    margin-bottom: 32px;
}
.hero-scrub__scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.6);
    font-size: .8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: heroBounce 2s infinite;
}
@keyframes heroBounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* نسخه موبایل: بدون اسکرول‌اسکراب، فقط تصویر ثابت */
.hero-static {
    position: relative;
    height: 60vh;
    min-height: 340px;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}
.hero-static__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .8;
}
.hero-static__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,11,.4), rgba(10,10,11,.9));
}
.hero-static__content { position: relative; z-index: 2; text-align: center; color: #fff; padding: 0 20px; }
.hero-static__content h1 { font-size: 1.7rem; font-weight: 800; margin-bottom: 14px; }
.hero-static__content p { color: rgba(255,255,255,.85); margin-bottom: 20px; }

@media (max-width: 720px), (prefers-reduced-motion: reduce) {
    .hero-scrub { display: none; }
    .hero-static { display: flex; }
}

/* جستجوی زنده (پنل مدیریت گارانتی) */
.searchbox { position: relative; }
.searchbox .results {
    display: none;
    position: absolute;
    top: 100%; right: 0; left: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
    margin-top: 4px;
}
.searchbox .results.show { display: block; }
.qb-search-opt:hover { background: #f5f7fa; }

/* بج‌های وضعیت گارانتی */
.warranty-badge-active { background: #d1fae5; color: #065f46; }
.warranty-badge-expired { background: #fee2e2; color: #991b1b; }
.warranty-badge-void { background: #e5e7eb; color: #4b5563; }

/* انتخاب‌گر تاریخ شمسی */
.jalali-date-select { display: flex; gap: 6px; }
.jalali-date-select select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    font-size: .9rem;
}

/* ===========================================================
   دکمه شناور گفتگوی آنلاین (واتساپ/تلگرام)
   =========================================================== */
.chat-float--single {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 900;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .4);
    transition: transform .2s ease;
}
.chat-float--single:hover { transform: scale(1.08); color: #fff; }
.chat-float--whatsapp { background: #25d366; }
.chat-float--rubika { background: #2f3ec4; }

.chat-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 900;
}
.chat-float__toggle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--brand, #0d6efd);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .4);
    transition: transform .2s ease;
}
.chat-float__toggle:hover { transform: scale(1.08); }
.chat-float__icon--open, .chat-float__icon--close {
    display: flex; align-items: center; justify-content: center;
}
.chat-float__icon--close { display: none; }
.chat-float.is-open .chat-float__icon--open { display: none; }
.chat-float.is-open .chat-float__icon--close { display: flex; }

.chat-float__menu {
    position: absolute;
    bottom: 68px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.chat-float.is-open .chat-float__menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.chat-float__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 18px -4px rgba(0, 0, 0, .4);
    text-decoration: none;
}
.chat-float__option:hover { color: #fff; }
.chat-float__option--whatsapp { background: #25d366; }
.chat-float__option--rubika { background: #2f3ec4; }

@media (max-width: 640px) {
    .chat-float, .chat-float--single { bottom: 16px; left: 16px; }
    .chat-float__toggle, .chat-float--single { width: 50px; height: 50px; }
    .chat-float__menu { bottom: 60px; }
}

/* ===========================================================
   هدر سایت — استایل فعال‌تر برای نوار بالا و آیکون‌های اکشن
   =========================================================== */
.topbar-phone { display: inline-flex; align-items: center; gap: 5px; }
.topbar-phone-icon { display: inline-block; transform: scaleX(-1); opacity: .9; }

.site-header {
    box-shadow: 0 1px 0 rgba(0,0,0,.05);
    transition: box-shadow .25s ease;
    z-index: 1030;
}
.site-header.is-scrolled { box-shadow: 0 10px 24px -14px rgba(0,0,0,.28), 0 1px 0 rgba(0,0,0,.06); }

.header-search .input-group { border-radius: 999px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.header-search .form-control { border-inline-end: none; }
.header-search .form-control:focus { box-shadow: none; border-color: var(--brand); }
.header-search .btn-primary { border-radius: 0 999px 999px 0; }

.header-actions { row-gap: 8px; }
.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(120,120,140,.09);
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    position: relative;
    transition: transform .18s cubic-bezier(.2,.8,.2,1), background .2s ease, color .2s ease, box-shadow .2s ease;
}
.header-action-btn .icon {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.08));
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.header-action-btn:hover,
.header-action-btn:focus-visible {
    background: var(--brand);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,.35);
}
.header-action-btn:hover .icon { transform: scale(1.15) rotate(-4deg); }

.header-action-btn.cart-btn { padding-left: 14px; padding-right: 14px; }
.header-action-btn.cart-btn .icon { font-size: 1.3rem; }

.cart-badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -6px;
    background: #ff4757;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--header-bg, #fff);
}

.category-toggle-btn {
    border-radius: 999px !important;
    padding: 7px 16px !important;
    font-weight: 600;
    background: rgba(120,120,140,.06);
    border-color: rgba(120,120,140,.25) !important;
    transition: background .2s ease, border-color .2s ease, transform .18s ease;
}
.category-toggle-btn:hover { background: var(--brand); border-color: var(--brand) !important; color: #fff; transform: translateY(-1px); }
.category-toggle-btn .icon { font-size: 1.05rem; }

@media (max-width: 767px) {
    .header-action-btn { padding: 8px; }
    .header-action-btn .icon { font-size: 1.35rem; }
}

@media print {
    header, footer, .site-header, .topbar, .site-footer, #quickSearchModal { display: none !important; }
    #qbSteps > *:not(#qbStepSummary) { display: none !important; }
    body::before { display: none !important; }
    #qbInvoiceBox { box-shadow: none !important; border: 1px solid #ddd !important; }
}
