/* ==========================================================================
   0. Vazirmatn Font Faces
   ========================================================================== */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn[wght].woff2') format('woff2-variations');
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
    font-style: normal;
}

/* ==========================================================================
   1. Reset & Core Variables
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --kc-white: #ffffff;
    --kc-black: #111111;
    --kc-black-soft: #222222;
    --kc-red: #d90429;
    --kc-red-hover: #ef233c;

    --kc-text: #1f2937;
    --kc-text-soft: #4b5563;
    --kc-text-muted: #6b7280;

    --kc-line: #e5e7eb;
    --kc-line-strong: #d1d5db;
    --kc-soft: #f8fafc;
    --kc-soft-red: rgba(217, 4, 41, 0.08);

    --kc-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    --kc-shadow-hover: 0 16px 35px rgba(0, 0, 0, 0.12);

    --kc-radius: 12px;
    --kc-transition: all 0.25s ease;
}

/* ==========================================================================
   2. Base Layout
   ========================================================================== */

html, body {
    touch-action: pan-x pan-y;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-weight: 400;
    background-color: var(--kc-white);
    color: var(--kc-text);
    line-height: 1.6;
    direction: rtl;
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-weight: 700;
    color: var(--kc-black);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
}

.main-content {
    padding: 30px 0;
}

/* ==========================================================================
   3. Column Title
   ========================================================================== */

a.column-title {
    font-size: 14px;
    color: var(--kc-black);
    margin-bottom: 15px;
    font-weight: 700;
    display: block;
    position: relative;
    padding-right: 15px;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transition: color 0.3s ease;
}

a.column-title:hover {
    color: var(--kc-red) !important;
    background: transparent !important;
}

a.column-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--kc-red);
    border-radius: 1px;
    transition: transform 0.3s ease;
}

a.column-title:hover::before {
    transform: translateY(-50%) scale(1.2);
}

/* ==========================================================================
   4. Category
   ========================================================================== */

.category-page-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0;
    box-sizing: border-box;
}

.category-header {
    margin: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-main-title {
    margin-right: 20px;
    font-size: 20px;
    color: #333;
    font-weight: 800;
}

.category-products-count {
    margin-left: 20px;
    font-size: 13px;
    color: #777;
}

.category-title-divider {
    border: 0;
    border-top: 1px solid rgb(227 227 227 / 0.58);
    margin-bottom: 20px;
}

/* ==========================================================================
   5. Header (هدر هوشمند انیمیشنی KuCoco)
   ========================================================================== */

.main-header {
    padding: 15px 0 8px 0;
    background-color: var(--kc-white);
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease;
}

/* پدینگ بالای صفحه برای جلوگیری از رفتن محتوا زیر هدر */
body {
    padding-top: 135px !important;
    transition: padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* کاهش پدینگ صفحه وقتی هدر جمع می‌شود */
body.header-is-collapsed {
    padding-top: 85px !important;
}

/* استایل بخش بالایی هدر */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo,
.logo-box h1 {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: -0.5px;
}

.logo-aria {
    color: var(--kc-black);
}

.logo-shabrang {
    color: var(--kc-red);
}

.logo-box h1 {
    color: var(--kc-black);
}

.search-box {
    flex: 1;
    max-width: 600px;
}

.search-box form {
    display: flex;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--kc-line);
    border-radius: 0 10px 10px 0;
    outline: none;
    font-size: 14px;
    background-color: var(--kc-soft);
    color: var(--kc-text);
    transition: var(--kc-transition);
}

.search-box input::placeholder {
    color: var(--kc-text-muted);
}

.search-box input:focus {
    background-color: var(--kc-white);
    border-color: var(--kc-red);
    box-shadow: 0 0 0 3px rgba(217, 4, 41, 0.12);
}

.search-box button {
    padding: 10px 20px;
    background: var(--kc-black);
    color: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: var(--kc-transition);
}

.search-box button:hover {
    background: var(--kc-red);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
}

.login-btn {
    border: 1px solid var(--kc-line);
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--kc-transition);
    color: var(--kc-black);
    background: var(--kc-white);
}

.login-btn:hover {
    border-color: var(--kc-red);
    color: var(--kc-red);
    background: #fff;
}

.cart-btn {
    font-weight: bold;
    color: var(--kc-black);
}

.separator {
    color: var(--kc-line-strong);
}

/* بخش پایینی هدر (دسته‌بندی با انیمیشن ورود و خروج نرم) */
.header-bottom {
    margin-top: 12px;
    border-top: 1px solid var(--kc-line);
    padding-top: 8px;
    max-height: 55px;
    opacity: 1;
    transform: translateY(0) scaleY(1);
    transform-origin: top center;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                margin-top 0.35s ease,
                padding-top 0.35s ease,
                border-color 0.3s ease;
}

.menu-trigger-wrapper {
    position: relative;
    display: inline-block;
}

.menu-trigger {
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    transition: var(--kc-transition);
    font-weight: bold;
    color: var(--kc-black);
}

.menu-trigger:hover {
    color: var(--kc-red);
}

/* --------------------------------------------------------------------------
   حالت جمع‌شده (اسکرول به پایین): ناپدید شدن دسته‌بندی با افکت گرافیکی زیبا
   -------------------------------------------------------------------------- */
.main-header.header-collapsed {
    padding-top: 10px;
    padding-bottom: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.main-header.header-collapsed .header-bottom {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px) scaleY(0.85);
    margin-top: 0;
    padding-top: 0;
    border-top-color: transparent;
    pointer-events: none; /* جلوگیری از کلیک ناخواسته */
}

/* ==========================================================================
   6. Mega Menu
   ========================================================================== */

.mega-menu-structure {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 850px;
    min-height: 400px;
    background: var(--kc-white);
    border: 1px solid var(--kc-line);
    box-shadow: var(--kc-shadow);
    border-radius: 0 14px 14px;
    z-index: 1000;
    margin-top: 0;
    overflow: hidden;
}

.menu-trigger-wrapper.is-open .mega-menu-structure {
    display: flex !important;
}

.main-list {
    list-style: none;
    width: 200px;
    background: #fafafa;
    border-left: 1px solid var(--kc-line);
    padding: 0;
    margin: 0;
}

.main-list > li {
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--kc-black-soft);
    display: block;
    transition: var(--kc-transition);
    position: static !important;
    border-right: 4px solid transparent;
}

.main-list > li.is-active {
    background-color: var(--kc-white);
    color: var(--kc-red);
    font-weight: bold;
    border-right: 4px solid var(--kc-red);
}

.main-list > li > a {
    display: block;
    width: 100%;
    padding: 15px 20px;
    cursor: pointer;
}

.sub-list {
    display: none;
    position: absolute;
    top: 0;
    right: 200px;
    left: 0;
    bottom: 0;
    background: var(--kc-white);
    padding: 25px;
    overflow-y: auto;
}

.main-list > li.is-active .sub-list {
    display: block !important;
}

.view-all-link {
    display: inline-block;
    font-size: 12px;
    color: var(--kc-red);
    margin-bottom: 20px;
    font-weight: bold;
    transition: var(--kc-transition);
}

.view-all-link:hover {
    color: var(--kc-black);
}

.sub-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    align-items: flex-start;
}

.sub-list-column {
    display: flex;
    flex-direction: column;
    width: 160px;
    margin-bottom: 20px;
}

.sub-list-column a {
    font-size: 13px;
    color: var(--kc-text-muted);
    padding: 6px 10px 6px 0;
    transition: var(--kc-transition);
    display: block;
    border-radius: 8px;
}

.sub-list-column a:hover {
    color: var(--kc-red);
    background-color: var(--kc-soft-red);
    padding-right: 10px;
}

.header-divider {
    border: 0;
    border-top: 1px solid var(--kc-line);
    margin: 0;
}

/* ==========================================================================
   7. Product Grid & Cards
   ========================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 22px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}



.product-card {
    background: var(--kc-white);
    border: 1px solid var(--kc-line);
    border-radius: var(--kc-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 280px;
    justify-self: start;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    will-change: transform;
}

.product-card:hover {
    box-shadow: var(--kc-shadow);
    border-color: var(--kc-line-strong);
    transform: translateY(-4px);
}

.product-image-link {
    display: block;
    margin-bottom: 16px;
}

.product-main-link {
    display: block;
}

.product-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 12px;
}


/* اصلاح باکس تصویر در کارت‌های محصول */
.product-image-box img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;     /* جلوگیری از دفرمه شدن و خروج از کادر */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* مرکزچینی دقیق */
}


.product-card:hover .product-image-box img {
    transform: scale(1.04);
}

.product-info-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    margin-top: 15px;
}

.product-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--kc-black);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1em * 2);
    margin-bottom: 10px;
}

.product-spec {
    font-size: 12px;
    color: var(--kc-text-muted);
}


/* فقط باکس قیمت و تماس را وسط‌چین می‌کند */
.product-price-section {
    display: flex;
    justify-content: center; /* وسط‌چین افقی */
    align-items: center;     /* وسط‌چین عمودی */
    width: 100%;
    color: #27ae60;
    margin-top: auto;
    padding-top: 6px;
}

/* برای اینکه مطمئن شویم متن داخلش (مثل تماس بگیرید) خودش وسط می‌ماند */
.price-call, .price-row {
    text-align: center;
}

.price-num {
    font-weight: bold;
    font-size: 16px;
    margin-left: 5px;
}

.price-unit {
    font-size: 12px;
}

.product-action-box {
    margin-top: 0;
}

.product-action-link {
    display: block;
    text-align: center;
    background-color: var(--kc-soft);
    color: var(--kc-black);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    border: 1px solid var(--kc-line);
}

.product-action-link:hover {
    background-color: var(--kc-black);
    color: #fff;
    border-color: var(--kc-black);
}


/* ==========================================================================
   8 Product Detail Page
   ========================================================================== */

.product-detail-page {
    padding: 20px 20px 56px;
    background: #fff;
    max-width: 1400px;
    margin: 0 auto;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    margin-bottom: 48px;
}

.product-detail-main,
.product-detail-image-column,
.product-detail-sidebar {
    min-width: 0;
}

.detail-card {
    background: #fff;
    border: 1px solid #eef2f5;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   8 Product Detail Page
   ========================================================================== */

.product-detail-page {
    padding: 20px 20px 56px;
    background: #fff;
    max-width: 1400px;
    margin: 0 auto;
    direction: rtl;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    margin-bottom: 48px;
}

.product-detail-main,
.product-detail-image-column,
.product-detail-sidebar {
    min-width: 0;
}

.detail-card {
    background: #fff;
    border: 1px solid #eef2f5;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
}

/* --------------------------------------------------------------------------
   Font fix for form elements
   -------------------------------------------------------------------------- */

button,
input,
select,
textarea {
    font: inherit;
}

/* --------------------------------------------------------------------------
   Sidebar / Purchase Card
   -------------------------------------------------------------------------- */

.purchase-card {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 18px 18px;
    text-align: center;
    border-radius: 18px;
}

.purchase-card .top-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 14px;
    border-bottom: 1px solid #f1f3f5;
}

.purchase-card .actions-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
    display: block;
}

.price-tag {
    font-size: 24px;
    font-weight: 900;
    color: #dc2626;
    line-height: 1.5;
    display: block;
    margin: 0;
}
.price-and-stock-row {
    display: flex !important;
    flex-direction: row !important; /* ردیفی معمولی */
    justify-content: space-between !important; /* فاصله انداختن بین دو طرف */
    align-items: center !important;
    width: 100% !important;
    direction: ltr !important; /* راست‌به‌چپ کردن کل ردیف */
    margin-bottom: 10px !important;
}

.price-and-stock-row .price-tag {
    font-weight: bold;
    color: #353535;
    font-size: 1.1rem;
    white-space: nowrap;
}

.price-and-stock-row .low-stock-label,
.price-and-stock-row .in-stock-label {
    font-size: 0.85rem;
    white-space: nowrap;
}
.product-detail-stock {
    font-size: 14px;
    color: #16a34a;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.response-time-text {
    display: block;
    margin-bottom: 8px;
    color: #16a34a !important;
    font-size: 13px;
    font-weight: 800;
}

.more-info-desktop {
    color: #0d6efd;
    font-size: 13px;
    font-weight: 700;
}

.out-of-stock-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.out-of-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
}

.low-stock-label,
.in-stock-label {
    display: block;
    margin-top: 10px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 800;
    border-radius: 10px;
    text-align: center;
}

.low-stock-label {
    background: #fff7ed;
    color: #c2410c;
}

.in-stock-label {
    background: #ecfdf5;
    color: #15803d;
}

.add-to-cart-form {
    width: 100%;
    margin: 0;
}

.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-action,
.call-to-action-box {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}

.btn-action {
    border: none;
    padding: 12px 18px;
}

.btn-buy {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 10px 18px rgba(34, 197, 94, 0.18);
}

.btn-buy:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    transform: translateY(-1px);
}

.btn-back {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #dbe2ea;
}

.btn-back:hover {
    background: #f1f5f9;
    color: #111827;
}

.btn-disabled {
    background: #e5e7eb;
    color: #6b7280;
    cursor: not-allowed;
    box-shadow: none;
}

.call-to-action-box {
    gap: 10px;
    padding: 14px;
    border: 1.5px dashed #ef4056;
    background: #fff5f6;
    color: #ef4056;
    font-weight: 800;
}

.call-to-action-box:hover {
    background: #ef4056;
    color: #fff;
    border-color: #ef4056;
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */

.product-title-container {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.product-title-h1 {
    font-size: 24px;
    font-weight: 900;
    color: #1f2937;
    margin: 0;
    line-height: 1.8;
}

.product-title-en {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 6px;
    line-height: 1.7;
}

.section-title,
.description-section h3,
.specs-section h3 {
    font-size: 16px;
    font-weight: 900;
    border-bottom: 1px solid #eef2f5;
    padding-bottom: 8px;
    margin: 28px 0 14px;
    color: #1f2937;
}

.description-section {
    border-bottom: 1px solid #f8fafc;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.description-section h3 {
    margin-bottom: 10px !important;
}

.product-description-content {
    font-size: 15px;
    line-height: 2;
    color: #4b5563;
    text-align: justify;
}

.product-description-content p {
    margin: 0;
}

.specs-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #f8fafc;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-value {
    color: #111827;
    font-weight: 800;
    font-size: 14px;
    text-align: left;
}

.text-ltr {
    direction: ltr;
    unicode-bidi: embed;
}

/* --------------------------------------------------------------------------
   Image Column
   -------------------------------------------------------------------------- */

.product-image-card {
    padding: 12px;
}

.product-gallery-slider {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.4s ease;
}

.slider-slide {
    min-width: 100%;
}

.slider-slide img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.prev-btn,
.next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.prev-btn {
    right: 10px;
}

.next-btn {
    left: 10px;
}

.slider-indicators {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    backdrop-filter: blur(5px);
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: all 0.25s ease;
}

.indicator.active {
    width: 18px;
    border-radius: 10px;
    background: #ef4444;
}

/* --------------------------------------------------------------------------
   Related Products
   -------------------------------------------------------------------------- */

.related-products-section {
    margin-top: 40px;
    padding: 28px 20px 20px;
    border-top: 2px solid #f1f5f9;
    background: #fff;
    border-radius: 18px;
    width: 100%;
}

.related-products-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
}

.related-title {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: #1f2937;
}

.related-category-badge {
    background: #f3f4f6;
    color: #4b5563;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.related-products-slider-wrap {
    display: flex;
    width: 100%;
    position: relative;
}

.related-products-grid {
    display: flex;
    gap: 16px;
    direction: rtl;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.related-products-grid::-webkit-scrollbar {
    display: none;
}

.related-product-card {
    flex: 0 0 170px;
    width: 170px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.related-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.related-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-no-image {
    width: 100%;
    min-height: 160px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.related-product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 104px;
}

.related-product-title {
    font-size: 14px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 10px;
    line-height: 1.8;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.related-product-meta {
    margin-bottom: 10px;
}

.related-stock {
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
}

.related-stock.in {
    background: #ecfdf5;
    color: #15803d;
}

.related-stock.out {
    background: #fff1f2;
    color: #be123c;
}

.related-product-price {
    font-size: 15px;
    font-weight: 900;
    color: #dc2626;
}

.all-items-circle {
    width: 78px;
    min-width: 78px;
    height: 78px;
    flex-shrink: 0;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: #334155;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
}

.all-items-circle span {
    padding: 8px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

.all-items-circle:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    color: #111827;
}

.related-empty {
    width: 100%;
    padding: 18px;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    text-align: center;
    color: #6b7280;
    background: #fafafa;
}


/* ایجاد ردیف یکپارچه برای قیمت و موجودی */
.price-and-stock-row {
    display: flex;
    flex-direction: row-reverse; /* برای اینکه قیمت سمت راست و موجودی سمت چپ باشد */
    justify-content: space-between; /* فاصله دادن به طرفین */
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    gap: 10px;
}

/* کوچک کردن فونت موجودی برای جلوگیری از بهم‌ریختگی */
.low-stock-label, .in-stock-label {
    font-size: 0.85rem;
    white-space: nowrap;
}

.price-tag {
    font-weight: bold;
    color: #ef4056; /* رنگ قرمز قیمت */
}


.price-and-stock-row {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: space-between !important;

    align-items: center !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .product-detail-layout {
        grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(260px, 320px);
        gap: 16px;
    }

    .detail-card {
        padding: 18px;
    }
}

@media (max-width: 1024px) {
    .product-detail-page {
        padding: 16px 14px 180px;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-detail-image-column {
        order: 1;
    }

    .product-detail-main {
        order: 2;
    }

    .product-detail-sidebar {
        order: 3;
    }

    .product-image-card,
    .product-detail-main .detail-card {
        border-radius: 16px;
    }

    .purchase-card {
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: 70px;
        top: auto;
        z-index: 40;
        margin: 0;
        padding: 12px;
        gap: 3px;
        border-radius: 18px 18px 14px 14px;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12);
        border: 1px solid #e5e7eb;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
    }

    .purchase-card .top-info {
        display: contents;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 0 10px;
        border-bottom: 1px solid #eef2f5;
        text-align: right;
    }

    .purchase-card .actions-area {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
    }

    .add-to-cart-form {
        flex: 1 1 auto;
    }

    .action-buttons-group {
        flex-direction: row;
        gap: 10px;
        align-items: stretch;
    }

    .action-buttons-group > * {
        flex: 1 1 0;
    }

    .btn-action,
    .call-to-action-box {
        min-height: 46px;
        height: 46px;
        padding: 10px 12px;
        font-size: 14px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .price-tag {
        font-size: 20px;
        line-height: 1.4;
        text-align: right;
    }

    .spec-label {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .product-detail-stock,
    .response-time-text,
    .low-stock-label,
    .in-stock-label,
    .more-info-desktop {
        margin: 0;
    }

    .low-stock-label,
    .in-stock-label {
        padding: 5px 8px;
        font-size: 11px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .more-info-desktop {
        display: none !important;
    }
}

/* استایل دسکتاپ - فقط برای مانیتورهای بزرگ */
@media (min-width: 769px) {
    .price-and-stock-container {
        display: flex;
        flex-direction: column; /* عمودی */
        align-items: flex-start;
        gap: 6px;
        width: 100%;
        margin-bottom: 10px;
    }
    .price-and-stock-row {
        flex-direction: column !important; /* تبدیل به حالت عمودی */
        align-items: center !important; /* وسط‌چین کردن هر دو المان */
        justify-content: center !important;
        gap: 10px !important; /* فاصله بین قیمت و متن موجودی */
        text-align: center !important;
    }

    .price-and-stock-row .price-tag {
        /* درشت‌تر کردن قیمت در دسکتاپ */
        font-size: 1.4rem !important;
        margin: 0 !important;
    }

    .price-and-stock-row .low-stock-label,
    .price-and-stock-row .in-stock-label {
        /* حذف فاصله اضافی و اطمینان از نمایش در خط بعدی */
        display: inline-block !important;
        margin: 0 !important;
    }
    .price-label-desktop {
        font-size: 0.9rem;
        color: #555;
    }

    .price-tag {
        font-weight: bold;
        color: #ef4056;
        font-size: 1.4rem;
    }

    .low-stock-label,
    .in-stock-label {
        font-size: 0.85rem;
        padding: 4px 8px;
        border-radius: 6px;
        color: #28a745; /* پیش‌فرض برای موجودی */
    }

    .low-stock-label {
        background: #fff3cd;
        color: #856404;
    }
}

/* در موبایل، چون کلاس .price-and-stock-container را به صورت پیش‌فرض دستکاری نکردیم،
   و کدهای موبایل قبلی تو سرجایشان هستند، ظاهر موبایل تغییری نمی‌کند. */


@media (max-width: 560px) {
    .purchase-card .top-info {
        align-items: flex-start;
    }

    /* دکمه‌ها کنار هم بمانند */
    .purchase-card .actions-area {
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
    }

    .action-buttons-group {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

.action-buttons-group > :first-child { flex: 1.7 1 0; }
.action-buttons-group > :last-child  { flex: 1 1 0; }


    .btn-action,
    .call-to-action-box {
        width: 100%;
    }

    .purchase-card {
        padding: 10px;
    }
}


@media (max-width: 480px) {
    .product-detail-page {
        padding: 10px 8px 12px;
    }

    .detail-card {
        padding: 12px;
    }

    .product-title-h1 {
        font-size: 18px;
    }

    .product-title-en {
        font-size: 12px;
    }

    .price-tag {
        font-size: 17px;
    }

    .out-of-stock-badge {
        min-height: 40px;
        font-size: 14px;
    }

    .btn-action,
    .call-to-action-box {
        min-height: 44px;
        height: 44px;
        font-size: 13px;
    }

    .related-products-grid {
        gap: 12px;
    }

    .related-product-card {
        flex: 0 0 140px;
        width: 140px;
    }
}

/* ==========================================================================
   9. Gallery / Slider
   ========================================================================== */

.product-gallery-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #eef2f5;
    touch-action: pan-y;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    margin-bottom: 5px;
}

.slider-wrapper {
    display: flex;
    aspect-ratio: 1 / 1; /* یا هر نسبت ابعادی که برای عکس‌ها در نظر دارید */
    align-items: center;
}

.slider-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-sizing: border-box;
}

/* اصلاح تصاویر داخل اسلایدر اصلی */
.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;     /* نمایش تمام محصول در فضای اسلایدر */
}


.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #eef2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 16px;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slider-nav-btn:hover {
    background: #ffffff;
    color: #e91e63;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prev-btn {
    right: 15px;
}

.next-btn {
    left: 15px;
}

.slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: flex;
    gap: 6px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.slider-indicators.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.indicator {
    width: 7px;
    height: 7px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transition: all 0.25s ease;
}

.indicator.active {
    background: #e91e63;
    width: 14px;
    border-radius: 4px;
}

.no-image-placeholder {
    padding: 40px;
    text-align: center;
    color: #999;
    background: #f9f9f9;
}

/* ==========================================================================
   10. Mobile Navigation
   ========================================================================== */

.mobile-bottom-nav,
.mobile-cat-overlay {
    display: none !important;
}

.nav-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    background: radial-gradient(
        circle,
        rgba(239, 64, 86, 0.28) 0%,
        rgba(239, 64, 86, 0.18) 45%,
        rgba(239, 64, 86, 0) 75%
    );
    animation: ripple-animation 600ms ease-out;
    will-change: transform, opacity;
}

@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

/* ==========================================================================
   11. Responsive
   ========================================================================== */



@media (max-width: 1024px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .user-box,
    .header-bottom,
    .header-divider {
        display: none !important;
    }

    .header-top {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 10px;
    }

    .search-box {
        width: 100% !important;
        margin: 0 !important;
    }

    .search-box form {
        display: flex;
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }

    .product-card {
        max-width: none;
        justify-self: stretch;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
    }


    .product-detail-image-box {
        min-height: 320px;
        padding: 14px;
    }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background-color: #ffffff !important;
        border-top: 1px solid #f0f0f1 !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08) !important;
        z-index: 100000 !important;
        align-items: center;
        justify-content: space-around !important;
    }

    .mobile-bottom-nav .nav-item {
        position: relative;
        overflow: hidden;
        isolation: isolate;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: #71717a;
        text-decoration: none;
        font-size: 12px;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .mobile-bottom-nav .nav-icon {
        display: block;
        width: 22px;
        height: 22px;
        margin-bottom: 4px;
        stroke: currentColor;
        fill: none;
        transition: stroke 0.2s ease, color 0.2s ease;
    }

    .mobile-bottom-nav .nav-item.active {
        color: #ef4056 !important;
    }

    .mobile-cat-overlay {
        display: flex !important;
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
        left: 0;
        background-color: #ffffff;
        z-index: 99999;
        flex-direction: column;
        direction: rtl;
        transform: translateY(100%);
        opacity: 0;
        visibility: hidden;
        transition:
            transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
            opacity 0.35s ease,
            visibility 0.35s ease;
    }

    .mobile-cat-overlay.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .mobile-cat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 16px;
        border-bottom: 1px solid #f0f0f1;
        background-color: #ffffff;
        flex-shrink: 0;
    }

    .mobile-cat-title {
        font-size: 16px;
        font-weight: 800;
        color: #1f2937;
        line-height: 1.5;
    }

    .mobile-cat-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: none;
        border-radius: 8px;
        background: none;
        color: #9ca3af;
        font-size: 22px;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .mobile-cat-close-btn:active {
        background-color: #f3f4f6;
        color: #6b7280;
    }

    .mobile-cat-body {
        display: flex;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .mobile-cat-sidebar {
        width: 30%;
        min-width: 108px;
        background-color: #f3f4f6;
        border-left: 1px solid #e5e7eb;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-cat-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 86px;
        padding: 14px 6px;
        text-align: center;
        cursor: pointer;
        border-bottom: 1px solid #e5e7eb;
        color: #374151;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.5;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .mobile-cat-item .side-icon-text {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
        font-size: 22px;
        line-height: 1;
        color: inherit;
        flex-shrink: 0;
        overflow: visible;
    }

    .mobile-cat-item .side-icon-text svg {
        display: block;
        width: 32px;
        height: 32px;
        max-width: 100%;
        max-height: 100%;
        fill: currentColor;
        color: inherit;
        flex-shrink: 0;
        transform-origin: center center;
    }

    .mobile-cat-item.mobile-cat-item--dody .side-icon-text svg,
    .mobile-cat-item[data-target="cat-pane-dody"] .side-icon-text svg {
        transform: scale(2);
    }

    .mobile-cat-item[data-target="cat-pane-selooksi"] .side-icon-text svg {
        width: 42px !important;
        height: 42px !important;
        transform: scale(1.75);
        display: block;
        fill: #111111 !important;
        stroke: #111111 !important;
        color: #111111 !important;
    }


    .mobile-cat-item.active {
        background-color: #ffffff;
        color: #ef4056;
        font-weight: 800;
    }

    .mobile-cat-item.active::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 4px;
        background-color: #ef4056;
    }

    .mobile-cat-item.active[data-target="cat-pane-selooksi"] .side-icon-text svg,
    .mobile-cat-item.active .side-icon-text svg {
        fill: #ef4056 !important;
        stroke: #ef4056 !important;
        color: #ef4056 !important;
    }


    .mobile-cat-content {
        width: 70%;
        min-width: 0;
        background-color: #ffffff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
    }

    .mobile-cat-pane {
        display: none;
    }

    .mobile-cat-pane.active {
        display: block;
    }

    .pane-header-box {
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px dashed #e5e7eb;
    }

    .all-products-link {
        display: inline-block;
        font-size: 12px;
        font-weight: 700;
        color: #0284c7;
        text-decoration: none;
        line-height: 1.7;
    }
    .pane-header-box-2 {
        margin-top: 20px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px dashed #e5e7eb;
    }

    .all-products-link-2 {
        display: inline-block;
        font-size: 12px;
        font-weight: 700;
        color: #0284c7;
        text-decoration: none;
        line-height: 1.7;
    }
    .sub-group-title {
        margin: 14px 0 8px 0;
        padding-right: 6px;
        border-right: 3px solid #ef4056;
        font-size: 14px;
        font-weight: 700;
        color: #1f2937;
        line-height: 1.6;
    }

    .mobile-subcat-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-subcat-list li {
        margin-bottom: 6px;
    }

    .mobile-subcat-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 12px;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.8;
        color: #374151;
        text-decoration: none;
        background-color: #f9fafb;
        border: 1px solid #f3f4f6;
        border-radius: 6px;
        transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

    .mobile-subcat-list a:active {
        background-color: #f3f4f6;
        border-color: #e5e7eb;
    }

    .mobile-subcat-list a .chevron {
        font-size: 12px;
        color: #9ca3af;
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 0 16px !important;
    }

    .product-card {
        background: transparent !important;
        border-top: none !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: 1px solid var(--kc-line) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transition: none !important;
        padding: 0 !important;
        max-width: none !important;
        justify-self: stretch !important;
    }

    .product-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .product-main-link {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 16px 0 !important;
        gap: 16px !important;
    }

    .product-image-box {
        width: 110px !important;
        height: 110px !important;
        min-height: auto !important;
        max-height: none !important;
        aspect-ratio: 1 / 1 !important;
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fdfdfd !important;
        border: 1px solid #f0f0f1 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .product-image-box img {
        width: 90% !important;
        height: 90% !important;
        object-fit: contain !important;
        border-radius: 0 !important;
    }

    .product-info-box {
        display: flex;
        flex-direction: column;      /* چیدمان عمودی: بالا به پایین */
        justify-content: flex-start; /* کلید اصلی: چسبیدن محتوا به سقف باکس */
        align-items: flex-start;     /* تراز کردن محتوا به سمت راست (RTL) */
        width: 100%;
        padding: 10px;               /* فاصله داخلی */
        gap: 8px;                    /* فاصله بین نام کالا، موجودی و قیمت */
    }

    /* نام کالا */
    .product-title {
        margin: 0;                   /* حذف فاصله اضافی دور عنوان */
        font-size: 1.1rem;
        font-weight: bold;
        text-align: right;
    }


    .product-price-section {
        margin-top: auto !important;
        display: flex !important;
        justify-content: flex-start !important;
        text-align: right !important;
    }

    .price-num,
    .product-price-section span {
        font-size: 16px !important;
        font-weight: 500 !important;
        color: rgb(30 30 30 / 0.65) !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
    }

    .product-action-link,
    .product-action-box,
    .product-image-link {
        display: none !important;
    }

    .product-main-link .product-gallery-slider {
        width: 110px !important;
        height: 110px !important;
        flex-shrink: 0;
        border-radius: 8px;
    }
}


/* ==========================================================================
    12 All Finish Strip
   ========================================================================== */
.all-finish-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  padding: 20px 10px 25px;
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;

  overflow-x: auto;
  overflow-y: hidden;

  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;

}

/* این کلاس توسط JS اضافه می‌شود */
.all-finish-strip.is-centered {
  justify-content: center;
}

.all-finish-strip::-webkit-scrollbar {
  display: none;
}

.all-finish-strip * {
  user-select: none;
  -webkit-user-drag: none;
}

.all-finish-strip:active {
  cursor: grabbing;
}

.finish-pill {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.2s ease;
  pointer-events: auto;
}

.finish-pill:hover {
  transform: translateY(-5px);
}

.finish-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid #eee;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  line-height: 0;
  transition: all 0.3s ease;
  flex: 0 0 auto;
}

/* اصلاح آیکون‌های فینیش برای جلوگیری از بیرون‌زدگی */
.finish-icon svg,
.finish-icon img {
    width: 90% !important;   /* کاهش ابعاد برای ایجاد حاشیه امن */
    height: 90% !important;
    object-fit: contain;     /* اطمینان از نمایش کامل تصویر بدون برش */
    display: block;
    margin: auto;            /* مرکزچینی در صورت نیاز */
}

.finish-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--kc-text);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.finish-pill.is-active .finish-icon {
  border-color: var(--kc-red);
  box-shadow: 0 0 12px rgba(217, 4, 41, 0.2);
  transform: scale(1.05);
}

.finish-pill.is-active .finish-label {
  color: var(--kc-red);
}

@media (max-width: 600px) {
  .all-finish-strip {
    gap: 16px;
    padding: 14px 8px 20px;
  }
  .finish-icon {
    width: 80px;
    height: 80px;
  }
  .finish-label {
    font-size: 12px;
  }
}


.low-stock-label {
    display: inline-block;
    margin-bottom: 0;
    padding: 4px 10px;
    border-radius: 8px;
    background: #fff3cd;
    color: #856404;
    font-size: 13px;
    font-weight: 700;
}

.out-of-stock-label {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f8d7da;
    color: #721c24;
    font-size: 13px;
    font-weight: 700;
}


.profile-page {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 16px 40px;
    align-items: flex-start;
}

.profile-sidebar {
    width: 290px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #e6edf7;
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.07);
    padding: 24px 18px;
    position: sticky;
    top: 20px;
}

.profile-user-box {
    text-align: center;
    padding-bottom: 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid #edf2f7;
}

.profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

.profile-user-box h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

.profile-user-box p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    direction: ltr;
    text-align: center;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    width: 100%;
    border: 0;
    background: #f8fafc;
    color: #334155;
    padding: 13px 16px;
    border-radius: 14px;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;

}

.menu-item:hover {
    background: #eef2ff;
    color: #4338ca;
    transform: translateX(-2px);
}

.menu-item.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.18);
}

.logout-link {
    display: block;
    text-decoration: none;
    text-align: center;
    margin-top: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    background: #fff1f2;
    color: #e11d48;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #ffe4e6;
    transition: all 0.22s ease;
}

.logout-link:hover {
    background: #ffe4e6;
}

.profile-content {
    flex: 1;
    min-width: 0;
}

.profile-card {
    display: none;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border: 1px solid #e6edf7;
    border-radius: 24px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
    padding: 28px;
}

.profile-card.active {
    display: block;
    animation: fadeInUp 0.25s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header,
.section-simple-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.card-header {
    padding-bottom: 18px;
    border-bottom: 1px solid #edf2f7;
}

.card-header h2,
.section-simple-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
}

.card-subtitle,
.modal-subtitle {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
}

.btn-edit-trigger {
    border: 0;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4338ca;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.22s ease;
    white-space: nowrap;
}

.btn-edit-trigger:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.2);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: #f8fbff;
    border: 1px solid #e7eef8;
    border-radius: 18px;
    transition: all 0.22s ease;
}

.info-item-row:hover {
    background: #f2f7ff;
    border-color: #dbe8fb;
}

.info-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.info-value {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    word-break: break-word;
}

.info-status {
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.empty-state {
    padding: 56px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    background: #f8fafc;
    border: 1px dashed #dbe4f0;
    border-radius: 18px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #e7eef8;
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.2);
    padding: 24px;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.22s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf2f7;
}

.modal-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
}

.modal-close-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.modal-input {
    width: 100%;
    height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 14px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.modal-input-ltr {
    direction: ltr;
    text-align: left;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.btn-cancel,
.btn-submit {
    border: 0;
    border-radius: 14px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.22s ease;
}

.btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-submit {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.18);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(79, 70, 229, 0.24);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 992px) {
    .profile-page {
        flex-direction: column;
    }

    .profile-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .profile-card {
        padding: 20px;
        border-radius: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-edit-trigger {
        width: 100%;
        justify-content: center;
    }

    .info-item-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-status {
        width: 100%;
    }

    .badge {
        width: 100%;
    }

    .modal-container {
        padding: 18px;
        border-radius: 20px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
    }
}




/* ==========================================================================
    11 All Finish Strip
   ========================================================================== */


/* تنظیمات کلی صفحه */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    background-color: #f9f9f9;
}

/* کارت اصلی لاگین */
.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-header {
    margin-bottom: 25px;
}

.auth-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.auth-subtitle {
    color: #666;
    font-size: 14px;
}

/* فرم و اینپوت‌ها */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: right;
}

.auth-label {
    display: block;
    margin-bottom: 5px;
    color: #444;
    font-weight: bold;
}

.auth-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    direction: ltr; /* برای شماره موبایل و کد بهتره */
    box-sizing: border-box;
}

.auth-input-code {
    text-align: center;
    letter-spacing: 5px;
    font-weight: bold;
}

/* دکمه‌ها */
.auth-button {
    background-color: #007bff; /* رنگ اصلی آریا شبرنگ */
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin-top: 10px;
}

.auth-button:hover {
    background-color: #0056b3;
}

.auth-link {
    display: block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.auth-alert {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.auth-phone-box {
    margin-bottom: 15px;
    font-size: 14px;
    color: #555;
    background: #e9ecef;
    padding: 10px;
    border-radius: 8px;
}
/* حذف نوشته‌های پیش‌فرض در مرورگرهای کروم و ادج */
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: transparent;
}

/* وقتی کاربر روی فیلد کلیک کرد یا مقداری داشت، نوشته‌ها سیاه شوند */
input[type="date"]:focus::-webkit-datetime-edit-text,
input[type="date"]:focus::-webkit-datetime-edit-month-field,
input[type="date"]:focus::-webkit-datetime-edit-day-field,
input[type="date"]:focus::-webkit-datetime-edit-year-field,
input[type="date"]:not([value=""])::-webkit-datetime-edit-text,
input[type="date"]:not([value=""])::-webkit-datetime-edit-month-field,
input[type="date"]:not([value=""])::-webkit-datetime-edit-day-field,
input[type="date"]:not([value=""])::-webkit-datetime-edit-year-field {
    color: #444; /* یا هر رنگی که برای متن دارید */
}

.birth-date-container {
    display: flex;
    gap: 10px;
}
.date-part {
    text-align: center;
}



/* --- بخش ورود و سبد خرید --- */
.user-box {
    display: flex;
    align-items: center;
    gap: 12px; /* فاصله بین آیتم‌های بخش کاربری */
}

.user-box .login-btn,
.user-box .cart-btn {
    text-decoration: none;
    color: #333;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.user-box .login-btn:hover,
.user-box .cart-btn:hover {
    color: #ef4056; /* تغییر رنگ ملایم در هاور */
}

.user-box .separator {
    color: #ddd;
    user-select: none;
}

/* --- ردیف پایین (فقط برای دسته‌بندی و منوها) --- */
.header-bottom {
    border-top: 1px solid #f0f0f0; /* خط جداکننده افقی دقیق و تمیز */
    padding: 5px 0;
    width: 100%;
    clear: both; /* جلوگیری از تاثیر فلوت‌های احتمالی */
}

.menu-trigger-wrapper {
    position: relative;
    display: inline-block;
}

.menu-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    color: #333;
    user-select: none;
}

.menu-trigger:hover {
    color: #ef4056;
}

/* مگا منو (اگر استفاده می‌شود) زیر دکمه قرار گیرد و روی عناصر دیگر تأثیر نگذارد */
.mega-menu-structure {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 999;
}
/* ==========================================================================
   12. base
   ========================================================================== */

.product-sort-controls {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin: 8px 0;
}

.product-sort-controls form {
    margin-right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    direction: rtl;
}

.product-sort-controls label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.product-sort-controls select {
    min-width: 130px;
    height: 34px;
    padding: 0 10px 0 28px;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    background-color: #fff;
    color: #222;
    font-family: inherit;
    font-size: 13px;
    line-height: 34px;
    cursor: pointer;
    outline: none;
}

.product-sort-controls select:hover {
    border-color: #b8b8b8;
}

.product-sort-controls select:focus {
    border-color: #9a9a9a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.footer-copyright {
    margin-block-end: 10px;
    border-top: 1px solid #e5e5e5;
    margin-top: 24px;
    padding-top: 16px;
    text-align: center;
    font-size: 13px;
    color: #777;
}
.footer-main {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 28px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.footer-brand,
.footer-col {
    min-width: 0;
}

.footer-col {
    text-align: center;
}

.footer-brand {
    text-align: center;
}

.footer-col h4 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
}

.footer-col a {
    display: block;
    max-width: 150px;
    margin: 0 auto 10px;
    text-align: center;
    line-height: 1.9;
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px 12px;
    }

    .footer-brand {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
        margin-bottom: 8px;
    }

    .footer-logo {
        margin: 0 auto 10px;
    }

    .footer-desc {
        margin: 0 auto;
        max-width: 220px;
        text-align: center;
    }
}
/* =========================
   Aria Shabrang Loading
   ========================= */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    opacity: 1;
    visibility: visible;

    transition:
        opacity 0.45s ease,
        visibility 0.45s ease,
        backdrop-filter 0.45s ease,
        -webkit-backdrop-filter 0.45s ease;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(280px, 78vw);
    padding: 24px 22px;
    border-radius: 10px;
    text-align: center;

    background-color: rgba(255, 255, 255, 0.38);

    animation: loading-content-in 0.7s ease both;
}

/* نام برند */
.loading-brand {
    position: relative;

    margin: 0 0 24px;
    padding: 0;

    color: #181818;
    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;

    direction: ltr;
    overflow: hidden;
}

/* برق ملایم روی نام برند */
.loading-brand::after {
    position: absolute;
    inset: 0;

    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.92) 45%,
        transparent 70%
    );

    content: "";
    transform: translateX(-130%);
    animation: brand-shine 2.2s ease-in-out infinite;
}

/* خط اصلی */
.loading-line {
    position: relative;

    width: 100%;
    height: 3px;

    overflow: hidden;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.08);
}

/* بخش متحرک خط */
.loading-line span {
    position: absolute;
    top: 0;
    left: 0;

    width: 40%;
    height: 100%;

    border-radius: inherit;
    background-color: #e5242a;

    animation: loading-line-move 1.25s ease-in-out infinite;
}

/* متن فارسی */
.loading-text {
    margin: 16px 0 0;

    color: #555555;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0;

    direction: rtl;
}

/* سه نقطه متحرک فقط با CSS */
.loading-text::after {
    display: inline-block;
    width: 20px;

    overflow: hidden;
    vertical-align: bottom;

    content: "...";
    text-align: right;

    animation: loading-text-dots 1.4s steps(4, end) infinite;
}

/* خروج صفحه لودینگ */
.loading-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

/* ورود نرم محتوا */
@keyframes loading-content-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* حرکت خط قرمز */
@keyframes loading-line-move {
    0% {
        transform: translateX(-110%);
    }

    50% {
        transform: translateX(75%);
    }

    100% {
        transform: translateX(250%);
    }
}

/* برق روی نام */
@keyframes brand-shine {
    0%,
    30% {
        transform: translateX(-130%);
    }

    70%,
    100% {
        transform: translateX(130%);
    }
}

/* نقطه‌های متن */
@keyframes loading-text-dots {
    0% {
        width: 0;
    }

    100% {
        width: 20px;
    }
}

/* تنظیمات موبایل */
@media (max-width: 480px) {
    .loading-content {
        width: min(240px, 76vw);
        padding: 20px 18px;
    }

    .loading-brand {
        margin-bottom: 20px;
        font-size: 24px;
    }

    .loading-text {
        margin-top: 14px;
        font-size: 13px;
    }
}

/* احترام به تنظیم کاهش حرکت کاربر */
@media (prefers-reduced-motion: reduce) {
    .loading-content,
    .loading-brand::after,
    .loading-line span,
    .loading-text::after {
        animation: none;
    }

    .loading-line span {
        left: 30%;
    }
}
/* ==========================================================================
   RIRA Product Card (Clean / Digikala-Style - Desktop Optimized)
   - Title & Stock immediately below image
   - Price & Action Button anchored at bottom
   ========================================================================== */

/* ------------------------------
   Design Tokens
------------------------------ */
:root {
  --card-bg: #ffffff;
  --card-border: #f0f0f1;

  --text-1: #232933;
  --text-2: #81858b;
  --text-muted: #9ca3af;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.08);

  --radius: 16px;
  --radius-img: 12px;
  --radius-btn: 10px;

  --success: #10b981;
  --success-hover: #059669;

  --info: #2563eb;
  --info-hover: #1d4ed8;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --muted-bg: #f3f4f6;

  --ring: 0 0 0 3px rgba(16, 185, 129, 0.18);
  --gap: 16px;
}

/* ------------------------------
   Grid
------------------------------ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--gap);
  direction: rtl;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* ------------------------------
   Card Shell
------------------------------ */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;

  display: flex;
  flex-direction: column; /* چیدمان عمودی مستقیم */
  justify-content: flex-start; /* شروع المان‌ها از بالا */

  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.product-card:hover {
  border-color: #e2e8f0;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* برای اینکه Wrapper میانی فلکس باکس کارت را خراب نکند */
.product-content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* ------------------------------
   Link Area (Image + Title)
------------------------------ */
.product-main-link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  text-decoration: none;
  outline: none;
  width: 100%;
}

.product-main-link:focus-visible {
  box-shadow: var(--ring);
}

/* ------------------------------
   Gallery / Image Wrapper
------------------------------ */
.product-gallery-container {
  width: 100%;
}

.gallery-link {
  text-decoration: none;
  display: block;
}

.product-gallery-slider {
  padding: 12px 12px 0 12px; /* فواصل اطراف عکس */
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.product-gallery-slider .slider-wrapper {
  border-radius: var(--radius-img);
  overflow: hidden;
  background: #f8fafc;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f8fafc;
}

.product-gallery-slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.slider-indicators {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.slider-indicators .indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
}

.slider-indicators .indicator.active {
  background: var(--success);
}

/* ------------------------------
   Info / Title Box (چسبیده زیر عکس)
------------------------------ */
.product-info-box {
  padding: 8px 14px 0px 14px; /* فاصله بسیار کم از بالا برای چسبیدن به عکس */
  display: flex;
  flex-direction: column;
  align-items: stretch; /* تراز کردن محتویات اطلاعات به وسط */
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.product-title {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-1);
  font-weight: 700;
  text-align: center; /* راستای عنوان به صورت وسط‌چین */
  width: 100%;

  /* محدودسازی استاندارد به ۲ خط */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 43px;
}

.low-stock-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  margin-top: 4px;
}

/* ------------------------------
   Bottom Buy Row (قیمت و دکمه چسبیده به کف کارت)
------------------------------ */
.product-buy-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;

  padding: 10px 14px 14px 14px;
  border-top: 1px dashed #f1f5f9;
  margin-top: auto; /* تضمین چسبیدن کامل کل این بخش به کف کارت */
  box-sizing: border-box;
  width: 100%;
}

/* بخش قیمت (تغییر یافته به وسط‌چین) */
.product-price-section {
  width: 100%;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center; /* وسط‌چین کردن قیمت و وضعیت ناموجودی */
  direction: ltr;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.price-num {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.2px;
}

.price-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.out-of-stock-label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--danger);
  background: var(--danger-bg);
  direction: rtl;
  text-align: center;
}

.price-call {
  font-size: 12px;
  font-weight: 800;
  color: var(--info);
  direction: rtl;
  text-align: center;
}

/* بخش دکمه خرید */
.product-action-box {
  width: 100%;
}

.add-to-cart-form {
  margin: 0;
  padding: 0;
  width: 100%;
}

.add-to-cart-btn {
  width: 100%;
  height: 38px;
  padding: 0 12px;

  border: 0;
  border-radius: var(--radius-btn);

  background: var(--success);
  color: #ffffff;

  font-size: 12.5px;
  font-weight: 800;

  cursor: pointer;
  user-select: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  white-space: nowrap;
  text-decoration: none;

  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.add-to-cart-btn:hover {
  background: var(--success-hover);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.32);
}

.add-to-cart-btn:active {
  transform: scale(0.98);
}

.add-to-cart-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.add-to-cart-btn svg {
  flex-shrink: 0;
}

/* دکمه غیرفعال و ناموجود */
.add-to-cart-btn.disabled,
.add-to-cart-btn[disabled] {
  background: var(--muted-bg);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* دکمه استعلام قیمت */
.add-to-cart-btn.contact-btn {
  background: var(--info);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.add-to-cart-btn.contact-btn:hover {
  background: var(--info-hover);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

/* ۱. تنظیم کارت اصلی به عنوان مرجع موقعیت‌دهی */
.product-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* افکت اختیاری و زیبای hover برای کارت */
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ۲. تعمیم کلیک لینک اصلی به تمام ابعاد کارت */
.product-card .product-main-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* کلیک روی کل محدوده کارت */
}

/* ۳. بالا آوردن دکمه‌های عملیاتی تا مستقل از کلیک کلی کارت عمل کنند */
.product-card .product-action-box,
.product-card .add-to-cart-form,
.product-card .add-to-cart-btn,
.product-card .slider-indicators {
    position: relative;
    z-index: 2; /* اولویت بالاتر از لینک کلی کارت */
}
.fabric-circle-icon {
    width: 125px;
    height: 125px;
    display: block;
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.finish-pill {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.finish-pill:hover .fabric-circle-icon {
    transform: scale(1.06);
    filter: brightness(1.12);
}

.finish-pill.is-active .fabric-circle-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px rgba(114, 183, 216, 0.55));
}

.finish-label {
    color: #fff;
    font-size: 14px;
    text-align: center;
}

/* دایره قرمز دور آیکون */
.finish-pill .fabric-circle-icon {
    border: 3px solid transparent; /* در حالت عادی شفاف است */
    border-radius: 50%; /* دایره‌ای */
    transition: all 0.3s ease; /* انیمیشن نرم */
}

.finish-pill.is-active .fabric-circle-icon {
    border-color: #ff0000; /* رنگ قرمز در حالت انتخاب */
    transform: scale(1.05); /* کمی بزرگنمایی برای جذابیت */
}

/* متن "انتخاب شد" در زیر */
.active-label {
    display: none; /* مخفی در حالت عادی */
    color: #ff0000;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.finish-pill.is-active .active-label {
    display: block; /* نمایش در حالت انتخاب */
}
/* تنظیم کارت برای چسبیدن دکمه‌ها به پایین ترین سطح یکدست */
.category-product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.category-product-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

/* ارتفاع ثابت برای ردیف قیمت تا در نبود قیمت هم دکمه‌ها هم‌تراز بمانند */
.category-product-price-row {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.category-product-price {
    font-weight: bold;
    color: #333;
    font-size: 0.95rem;
}

/* کانتینر دکمه اکشن در کف کارت */
.category-product-action {
    width: 100%;
    margin-top: auto;
}

/* کلاس مشترک برای تمام دکمه‌ها جهت هم‌اندازه بودن */
.category-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

/* ۱. افزودن به سبد خرید (سبز) */
.category-action-btn.add-to-cart-btn {
    background-color: #22c55e;
    color: #ffffff;
}
.category-action-btn.add-to-cart-btn:hover {
    background-color: #16a34a;
}

/* ۲. تماس بگیرید (آبی) */
.category-action-btn.contact-btn {
    background-color: #2563eb;
    color: #ffffff;
}
.category-action-btn.contact-btn:hover {
    background-color: #1d4ed8;
}

/* ۳. ناموجود (خاکستری غیرفعال یا متن ساده هم‌سطح) */
.category-action-btn.disabled-btn {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border: 1px solid #e2e8f0;
}
/* کانتینر اصلی بخش دکمه و دراپ‌داون */
.cart-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* نشانگر تعداد بالای آیکون سبد خرید (اختیاری) */
.cart-badge {
    background-color: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    margin-right: 4px;
}

/* پنل دراپ‌داون شناور */
.cart-preview-dropdown {
    position: absolute;
    top: 100%;
    left: 0; /* در حالت راست‌به‌چپ به سمت لبه دکمه تراز می‌شود */
    width: 320px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 16px;
    z-index: 1000;

    /* حالت پیش‌فرض: پنهان */
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* ایجاد فضای نامرئی برای جلوگیری از بسته شدن هنگام حرکت موس */
.cart-preview-dropdown::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
}

/* نمایش نرم هنگام هاور */
.cart-dropdown-wrapper:hover .cart-preview-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(6px);
    pointer-events: auto;
}

/* هدر دراپ‌داون */
.cart-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.view-cart-link {
    color: #3b82f6;
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
}
.view-cart-link:hover {
    text-decoration: underline;
}

/* لیست آیتم‌ها با اسکرول باریک در صورت زیاد بودن کالاها */
.cart-dropdown-items {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 0;
}

.cart-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}
.cart-mini-item:last-child {
    border-bottom: none;
}

.mini-item-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.mini-item-placeholder {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-item-info {
    flex: 1;
    text-align: right;
}

.mini-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.mini-item-meta {
    font-size: 12px;
    color: #64748b;
}

.mini-item-price {
    color: #059669;
    font-weight: 600;
}

/* فوتر دراپ‌داون */
.cart-dropdown-footer {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    margin-top: 6px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    margin-bottom: 12px;
}

.btn-checkout-mini {
    display: block;
    width: 100%;
    text-align: center;
    background: #10b981;
    color: #ffffff !important;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.btn-checkout-mini:hover {
    background: #059669;
}

/* استایل حالت خالی (سبد خالی + آدمک ناراحت) */
.cart-empty-state {
    text-align: center;
    padding: 24px 12px;
}

.sad-icon-wrapper {
    margin-bottom: 12px;
    display: inline-flex;
    padding: 12px;
    background: #f8fafc;
    border-radius: 50%;
}

.empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 6px 0;
}

.empty-desc {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}
/* ==========================================================================
   Cart Badge & Dropdown Component (Desktop & Mobile)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Desktop Header Cart Button & Badge
   -------------------------------------------------------------------------- */

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--slider-radius-sm);
  color: var(--slider-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.cart-btn:hover {
  color: var(--slider-primary-hover);
  background-color: rgba(196, 13, 42, 0.06);
}

.cart-btn svg {
  width: 19px;
  height: 19px;
  transition: transform 0.2s ease;
}

.cart-btn:hover svg {
  transform: translateY(-1px) scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -10px; /* یا -9px */
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--page-bg);
  border-radius: 999px;
  background: var(--slider-primary-hover);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(196, 13, 42, 0.35);
  pointer-events: none;
  animation: cartBadgePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cart-badge[data-zero="true"],
.cart-badge:empty {
  background: #94a3b8;
  box-shadow: none;
}

.cart-badge.bump {
  animation: cartBadgeBump 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}



/* --------------------------------------------------------------------------
   Mobile Navigation Cart Badge
   -------------------------------------------------------------------------- */

.nav-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-count-badge {
  position: absolute;
  top: -4px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--page-bg);
  border-radius: 999px;
  background: var(--slider-primary-hover);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(196, 13, 42, 0.3);
  animation: cartBadgePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* --------------------------------------------------------------------------
   Animations & Responsive
   -------------------------------------------------------------------------- */

@keyframes cartBadgePop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes cartBadgeBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes sadFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

@media (max-width: 768px) {
  .cart-preview-dropdown {
    position: fixed;
    top: 60px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    transform: translateY(8px);
  }

  .cart-preview-dropdown::before {
    display: none;
  }

  .cart-dropdown-wrapper:hover .cart-preview-dropdown,
  .cart-dropdown-wrapper:focus-within .cart-preview-dropdown {
    transform: translateY(0);
  }
}



.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    inset-inline-end: -10px;

    min-width: 20px;
    height: 20px;
    padding: 0 5px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #ffffff;
    border-radius: 999px;

    background: #e11d48;
    color: #ffffff;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    z-index: 5;
}

.nav-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
}

.cart-count-badge {
    position: absolute;
    top: -7px;
    inset-inline-end: -9px;

    min-width: 18px;
    height: 18px;
    padding: 0 4px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #ffffff;
    border-radius: 999px;

    background: #e11d48;
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    z-index: 5;
}

/* ==========================================================================
   RIRA Product Card (Clean / Digikala-Style - Desktop Optimized)
   - Title & Stock immediately below image
   - Price & Action Button anchored at bottom
   ========================================================================== */

/* ------------------------------
   Design Tokens
------------------------------ */
:root {
  --card-bg: #ffffff;
  --card-border: #f0f0f1;

  --text-1: #232933;
  --text-2: #81858b;
  --text-muted: #9ca3af;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.08);

  --radius: 16px;
  --radius-img: 12px;
  --radius-btn: 10px;

  --success: #10b981;
  --success-hover: #059669;

  --info: #2563eb;
  --info-hover: #1d4ed8;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --muted-bg: #f3f4f6;

  --ring: 0 0 0 3px rgba(16, 185, 129, 0.18);
  --gap: 16px;
}

/* ------------------------------
   Grid
------------------------------ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--gap);
  direction: rtl;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* ------------------------------
   Card Shell
------------------------------ */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;

  display: flex;
  flex-direction: column; /* چیدمان عمودی مستقیم */
  justify-content: flex-start; /* شروع المان‌ها از بالا */

  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.product-card:hover {
  border-color: #e2e8f0;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* برای اینکه Wrapper میانی فلکس باکس کارت را خراب نکند */
.product-content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* ------------------------------
   Link Area (Image + Title)
------------------------------ */
.product-main-link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  text-decoration: none;
  outline: none;
  width: 100%;
}

.product-main-link:focus-visible {
  box-shadow: var(--ring);
}

/* ------------------------------
   Gallery / Image Wrapper
------------------------------ */
.product-gallery-container {
  width: 100%;
}

.gallery-link {
  text-decoration: none;
  display: block;
}

.product-gallery-slider {
  padding: 12px 12px 0 12px; /* فواصل اطراف عکس */
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.product-gallery-slider .slider-wrapper {
  border-radius: var(--radius-img);
  overflow: hidden;
  background: #f8fafc;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f8fafc;
}

.product-gallery-slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.no-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.slider-indicators {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.slider-indicators .indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
}

.slider-indicators .indicator.active {
  background: var(--success);
}

/* ------------------------------
   Info / Title Box (چسبیده زیر عکس)
------------------------------ */
.product-info-box {
  padding: 8px 14px 0px 14px; /* فاصله بسیار کم از بالا برای چسبیدن به عکس */
  display: flex;
  flex-direction: column;
  align-items: stretch; /* تراز کردن محتویات اطلاعات به وسط */
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.product-title {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-1);
  font-weight: 700;
  text-align: center; /* راستای عنوان به صورت وسط‌چین */
  width: 100%;

  /* محدودسازی استاندارد به ۲ خط */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 43px;
}

.low-stock-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  margin-top: 4px;
}

/* ------------------------------
   Bottom Buy Row (قیمت و دکمه چسبیده به کف کارت)
------------------------------ */
.product-buy-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;

  padding: 10px 14px 14px 14px;
  border-top: 1px dashed #f1f5f9;
  margin-top: auto; /* تضمین چسبیدن کامل کل این بخش به کف کارت */
  box-sizing: border-box;
  width: 100%;
}

/* بخش قیمت (تغییر یافته به وسط‌چین) */
.product-price-section {
  width: 100%;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center; /* وسط‌چین کردن قیمت و وضعیت ناموجودی */
  direction: ltr;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.price-num {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.2px;
}

.price-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.out-of-stock-label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--danger);
  background: var(--danger-bg);
  direction: rtl;
  text-align: center;
}

.price-call {
  font-size: 12px;
  font-weight: 800;
  color: var(--info);
  direction: rtl;
  text-align: center;
}

/* بخش دکمه خرید */
.product-action-box {
  width: 100%;
}

.add-to-cart-form {
  margin: 0;
  padding: 0;
  width: 100%;
}

.add-to-cart-btn {
  width: 100%;
  height: 38px;
  padding: 0 12px;

  border: 0;
  border-radius: var(--radius-btn);

  background: var(--success);
  color: #ffffff;

  font-size: 12.5px;
  font-weight: 800;

  cursor: pointer;
  user-select: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  white-space: nowrap;
  text-decoration: none;

  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.add-to-cart-btn:hover {
  background: var(--success-hover);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.32);
}

.add-to-cart-btn:active {
  transform: scale(0.98);
}

.add-to-cart-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.add-to-cart-btn svg {
  flex-shrink: 0;
}

/* دکمه غیرفعال و ناموجود */
.add-to-cart-btn.disabled,
.add-to-cart-btn[disabled] {
  background: var(--muted-bg);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* دکمه استعلام قیمت */
.add-to-cart-btn.contact-btn {
  background: var(--info);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.add-to-cart-btn.contact-btn:hover {
  background: var(--info-hover);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}
@media (max-width: 600px) {

    /* یک کارت در هر ردیف */
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 10px !important;
    }

    /* کارت افقی */
    .product-card {
        display: flex !important;
        flex-direction: row !important;
        direction: ltr !important;

        width: 100% !important;
        max-width: none !important;
        min-height: 165px !important;
        height: auto !important;

        padding: 10px !important;
        gap: 12px !important;

        border: 1px solid #eceff3 !important;
        border-radius: 14px !important;
        background: #fff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    /* ستون عکس */
    .product-gallery-container {
        flex: 0 0 135px !important;
        width: 135px !important;
        min-width: 135px !important;
        height: 135px !important;
        margin: 0 !important;
    }

    .gallery-link,
    .product-gallery-slider,
    .product-gallery-slider .slider-wrapper,
    .product-gallery-slider .slider-slide {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .product-gallery-slider {
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 1px solid #edf0f3 !important;
        border-radius: 14px !important;
        box-shadow: none !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    .product-gallery-slider .slider-wrapper {
        background: transparent !important;
    }

    .product-gallery-slider img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        padding: 5px !important;
        box-sizing: border-box !important;
    }

    .no-image-placeholder {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        font-size: 11px !important;
    }

    .slider-indicators {
        display: none !important;
    }

    /* بخش متن */
    .product-content-wrapper {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        min-width: 0 !important;
        padding: 0 !important;
        direction: rtl !important;
        text-align: right !important;
    }

    .product-main-link {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        text-decoration: none !important;
    }

    .product-info-box {
        padding: 0 !important;
        margin: 0 !important;
    }

    .product-title {
        display: -webkit-box !important;
        overflow: hidden !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;

        margin: 0 !important;
        min-height: 38px !important;
        color: #252525 !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        line-height: 1.65 !important;
    }

    .low-stock-label {
        display: block !important;
        margin-top: 4px !important;
        font-size: 10px !important;
    }

    /* بخش قیمت و دکمه */
    .product-buy-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 7px !important;
        padding: 0 !important;
        margin-top: 10px !important;
    }

    .product-price-section {
        min-height: auto !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* قیمت مثل نمونه */
    .price-row {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        direction: ltr !important;
        width: 100% !important;
        white-space: nowrap !important;
    }

    .price-num {
        font-size: 18px !important;
        font-weight: 800 !important;
        color: #111827 !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
    }

    .price-unit {
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #8b8f98 !important;
        line-height: 1 !important;
        margin-top: 2px !important;
    }

    .out-of-stock-label,
    .price-call {
        font-size: 12px !important;
        font-weight: 600 !important;
    }

    /* دکمه */
    .product-action-box {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .add-to-cart-form {
        width: 100% !important;
        margin: 0 !important;
    }

    .add-to-cart-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;

        width: 100% !important;
        height: 34px !important;
        padding: 0 8px !important;

        border-radius: 8px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    .add-to-cart-btn svg {
        width: 15px !important;
        height: 15px !important;
        flex-shrink: 0 !important;
    }
}


