/* =============================================
   BANNER IMAGE ALIGNMENT FIXES
   ============================================= */

/* Category Header Banner Fix */
.category-header-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.category-header-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.category-header-text {
    flex: 1;
}

.category-header-image {
    flex: 0 0 40%;
    max-width: 500px;
}

.category-page-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Center the banner for better visual balance */
.category-header-centered {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.category-header-centered .category-page-image {
    margin: 30px auto;
    max-width: 600px;
}

/* Alternative layout with background image */
.category-banner-overlay {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 40px;
}

.category-banner-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    z-index: 1;
}

.category-banner-overlay img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.category-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    color: white;
}

.category-banner-content h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.category-banner-content p {
    color: rgba(255,255,255,0.95);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Product Box Height Standardization */
.product-card-modern {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-content-modern {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-desc-modern {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    min-height: 4.5em; /* 3 lines * 1.5 line-height */
}

.product-footer-modern {
    margin-top: auto;
    padding-top: 16px;
}

/* Make entire product card clickable */
a.product-card-modern,
a.product-card {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a.product-card-modern:hover,
a.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    text-decoration: none !important;
}

/* Ensure the link spans the entire card */
a.product-card-modern > *,
a.product-card > * {
    pointer-events: none; /* Prevent child elements from interfering */
}

/* Subcategory cards uniformity */
a.category-card-simple {
    height: 100%;
    display: flex !important;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

a.category-card-simple:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    text-decoration: none !important;
}

.category-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.category-desc {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    .category-header-content {
        flex-direction: column;
        text-align: center;
    }

    .category-header-image {
        max-width: 100%;
        order: -1; /* Move image to top on mobile */
    }

    /* Fix mobile centering issue - prevent image from floating over text */
    .product-image-wrapper {
        position: relative;
        z-index: 1;
        margin-bottom: 15px;
    }

    .product-image-modern {
        position: relative !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
    }

    .category-page-image {
        position: relative;
        margin-bottom: 20px;
        display: block;
    }

    /* Fix category image positioning on mobile */
    .category-image-container {
        position: relative;
        overflow: hidden;
        height: 180px;
        margin-bottom: 15px;
    }

    .category-image-container img {
        position: relative !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Prevent overlay on scroll */
    .product-card-modern {
        position: relative;
        z-index: auto;
        overflow: hidden;
    }

    .category-banner-overlay {
        min-height: 250px;
    }

    .category-banner-content {
        padding: 30px 20px;
    }

    .category-banner-content h1 {
        font-size: 1.8rem;
    }

    .category-banner-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .category-banner-overlay {
        min-height: 200px;
        margin-bottom: 20px;
    }

    .category-banner-content {
        padding: 20px 15px;
    }

    .category-banner-content h1 {
        font-size: 1.5rem;
    }

    .category-banner-content p {
        font-size: 0.9rem;
    }
}