/* apps\core\static\core\css\home.css */
:root {
    --ayak-primary: #0069d9;
    --ayak-primary-dark: #004f9e;
}
body { background-color: #f9fbfd; }

/* Hero Section */
.hero-wrapper {
    background: linear-gradient(135deg, var(--ayak-primary-dark) 0%, var(--ayak-primary) 100%);
}
.hero-banner-wrapper {
    width: 100%;
    background-color: #f8f9fa;
}

.hero-banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 6;
}

.text-justify-rtl { text-align: justify; text-align-last: right; }

/* ===========================
   Shared Hero Showcase Base
=============================== */
.invented-dark-blue-card,
.latest-dark-red-card {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 30px !important;
    padding: 0 !important;
    position: relative;
    overflow: hidden;
    display: flex;
    direction: rtl;
    height: var(--hero-height, 18rem);
    align-items: stretch;
    max-width: 92%;
    margin: 0 auto;
}

/* Shared ::before - Center decorative area */
.invented-dark-blue-card::before,
.latest-dark-red-card::before {
    content: '';
    order: 0;
    width: 60%;
    position: static;
    height: auto;
    background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 70%);
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 0;
    pointer-events: none;
    flex-shrink: 0;
}

/* Shared ::after - Decorative glow overlay */
.invented-dark-blue-card::after,
.latest-dark-red-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--hero-glow) 0%, var(--hero-glow-inner) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Shared children z-index */
.invented-dark-blue-card > *,
.latest-dark-red-card > * {
    position: relative;
    z-index: 1;
}

/* Shared - Title area (right side) */
.invented-dark-blue-card .section-title-wrapper,
.latest-dark-red-card .section-title-wrapper {
    order: -1;
    width: 18%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 25px;
    border-bottom: none !important;
    margin-bottom: 0 !important;
    gap: 20px;
    flex-shrink: 0;
}

.invented-dark-blue-card .section-title-wrapper h6,
.latest-dark-red-card .section-title-wrapper h6 {
    font-size: 28px !important;
    font-weight: 900 !important;
    color: white;
    line-height: 1.5;
    margin: 0;
}

.invented-dark-blue-card .section-title-wrapper a,
.latest-dark-red-card .section-title-wrapper a {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    width: fit-content;
}

.invented-dark-blue-card .section-title-wrapper a:hover,
.latest-dark-red-card .section-title-wrapper a:hover {
    color: white !important;
    gap: 8px;
}

/* Shared - Product scroll (right side) */
.invented-dark-blue-card .horizontal-scroll-container,
.latest-dark-red-card .horizontal-scroll-container {
    order: -1;
    width: 100%;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 20px 20px 10px;
    gap: 12px;
    -ms-overflow-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
    scroll-snap-type: x mandatory;
    flex-shrink: 0;
}

.invented-dark-blue-card .horizontal-scroll-container::-webkit-scrollbar,
.latest-dark-red-card .horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

/* Shared - Product items scroll snap */
.invented-dark-blue-card .product-item,
.latest-dark-red-card .product-item {
    scroll-snap-align: center;
}

/* Shared - Product cards premium look */
.invented-dark-blue-card .product-card,
.latest-dark-red-card .product-card {
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.invented-dark-blue-card .product-card:hover,
.latest-dark-red-card .product-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
    transform: translateY(-4px);
}

/* Shared - Section spacing */
section:has(.invented-dark-blue-card),
section:has(.latest-dark-red-card) {
    margin-bottom: 20px !important;
}

/* ===== Theme: Invented (Blue) ===== */
.invented-dark-blue-card {
    --hero-glow: rgba(0, 120, 255, 0.15);
    --hero-glow-inner: rgba(0, 80, 200, 0.05);
    background: linear-gradient(145deg, #0d2c54 0%, #153a6a 50%, #1a4478 100%) !important;
    box-shadow: 0 16px 48px rgba(13, 44, 84, 0.5), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.invented-dark-blue-card .section-title-wrapper h6::after {
    content: ' آیاک';
    display: block;
    font-size: 22px;
    font-weight: 700;
    opacity: 0.7;
    margin-top: 4px;
}

/* ===== Theme: Latest (Red) ===== */
.latest-dark-red-card {
    --hero-glow: rgba(200, 0, 30, 0.15);
    --hero-glow-inner: rgba(160, 0, 20, 0.05);
    background: linear-gradient(145deg, #7a0010 0%, #961018 50%, #a81020 100%) !important;
    box-shadow: 0 16px 48px rgba(122, 0, 16, 0.5), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.section-title-wrapper {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.glass-blue-card {
    background: linear-gradient(135deg, rgba(0, 105, 217, 0.08) 0%, rgba(0, 79, 158, 0.04) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 105, 217, 0.1);
    box-shadow: 0 4px 20px 0 rgba(0, 105, 217, 0.08);
    position: relative;
    overflow: hidden;
}

/* ===========================
   Horizontal Scroll & Products (استایل دیجیکالا)
=============================== */
.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 2px;
    padding: 8px 4px 12px 4px;
}
.horizontal-scroll-container::-webkit-scrollbar {
    height: 8px;
}
.horizontal-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
}
.horizontal-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

.product-item {
    flex: 0 0 160px;
    min-width: 160px;
    max-width: 160px;
}

/* کارت محصول - استایل دیجیکالا */
.product-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* تصویر محصول */
.product-img-wrapper {
    height: 132px;
    width: 132px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 8px;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

/* عنوان محصول */
.product-title {
    min-height: 40px;
    line-height: 20px;
    padding: 0 8px;
    margin-bottom: 8px;
}

.product-title a {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #3f4064 !important;
    line-height: 20px;
}

.product-title a:hover {
    color: var(--ayak-primary) !important;
}

/* قیمت - استایل دیجیکالا */
.price-section {
    padding: 0 8px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.discount-badge {
    background: #d32f2f;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.price-final {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #3f4064;
    font-size: 16px;
    font-weight: 700;
}

.price-final .toman-icon {
    width: 16px;
    height: 16px;
}

.price-original {
    color: #c0c2c5;
    text-decoration: line-through;
    font-size: 14px;
    text-align: left;
    padding-left: 20px;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================
   Categories - Horizontal Scroll
=============================== */
.glass-blue-card > .d-flex {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    justify-content: flex-start !important;
    gap: 8px;
    padding: 4px 0 12px 0;
}
.glass-blue-card > .d-flex::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex: 0 0 auto;
    width: 110px;
    min-width: 110px;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 0;
    transition: all 0.3s ease;
}
.category-item:hover {
    transform: translateY(-4px);
}

.cat-icon-wrapper {
    width: 100%;
    aspect-ratio: 1;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
    position: relative;
}
.category-item:hover .cat-icon-wrapper {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.cat-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.category-item span {
    display: block;
    margin-top: 8px;
    font-size: 11px !important;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

/* ===========================
   Brands — Circular Slot Carousel
   15 logical slots, seamless infinite loop
=============================== */
.brands-marquee {
    direction: ltr; /* مستقل کردن رفتار marquee از rtl صفحه */

    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
    mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.brands-track {
    display: flex;
    flex-wrap: nowrap;
    width: fit-content;
    gap: 16px;
    will-change: transform;
    animation: brandsScroll 40s linear infinite;
}

.brands-track:hover {
    animation-play-state: paused;
}
.brand-item:hover {
    transform: translateY(-4px);
    transition: transform 0.3s ease;
}

.brands-set {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Scroll left: 0 → -50% (exactly one set = 15 slots) */
@keyframes brandsScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .brands-track {
        animation: none;
        width: 100%;
    }
    .brands-set {
        flex-wrap: wrap;
        justify-content: center;
    }
    .brands-marquee {
        -webkit-mask-image: none;
        mask-image: none;
        overflow: visible;
    }
}
@media (hover: hover) and (pointer: fine) {
    .brands-track:hover {
        animation-play-state: paused;
    }
    .brand-item:hover {
        transform: translateY(-4px);
        transition: transform 0.3s ease;
    }
    .brand-item:hover .brand-logo-wrapper {
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    }
}

.brand-item {
    flex: 0 0 auto;
    width: 136px;
    padding: 0 8px;
    text-align: center;
    text-decoration: none;
}
.brand-item:hover { transform: translateY(-4px); transition: transform 0.3s ease; }

.brand-logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 8px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
    transition: box-shadow 0.3s ease;
}
.brand-item:hover .brand-logo-wrapper {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.brand-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-initial {
    font-size: 28px;
    font-weight: 800;
    color: #0d6efd;
    opacity: 0.7;
}

.brand-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================
   Blog Section
=============================== */
.blog-container {
    background-color: #e6efee;
    border-radius: 2rem;
    padding: 15px;
}
.blog-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    transition: all 0.3s ease;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--ayak-primary) 0%, #00c6ff 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover::before {
    opacity: 1;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 105, 217, 0.15) !important;
}

.blog-card .blog-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.blog-card .blog-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 105, 217, 0.3) 0%, rgba(0, 198, 255, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-img-wrapper::after {
    opacity: 1;
}

.blog-card img {
    transition: transform 0.4s ease;
}

.blog-card:hover img {
    transform: scale(1.08);
}

.blog-card h6 {
    color: #1a1a1a;
    font-weight: 700;
    transition: color 0.3s ease;
}

.blog-card:hover h6 {
    color: var(--ayak-primary);
}

.blog-card .text-muted {
    color: #6c757d !important;
    line-height: 1.6;
}

.blog-card .text-primary {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.3s ease;
}

.blog-card:hover .text-primary {
    gap: 8px;
}

.blog-card-square .blog-img-wrapper {
    aspect-ratio: 4/3;
    max-height: 160px;
}

.blog-card-square h6 {
    font-size: 12px;
}

@media (max-width: 768px) {
    .blog-card-square .blog-img-wrapper {
        aspect-ratio: 16/9;
        max-height: 120px;
    }
}

body:not(.page-home) .side-skyscraper {
    padding-top: 0 !important;
}
/* ===========================
   Responsive / Mobile
=============================== */
@media (max-width: 1200px) {
    .category-item { width: 100px; min-width: 100px; }
    .product-item { flex: 0 0 150px; min-width: 150px; max-width: 150px; }
}

@media (max-width: 992px) {
    .product-item { flex: 0 0 145px; min-width: 145px; max-width: 145px; }
    .product-img-wrapper { height: 120px; width: 120px; }
    .category-item { width: 95px; min-width: 95px; }
    .category-item span { font-size: 10px; }
}

@media (max-width: 768px) {
    .product-item { flex: 0 0 140px; min-width: 140px; max-width: 140px; }
    .product-img-wrapper { height: 110px; width: 110px; }
    .category-item { width: 90px; min-width: 90px; }
    .cat-icon-wrapper { border-radius: 12px !important; }
    .category-item span { font-size: 9px; }
}

@media (max-width: 576px) {
    .product-item { flex: 0 0 135px; min-width: 135px; max-width: 135px; }
    .product-img-wrapper { height: 100px; width: 100px; }
    .category-item { width: 85px; min-width: 85px; }
    .cat-icon-wrapper { border-radius: 10px !important; }
    .category-item span { font-size: 9px; }
    .price-final { font-size: 14px; }

    /* Full-width sections on mobile — remove parent container padding */
    main.container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    section:has(.invented-dark-blue-card),
    section:has(.latest-dark-red-card),
    section:has(.glass-blue-card),
    section:has(.brands-marquee) {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .invented-dark-blue-card,
    .latest-dark-red-card {
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    .glass-blue-card {
        border-radius: 0 !important;
    }
}
@media (max-width: 576px) {
    .brand-item { width: 104px; padding: 0 6px; }
    .brand-logo-wrapper { width: 80px; height: 80px; }
    .brand-name { font-size: 10px; }
}
@media (max-width: 767px) {
    .special-img-container { max-width: 300px; }
    .special-product-img { filter: drop-shadow(0 20px 30px rgba(0,0,0,0.3)); }
    .glow-effect {
        width: 250px;
        height: 250px;
        background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
        border-radius: 50%;
        z-index: 1;
    }
}

/* ===========================
   Hero Showcase - Responsive
=============================== */
@media (max-width: 1200px) {
    .invented-dark-blue-card,
    .latest-dark-red-card {
        height: 16rem;
    }
    .invented-dark-blue-card .section-title-wrapper h6,
    .latest-dark-red-card .section-title-wrapper h6 {
        font-size: 24px;
    }
    .invented-dark-blue-card .section-title-wrapper h6::after {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .invented-dark-blue-card,
    .latest-dark-red-card {
        height: 14rem;
    }
    .invented-dark-blue-card .section-title-wrapper,
    .latest-dark-red-card .section-title-wrapper {
        width: 22%;
        padding: 20px;
    }
    .invented-dark-blue-card .section-title-wrapper h6,
    .latest-dark-red-card .section-title-wrapper h6 {
        font-size: 20px;
    }
    .invented-dark-blue-card .section-title-wrapper h6::after {
        font-size: 16px;
    }
    .invented-dark-blue-card::before,
    .latest-dark-red-card::before {
        width: 50%;
    }
    .invented-dark-blue-card .horizontal-scroll-container,
    .latest-dark-red-card .horizontal-scroll-container {
        width: 28%;
    }
}

@media (max-width: 768px) {
    .invented-dark-blue-card,
    .latest-dark-red-card {
        flex-direction: column;
        height: auto;
        min-height: 280px;
    }
    .invented-dark-blue-card .section-title-wrapper,
    .latest-dark-red-card .section-title-wrapper {
        order: -1;
        width: 100%;
        padding: 20px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-bottom: 0 !important;
        gap: 10px;
    }
    .invented-dark-blue-card .section-title-wrapper h6,
    .latest-dark-red-card .section-title-wrapper h6 {
        font-size: 18px;
    }
    .invented-dark-blue-card .section-title-wrapper h6::after {
        display: none;
    }
    .invented-dark-blue-card::before,
    .latest-dark-red-card::before {
        display: none;
    }
    .invented-dark-blue-card::after,
    .latest-dark-red-card::after {
        display: none;
    }
    .invented-dark-blue-card .horizontal-scroll-container,
    .latest-dark-red-card .horizontal-scroll-container {
        order: 1;
        width: 100%;
        padding: 15px 20px 20px;
        overflow-x: auto;
    }
    section:has(.invented-dark-blue-card),
    section:has(.latest-dark-red-card) {
        margin-bottom: 30px !important;
    }
}

@media (max-width: 576px) {
    .invented-dark-blue-card .section-title-wrapper,
    .latest-dark-red-card .section-title-wrapper {
        padding: 15px;
    }
    .invented-dark-blue-card .section-title-wrapper h6,
    .latest-dark-red-card .section-title-wrapper h6 {
        font-size: 16px;
    }
    .invented-dark-blue-card .horizontal-scroll-container,
    .latest-dark-red-card .horizontal-scroll-container {
        padding: 10px 15px 15px;
    }
}
