/* =========================================================================
   فایل: home.css
   توضیح: استایل اختصاصی صفحه اصلی (هیرو، دسته‌بندی‌ها، اسلایدرهای محصول)
   نکته: متغیرهای رنگ از theme.css (که در header.php لود شده) استفاده می‌شود
   ========================================================================= */


/* *************************************************************************
   * ۱. بخش هیرو (اسلایدر بزرگ + باکس‌های تبلیغاتی)
   ************************************************************************* */

.hero-section {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 24px;
}

/* --- اسلایدر بزرگ (سمت راست) --- */
.hero-slider {
    position: relative;
    flex: 1;
    min-height: 340px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
}

.hero-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 340px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding: 40px 48px;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
    color: var(--color-white);
}
.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    position: relative; /* برای این‌که ارتفاع واقعی اسلاید فعال، ارتفاع کل اسلایدر را تعیین کند */
    align-items: stretch;
}

.hero-badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.5;
    max-width: 520px;
    margin-bottom: 12px;
    padding-right:85px;
}

.hero-desc {
    font-size: 14.5px;
    opacity: 0.9;
    max-width: 460px;
    margin-bottom: 24px;
    line-height: 1.9;
    padding-right:125px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 14px;
    padding: 12px 26px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}
.hero-btn:hover { background: var(--color-white); }

/* --- فلش‌های حرکت اسلایدر --- */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--color-white);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    z-index: 5;
}
.hero-arrow:hover { background: rgba(255,255,255,0.3); }
.hero-arrow--prev { right: 16px; }
.hero-arrow--next { left: 16px; }

.hero-dots {
    position: absolute;
    bottom: 16px;
    right: 50%;
    transform: translateX(50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: background var(--transition), width var(--transition);
}
.hero-dot.is-active {
    background: var(--color-white);
    width: 22px;
    border-radius: 5px;
}

/* --- باکس‌های تبلیغاتی (سمت چپ) --- */
.hero-promos {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.promo-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius-md);
    transition: transform var(--transition);
}
.promo-card:hover { transform: translateY(-3px); }

.promo-card--warm {
    background: #f6ece0;
    color: var(--color-primary-dark);
}
.promo-card--dark {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.promo-eyebrow {
    font-size: 12px;
    opacity: 0.75;
    margin-bottom: 8px;
}
.promo-title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.6;
    margin-bottom: 8px;
}
.promo-desc {
    font-size: 12.5px;
    opacity: 0.85;
    line-height: 1.8;
    margin-bottom: 14px;
}
.promo-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
}
.promo-card--dark .promo-link { color: var(--color-accent); }


/* *************************************************************************
   * ۲. ردیف آیکونی دسته‌بندی‌ها
   ************************************************************************* */

.categories-section { margin-top: 36px; }

.categories-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--color-white);
    border: 1px solid rgba(82,26,61,0.08);
    border-radius: var(--radius-md);
    padding: 22px 12px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.category-card:hover {
    box-shadow: 0 10px 24px rgba(82,26,61,0.1);
    transform: translateY(-3px);
}

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-bg, #f4eef1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}
.category-icon svg { width: 24px; height: 24px; }

.category-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text, #2b2b2b);
    text-align: center;
}


/* *************************************************************************
   * ۳. اسلایدرهای بندانگشتی محصول (پرفروش/تازه/پربازدید)
   ************************************************************************* */

.product-slider { margin-top: 40px; }

.product-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-direction: column;
}
.product-slider-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--color-primary-dark);
    position: relative;
    padding-inline-start: 14px;
}
.product-slider-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 4px;
    background: var(--color-primary);
}

.product-slider-nav { display: flex; gap: 8px; }
.slider-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-bg, #f4eef1);
    color: var(--color-primary-dark);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.slider-arrow:hover { background: var(--color-primary); color: var(--color-white); }

.product-slider-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    /* اسکرول‌بار ظریف و کم‌رنگ */
    scrollbar-width: thin;
    justify-content: center;
}
.product-slider-track::-webkit-scrollbar { height: 6px; }
.product-slider-track::-webkit-scrollbar-thumb { background: rgba(82,26,61,0.15); border-radius: 6px; }

.product-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    background: var(--color-white);
    border: 1px solid rgba(82,26,61,0.08);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: box-shadow var(--transition), transform var(--transition);
    color: var(--color-text, #2b2b2b);
}
.product-card:hover {
    box-shadow: 0 12px 28px rgba(82,26,61,0.12);
    transform: translateY(-3px);
}

.product-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg, #f4eef1);
    margin-bottom: 12px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.product-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 10px;
    /* محدود کردن نام محصول به دو خط تا کارت‌ها هم‌ارتفاع بمانند */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.price-old {
    font-size: 12px;
    color: #9a8f95;
    text-decoration: line-through;
}
.price-final {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--color-primary-dark);
}


/* *************************************************************************
   * ۴. ریسپانسیو صفحه اصلی
   ************************************************************************* */

@media (max-width: 992px) {
    .categories-row { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .hero-section { flex-direction: column; }
    .hero-promos { flex-direction: row; }
    .hero-title { font-size: 22px; }
    .hero-slide { padding: 28px; align-items: center; text-align: center; }
    .hero-desc { max-width: 100%; }
    .hero-arrow { display: none; } /* در موبایل فقط با سوایپ/نقطه‌ها جابه‌جا می‌شود */

    .categories-row { grid-template-columns: repeat(3, 1fr); }
    .category-title { font-size: 12px; }

    .product-card { flex-basis: 150px; }
}

@media (max-width: 480px) {
    .hero-promos { flex-direction: column; }
    .categories-row { grid-template-columns: repeat(2, 1fr); }
    
    
    
    
 /* ---------- ویدیوی پس‌زمینه باکس تبلیغاتی ---------- */
.promo-card { position: relative; overflow: hidden; }

.promo-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.promo-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.15));
    z-index: 1;
}
.promo-card--video { color: var(--color-white); }
.promo-card--video .promo-link { color: var(--color-accent); }

.promo-card-content { position: relative; z-index: 2; }   
    
    
 