/* ==========================================================================
   Premium Bento Category Showcase Stylesheet (Fail-proof Flexbox Layout)
   ========================================================================== */

.home-category-showcase {
    width: 100%;
    background: #ffffff;
    padding: 60px 0;
    margin: 0; /* Remove extra margin to eliminate unwanted space */
    font-family: 'Outfit', 'Cairo', sans-serif;
    box-sizing: border-box;
}

.home-category-showcase .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Section Header */
.showcase-header {
    text-align: center;
    margin-bottom: 400px;
    position: relative;
}

.showcase-header__subtitle {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #e03b3b;
    font-weight: 700;
    margin-bottom: 8px;
}

.showcase-header__title {
    font-size: 36px;
    font-weight: 800;
    color: #111111;
    margin: 0;
    line-height: 1.2;
}

html[dir="rtl"] .showcase-header__title {
    font-family: 'Tajawal', sans-serif;
}

.showcase-header::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #e03b3b;
    margin: 15px auto 0 auto;
    border-radius: 2px;
}

/* Main Grid Layout - Refactored to Flexbox for absolute vertical symmetry */
.showcase-grid {
    display: flex;
    flex-direction: row;
    gap: 24px;
    width: 100%;
    height: 560px;
    /* Explicit height to align perfectly */
    box-sizing: border-box;
    align-items: stretch;
}

/* Card Common Styling */
.showcase-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    z-index: 1;
    box-sizing: border-box;
}

/* Hover Effects */
.showcase-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

.showcase-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.06);
    border-color: rgba(224, 59, 59, 0.12);
}

.showcase-card:hover::before {
    opacity: 1;
}

/* Large Card Specifics */
.showcase-card--large {
    flex: 1.25;
    /* 1.25x the width of the small grid */
    height: 100%;
    /* Spans full height of 560px */
    background: linear-gradient(135deg, #fbe8df 0%, #f6dcd0 100%);
    padding: 50px 60px;
}

/* Small Cards Grid (Right/Left Side) */
.showcase-small-grid {
    flex: 1;
    /* Takes remaining space proportionally */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 24px;
    height: 100%;
    /* Spans full height of 560px */
}

.showcase-card--small {
    height: 100%;
    /* Fills the grid cell perfectly */
    padding: 30px;
}

/* Content Layout */
.showcase-card__content {
    position: relative;
    z-index: 5;
    max-width: 58%;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.showcase-card__text-group {
    display: flex;
    flex-direction: column;
}

.showcase-card__title {
    font-weight: 800;
    color: #111111;
    margin: 0;
    line-height: 1.25;
}

.showcase-card__title--large {
    font-size: 36px;
    color: #1c1c1c;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

html[dir="rtl"] .showcase-card__title--large {
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
}

.showcase-card--small .showcase-card__title {
    font-size: 20px;
    margin-bottom: 6px;
}

html[dir="rtl"] .showcase-card--small .showcase-card__title {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

.showcase-card__desc {
    font-size: 13.5px;
    line-height: 1.5;
    color: #5d5d5d;
    margin: 0 0 20px 0;
}

html[dir="rtl"] .showcase-card__desc {
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
}

.showcase-card__count {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #888888;
    background: rgba(255, 255, 255, 0.7);
    padding: 3px 10px;
    border-radius: 10px;
    align-self: flex-start;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

html[dir="rtl"] .showcase-card__count {
    font-family: 'Tajawal', sans-serif;
}

/* Elegant Premium Link Button */
.showcase-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111111;
    text-decoration: none;
    padding: 4px 0;
    align-self: flex-start;
    transition: all 0.3s ease;
    margin-top: auto;
}

.showcase-card__link-arrow {
    display: inline-flex;
    transition: transform 0.3s ease;
}

html[dir="rtl"] .showcase-card__link-arrow {
    transform: rotate(180deg);
}

.showcase-card__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #e03b3b;
    transition: width 0.3s ease;
}

html[dir="rtl"] .showcase-card__link {
    font-family: 'Tajawal', sans-serif;
    letter-spacing: 0;
}

.showcase-card:hover .showcase-card__link {
    color: #e03b3b;
}

.showcase-card:hover .showcase-card__link-arrow {
    transform: translateX(4px);
}

html[dir="rtl"] .showcase-card:hover .showcase-card__link-arrow {
    transform: rotate(180deg) translateX(4px);
}

/* Image Presentation Layer */
.showcase-card__image-container {
    position: absolute;
    top: 5%;
    right: 5%;
    bottom: 5%;
    left: auto;
    width: 44%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    overflow: hidden;
}

html[dir="rtl"] .showcase-card__image-container {
    right: auto;
    left: 5%;
}

.showcase-card__image-container img {
    max-height: 95%;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.06));
}

.showcase-card:hover .showcase-card__image-container img {
    transform: scale(1.08) translateY(-6px) rotate(1deg);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .showcase-grid {
        height: 500px;
        gap: 20px;
    }

    .showcase-small-grid {
        gap: 20px;
    }

    .showcase-card--large {
        padding: 40px;
    }

    .showcase-card--small {
        padding: 24px;
    }

    .showcase-card__title--large {
        font-size: 30px;
    }

    .showcase-card--small .showcase-card__title {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .showcase-grid {
        flex-direction: column;
        height: auto;
        gap: 20px;
    }

    .showcase-card--large {
        height: 320px;
        width: 100%;
        padding: 40px;
    }

    .showcase-card--large .showcase-card__content {
        max-width: 60%;
    }

    .showcase-small-grid {
        height: auto;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        width: 100%;
    }

    .showcase-card--small {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .home-category-showcase {
        padding: 40px 0;
    }

    .showcase-header {
        margin-bottom: 30px;
    }

    .showcase-header__title {
        font-size: 28px;
    }

    .showcase-grid {
        gap: 16px;
    }

    .showcase-card--large {
        height: 280px;
        padding: 30px;
    }

    .showcase-small-grid {
        gap: 16px;
    }

    .showcase-card--small {
        height: 190px;
        padding: 20px;
    }

    .showcase-card__title--large {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .showcase-card--small .showcase-card__title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .showcase-card__desc {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .showcase-card__count {
        font-size: 10px;
        padding: 2px 8px;
        margin-bottom: 8px;
    }

    .showcase-card__image-container {
        width: 40%;
    }
}

@media (max-width: 480px) {
    .home-category-showcase .container {
        padding: 0 16px;
    }

    .showcase-header__title {
        font-size: 24px;
    }

    .showcase-header__subtitle {
        font-size: 11px;
    }

    .showcase-grid {
        gap: 12px;
    }

    .showcase-card--large {
        height: 220px;
        padding: 20px;
        border-radius: 16px;
    }

    .showcase-card--large .showcase-card__content {
        max-width: 65%;
    }

    .showcase-card__title--large {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .showcase-card__desc {
        font-size: 11px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 10px;
    }

    .showcase-small-grid {
        grid-template-columns: 1fr 1fr;
        /* Retain gorgeous 2x2 bento grid on mobile! */
        gap: 12px;
    }

    .showcase-card--small {
        height: 155px;
        padding: 14px;
        border-radius: 16px;
    }

    .showcase-card--small .showcase-card__content {
        max-width: 70%;
    }

    .showcase-card--small .showcase-card__title {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .showcase-card__count {
        font-size: 9px;
        padding: 1px 6px;
        margin-bottom: 4px;
    }

    .showcase-card__link {
        font-size: 9px;
    }

    .showcase-card__image-container {
        width: 42%;
        right: 2%;
        bottom: 2%;
        top: auto;
        height: 75%;
    }

    html[dir="rtl"] .showcase-card__image-container {
        right: auto;
        left: 2%;
    }

    .showcase-card__image-container img {
        max-height: 100%;
    }
}

@media (max-width: 360px) {
    .showcase-card--small {
        height: 140px;
        padding: 12px;
    }

    .showcase-card--small .showcase-card__title {
        font-size: 13px;
    }

    .showcase-card__count {
        font-size: 8px;
    }
}