/* ===== HOMEPAGE STYLES ===== */

/* Hero Section */
.hero-section {
    position: relative;
    margin-bottom: 0;
    padding-bottom: 0;
}

.hero-slider {
    height: auto;
    width: 100%;
}

@media (min-width: 768px) {
    .hero-slider,
    .hero-slider .swiper-wrapper,
    .hero-slider .swiper-slide,
    .hero-slide-link {
        height: auto !important;
        aspect-ratio: 2560 / 1086 !important;
    }
}

/* Margin for Bottom Banner specifically */
.bottom-hero-section {
    margin-top: 0;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Specific Aspect Ratio for Bottom Banner on Desktop (wider/shorter than main hero) */
@media (min-width: 1024px) {
    .bottom-hero-section .hero-slider,
    .bottom-hero-section .hero-slider .swiper-wrapper,
    .bottom-hero-section .hero-slider .swiper-slide,
    .bottom-hero-section .hero-slide-link {
        aspect-ratio: 2560 / 600 !important; /* Shorter aspect ratio for delivery/promo banners */
    }
}

@media (max-width: 767px) {
    .bottom-hero-section {
        margin-top: 0;
    }
}

.hero-slider picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-slide {
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: var(--spacing-8);
    max-width: 800px;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4));
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: var(--spacing-8);
    max-width: 600px;
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: var(--white);
    margin-bottom: var(--spacing-4);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: var(--font-size-5xl);
    }
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--white);
    margin-bottom: var(--spacing-6);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-slider .swiper-pagination {
    bottom: 20px;
}

.hero-slider .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: var(--white);
    opacity: 0.5;
}

.hero-slider .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--gold);
}

.hero-slider .swiper-button-prev,
.hero-slider .swiper-button-next {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.hero-slider .swiper-button-prev::after,
.hero-slider .swiper-button-next::after {
    font-size: 18px;
    color: var(--almabr-primary);
}


.hero-slider .swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide-link {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 767px) {

    .hero-slider,
    .hero-slider .swiper-wrapper,
    .hero-slider .swiper-slide,
    .hero-slide-link {
        height: auto !important;
        aspect-ratio: auto !important;
    }

    .hero-banner-img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
    }
}

.hero-slide-content-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-4);
    text-align: center;
    width: 95%;
    max-width: 1300px;
    z-index: 10;
}

.hero-slide-title {
    font-size: 1.3rem;
    /* Small mobile title */
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--almabr-primary);
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .hero-slide-title {
        font-size: 4rem;
        margin-bottom: 30px;
        line-height: 1.4;
    }
}

@media (min-width: 1024px) {
    .hero-slide-title {
        font-size: 5rem;
        white-space: nowrap;
        /* Keep it on one line on desktop */
    }
}

.hero-slide-desc {
    font-size: 0.95rem;
    /* Small mobile description */
    margin-bottom: 15px;
    color: var(--gray-700);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .hero-slide-desc {
        font-size: 1.8rem;
        line-height: 2.2;
        margin-bottom: var(--spacing-6);
    }
}

.hero-slide-btn {
    display: inline-block;
    padding: 10px 20px !important;
    /* Smaller mobile padding */
    background-color: var(--almabr-primary) !important;
    color: var(--white) !important;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 1rem !important;
    /* Smaller mobile button text */
    font-weight: 600 !important;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .hero-slide-btn {
        padding: 24px 70px !important;
        font-size: 1.8rem !important;
    }
}

.hero-slide-btn:hover {
    background-color: var(--gold);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Promotional Banners */
.promo-banners {
    width: 100%;
    padding: var(--spacing-4) 0;
}

.promo-banners .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

.promo-banner-item {
    display: block;
    width: 100%;
    margin-bottom: var(--spacing-4);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.promo-banner-item:last-child {
    margin-bottom: 0;
}

.promo-banner-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.promo-banner-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Banner locations */
.promo-banners-homepage_top {
    background: var(--off-white);
}

.promo-banners-homepage_middle {
    background: var(--gray-50);
    padding: var(--spacing-8) 0;
}

.promo-banners-homepage_bottom {
    background: var(--off-white);
    padding: var(--spacing-8) 0;
}

.promo-banners-category_page,
.promo-banners-product_page {
    padding: var(--spacing-6) 0;
}

/* Promo Section */
.promo-section {
    padding: var(--spacing-8) 0;
    background: var(--gray-100);
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
}

@media (min-width: 768px) {
    .promo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.promo-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    background: var(--white);
    padding: var(--spacing-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.promo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--almabr-primary), var(--almabr-primary-light));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

.promo-content {
    display: flex;
    flex-direction: column;
}

.promo-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--gray-900);
}

.promo-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

/* Featured Categories */
.featured-categories-section {
    padding: var(--spacing-12) 0;
}

.featured-categories-grid {
    display: grid;
    gap: var(--spacing-4);
}

/* Mobile columns - based on data-mobile-cols attribute */
.featured-categories-grid[data-mobile-cols="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.featured-categories-grid[data-mobile-cols="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.featured-categories-grid[data-mobile-cols="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.featured-categories-grid[data-mobile-cols="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Desktop columns - applies on larger screens based on data-desktop-cols attribute */
@media (min-width: 992px) {
    .featured-categories-grid[data-desktop-cols="2"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-categories-grid[data-desktop-cols="3"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .featured-categories-grid[data-desktop-cols="4"] {
        grid-template-columns: repeat(4, 1fr);
    }

    .featured-categories-grid[data-desktop-cols="5"] {
        grid-template-columns: repeat(5, 1fr);
    }

    .featured-categories-grid[data-desktop-cols="6"] {
        grid-template-columns: repeat(6, 1fr);
    }
}

.featured-category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-100);
    transition: var(--transition);
    display: block;
    /* Ensure block */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.featured-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.featured-category-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.featured-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.featured-category-card:hover .featured-category-image img {
    transform: scale(1.1);
}

/* Custom Aspect Ratio for 2 Columns (1920x1080) */
@media (max-width: 991px) {
    .featured-categories-grid[data-mobile-cols="2"] .featured-category-image {
        aspect-ratio: 16 / 9;
    }
}

@media (min-width: 992px) {
    .featured-categories-grid[data-desktop-cols="2"] .featured-category-image {
        aspect-ratio: 16 / 9;
    }
}

.category-placeholder-lg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    background: var(--gray-200);
}

.featured-category-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: var(--white);
    text-align: center;
    z-index: 2;
}

.featured-category-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-category-count {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .featured-categories-grid.columns-6 {
        grid-template-columns: repeat(5, 1fr);
    }

    .featured-categories-grid.columns-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {

    .featured-categories-grid.columns-6,
    .featured-categories-grid.columns-5,
    .featured-categories-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Default fallback if no class */
    .featured-categories-grid:not([class*="columns-"]) {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .featured-categories-grid.columns-6,
    .featured-categories-grid.columns-5,
    .featured-categories-grid.columns-4,
    .featured-categories-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Default fallback */
    .featured-categories-grid:not([class*="columns-"]) {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-categories-section {
        padding: var(--spacing-8) 0;
    }
}

/* Organized Categories */
.categories-organized {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-8);
}

.category-group {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: var(--spacing-6);
    border: 1px solid var(--gray-200);
}

.category-group-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-5);
    padding-bottom: var(--spacing-4);
    border-bottom: 2px solid var(--gold);
}

.category-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.category-group-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--almabr-primary);
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.category-title-en {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subcategories-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
}

@media (min-width: 640px) {
    .subcategories-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .subcategories-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .subcategories-list {
        grid-template-columns: repeat(5, 1fr);
    }
}

.subcategory-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    text-decoration: none;
}

.subcategory-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold);
}

.subcategory-card:hover .subcategory-image img {
    transform: scale(1.1);
}

.subcategory-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--gray-100);
}

.subcategory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.subcategory-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    background: var(--gray-200);
}

.subcategory-info {
    padding: var(--spacing-3);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.subcategory-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-900);
}

.subcategory-name-en {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.subcategory-count {
    font-size: var(--font-size-xs);
    color: var(--almabr-primary);
    font-weight: 500;
    margin-top: var(--spacing-1);
}

/* Category group hover effect */
.category-group:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow);
}

/* Products Section */
.products-section {
    padding: var(--spacing-12) 0;
}

.new-arrivals-section {
    background: var(--off-white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Products Slider */
.products-slider .swiper-button-prev,
.products-slider .swiper-button-next {
    width: 44px;
    height: 44px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.products-slider .swiper-slide,
.new-arrivals-slider .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Prevent layout shift before Swiper initializes */
.new-arrivals-slider:not(.swiper-initialized) .swiper-wrapper,
.bestsellers-slider:not(.swiper-initialized) .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
}

/* Desktop: more columns before Swiper loads */
@media (min-width: 768px) {

    .new-arrivals-slider:not(.swiper-initialized) .swiper-wrapper,
    .bestsellers-slider:not(.swiper-initialized) .swiper-wrapper {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {

    .new-arrivals-slider:not(.swiper-initialized) .swiper-wrapper,
    .bestsellers-slider:not(.swiper-initialized) .swiper-wrapper {
        grid-template-columns: repeat(5, 1fr);
    }
}

.new-arrivals-slider:not(.swiper-initialized) .swiper-slide,
.bestsellers-slider:not(.swiper-initialized) .swiper-slide {
    max-width: 100%;
    width: 100%;
}

/* Ensure product cards don't overflow before CSS loads */
.new-arrivals-slider .product-card,
.bestsellers-slider .product-card {
    max-width: 100%;
}

.new-arrivals-slider .product-card img,
.bestsellers-slider .product-card img {
    max-width: 100%;
    height: auto;
}

.products-slider .swiper-button-prev::after,
.products-slider .swiper-button-next::after,
.new-arrivals-slider .swiper-button-prev::after,
.new-arrivals-slider .swiper-button-next::after {
    font-size: 16px;
    color: var(--almabr-primary);
}

/* Collection Section */
.collection-section {
    padding: var(--spacing-12) 0;
}

.collection-section .section-header {
    text-align: center;
    margin-bottom: var(--spacing-8);
}

.collection-section .section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-heading);
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-4);
}

@media (min-width: 768px) {
    .collection-grid {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: var(--spacing-4);
    }

    /* First 3 items: each takes 4 columns (12/3 = 4) */
    .collection-grid .collection-card:nth-child(1),
    .collection-grid .collection-card:nth-child(2),
    .collection-grid .collection-card:nth-child(3) {
        grid-column: span 4;
    }

    /* Items 4+ take 3 columns each (12/4 = 3) */
    .collection-grid .collection-card:nth-child(n+4) {
        grid-column: span 3;
    }
}

@media (max-width: 767px) {
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.collection-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 200px;
}

.collection-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.collection-card:hover img {
    transform: scale(1.1);
}

.collection-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: var(--spacing-4);
}

.collection-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--spacing-4);
}

/* Features Section */
.features-section {
    padding: var(--spacing-12) 0;
    background: var(--almabr-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-6);
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-card {
    text-align: center;
    color: var(--white);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-4);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    color: var(--gold);
}

.feature-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--spacing-2);
}

.feature-desc {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* Top Categories Section */
/* Top Categories Section - Updated Designs */
.top-categories-section {
    padding: var(--spacing-10) 0;
    background-color: transparent;
}

.top-categories-section .section-header {
    text-align: center;
    margin-bottom: var(--spacing-8);
}

.top-categories-section .section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-heading);
}

.top-categories-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-10);
}

@media (min-width: 768px) {
    .top-categories-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .top-categories-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== DESIGN 1: SQUARE CARDS ===== */
.cat-card-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s;
}

.cat-card-square:hover {
    transform: translateY(-8px);
}

.cat-square-img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Smaller size for 2 column layout on mobile/tablet */
@media (max-width: 767px) {
    .cat-square-img {
        max-height: none;
        aspect-ratio: 1600 / 534;
    }
}

.cat-square-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

/* Show wide category images fully on mobile (1600x534) */
@media (max-width: 767px) {
    .cat-square-img img {
        object-fit: contain;
        background: #fff;
    }

    .cat-card-tall {
        aspect-ratio: 1600 / 534;
        max-height: none;
    }

    .cat-card-tall img {
        object-fit: contain;
        background: #fff;
    }
}

.cat-card-square:hover .cat-square-img img {
    transform: scale(1.08);
}

.cat-square-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    transition: background 0.3s, color 0.3s;
}

.cat-card-square:hover .cat-square-title {
    background: var(--almabr-primary);
    color: #fff;
}

/* ===== DESIGN 2: CIRCULAR ===== */
.cat-card-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s;
}

.cat-card-circle:hover {
    transform: scale(1.05);
}

.cat-circle-img {
    width: 80%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    border: 4px solid var(--almabr-primary);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.cat-circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.cat-card-circle:hover .cat-circle-img img {
    transform: scale(1.1);
}

.cat-circle-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--almabr-primary);
    text-align: center;
}

/* Smaller size for 2 column layout on mobile/tablet */
@media (max-width: 767px) {
    .cat-circle-img {
        width: 70%;
        max-height: 180px;
    }
}

/* ===== DESIGN 3: TALL OVERLAY ===== */
.cat-card-tall {
    position: relative;
    display: block;
    aspect-ratio: 3/4;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Smaller size for 2 column layout on mobile/tablet */
@media (max-width: 767px) {
    .cat-card-tall {
        aspect-ratio: 1/1;
        max-height: 220px;
    }
}

.cat-card-tall img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.cat-card-tall:hover img {
    transform: scale(1.1);
}

.cat-tall-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cat-tall-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Hero Image Only Mode */
.hero-section.hero-image-only .hero-slider {
    height: auto;
}

@media (min-width: 768px) {
    .hero-section.hero-image-only .hero-slider {
        height: auto;
    }
}

.hero-section.hero-image-only .hero-slide {
    height: auto;
    background-image: none !important;
    display: block;
}

.hero-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-slide-link {
    display: block;
    width: 100%;
}

/* ===== INFO BANNERS SECTION (Shipping & Policy) ===== */
.info-banners-section {
    padding: var(--spacing-8) 0;
    background: var(--off-white);
}

.info-banners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-4);
}

.info-banner-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.info-banner-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-banner-link {
    display: block;
    width: 100%;
    height: 100%;
}

.info-banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16/9;
}

/* If only one banner exists, make it full width */
.info-banners-grid .info-banner-item:only-child {
    grid-column: span 2;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .info-banners-section {
        padding: var(--spacing-4) 0;
    }

    .info-banners-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3);
    }

    .info-banners-grid .info-banner-item:only-child {
        grid-column: span 1;
    }

    .info-banner-img {
        aspect-ratio: 16/7;
    }
}

/* ===== Section Link - Black Variant ===== */
.section-link--black {
    color: #000 !important;
    font-weight: 700;
}

.section-link--black:hover {
    color: #333 !important;
    text-decoration: underline;
}

/* ===== Top Categories Products Section ===== */
.top-cat-products-section {
    background: var(--off-white);
    border-top: 1px solid var(--gray-200);
}

.top-cat-products-section .section-header {
    margin-bottom: var(--spacing-5);
}

.top-cat-products-section .section-title {
    margin-bottom: 0;
}

.top-cat-products-slider .swiper-button-prev,
.top-cat-products-slider .swiper-button-next {
    width: 44px;
    height: 44px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.top-cat-products-slider .swiper-button-prev::after,
.top-cat-products-slider .swiper-button-next::after {
    font-size: 16px;
    color: var(--almabr-primary);
}

.top-cat-products-slider .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

/* ===================================================
   CAT-BLOCK SECTION — Banner + Products Grid Layout
   (matches luban-oman.com reference design)
   =================================================== */

.cat-block-section {
    padding: var(--spacing-8) 0;
    border-bottom: 1px solid var(--gray-200);
}

.cat-block-section:last-child {
    border-bottom: none;
}

/* ---- Banner ---- */
.cat-block-banner {
    display: block;
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-6);
    aspect-ratio: 3 / 1;
    background: var(--gray-100);
    text-decoration: none;
}

.cat-block-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cat-block-banner:hover img {
    transform: scale(1.03);
}



/* ---- Section Header (title + link) ---- */
.cat-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-5);
    padding-bottom: var(--spacing-3);
    border-bottom: 2px solid var(--almabr-primary);
}

.cat-block-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
}

.cat-block-title a {
    color: inherit;
    text-decoration: none;
}

.cat-block-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    background: var(--gray-100);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.cat-block-view-all:hover {
    background: var(--almabr-primary);
    color: #fff;
}

/* ---- Products Grid: 4 columns desktop, 2 mobile ---- */
.cat-block-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-4);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .cat-block-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cat-block-section {
        padding: var(--spacing-5) 0;
    }

    .cat-block-banner {
        aspect-ratio: 2 / 1;
        border-radius: var(--radius);
        margin-bottom: var(--spacing-4);
    }

    .cat-block-overlay {
        padding: var(--spacing-3) var(--spacing-4);
    }

    .cat-block-name {
        font-size: var(--font-size-xl);
    }

    .cat-block-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-3);
    }

    .cat-block-header {
        margin-bottom: var(--spacing-4);
    }

    .cat-block-title {
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .cat-block-banner {
        aspect-ratio: 16 / 7;
    }

    .cat-block-name {
        font-size: var(--font-size-lg);
    }
}

/* Reduce large page borders on PC for homepage banners and product sections */
@media (min-width: 1024px) {
    .homepage .container {
        max-width: 1650px;
        padding: 0 var(--spacing-5);
    }
    
    .cat-block-section,
    .top-cat-products-section,
    .products-section,
    .featured-categories-section {
        padding: var(--spacing-6) 0;
    }

    /* Remove any trailing main padding on homepage */
    .homepage.site-main {
        padding-bottom: 0 !important;
    }
}

/* ============================================================
   TOP CATEGORIES — New Card Grid Layout
   تصميم شبكة بطاقات الأقسام العلوية
   ============================================================ */

.topcats-section {
    padding: var(--spacing-12) 0;
    background: var(--color-page-bg);
}

/* ── Decorative section title (matching reference "تسوق حسب الأقسام") ── */
.topcats-section .section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-heading);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.topcats-section .section-title::before,
.topcats-section .section-title::after {
    content: '';
    flex: 1;
    max-width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--almabr-primary));
    border-radius: 2px;
}

.topcats-section .section-title::after {
    background: linear-gradient(90deg, var(--almabr-primary), transparent);
}

/* ── Grid container ── */
.topcats-grid {
    display: grid;
    grid-template-columns: repeat(var(--tc-cols-desk, 4), 1fr);
    gap: 20px;
}

/* ── Individual card ── */
.topcats-card {
    background: #FFFFFF;
    border: 1px solid #E8F0F8;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(15, 32, 96, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    width: 100%;
}

.topcats-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(15, 32, 96, 0.13);
    border-color: #B0C8E8;
}

/* ── Card image area ── */
.topcats-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #F0F6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.topcats-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.topcats-card:hover .topcats-card-img img {
    transform: scale(1.08);
}

/* ── Card body (name + arrow) ── */
.topcats-card-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 18px;
    gap: 10px;
    border-top: 1px solid #EBF4FD;
}

.topcats-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-heading);
    text-align: center;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* ── Arrow button ── */
.topcats-card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--almabr-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.topcats-card-btn svg {
    width: 16px;
    height: 16px;
}

.topcats-card:hover .topcats-card-btn {
    background: var(--almabr-primary-light);
    transform: scale(1.1);
}

/* ============================================================
   CENTERING LAST ROW — CSS trick using a wrapper div
   The PHP wraps the last row items in .topcats-last-row
   which is a flex container with justify-content:center.
   The last-row wrapper spans all columns.
   ============================================================ */
.topcats-last-row-wrapper {
    grid-column: 1 / -1;       /* span all columns */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.topcats-last-row-wrapper .topcats-card {
    /* Fixed width matching 1 column of the grid */
    flex: 0 0 auto;
    width: calc((100% - 20px * (var(--tc-cols-desk, 4) - 1)) / var(--tc-cols-desk, 4));
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 767px) {
    .topcats-grid {
        grid-template-columns: repeat(var(--tc-cols-mob, 2), 1fr);
        gap: 14px;
    }

    .topcats-last-row-wrapper {
        gap: 14px;
    }

    .topcats-last-row-wrapper .topcats-card {
        width: calc((100% - 14px * (var(--tc-cols-mob, 2) - 1)) / var(--tc-cols-mob, 2));
    }

    .topcats-card-img {
        padding: 14px;
    }

    .topcats-card-name {
        font-size: 12px;
    }

    .topcats-card-btn {
        width: 26px;
        height: 26px;
    }

    .topcats-card-btn svg {
        width: 13px;
        height: 13px;
    }
}

/* ============================================================
   Old cat-block-section styles (kept for backward compat)
   ============================================================ */
