/* back-covers.css - Mobile‑first premium design (keeps original banner image) */

/* ========== RESET & BASE ========== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e0f2f1 100%);
    color: #000000;
    line-height: 1.6;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========== BANNER ========== */
/* Uses the image you set inline in PHP (style="background-image: url('1.jpg')") */
.banner {
    background-size: cover;
    background-position: center;
    padding: 70px 16px 60px;
    color: #ffffff;
    text-align: center;
    position: relative;
    margin-top: 0;        /* make sure this is 0 */
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* no extra color overlay */
.banner::before {
    content: none;
}

.banner-description {
    background-color: rgba(0, 0, 0, 0.55);
    display: inline-block;
    padding: 20px 24px;
    border-radius: 16px;
    max-width: 90%;
}

.banner-description h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    margin: 0 0 0.75rem 0;
}

.banner-description p {
    font-size: clamp(1rem, 3.3vw, 1.2rem);
    margin: 0;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    font-size: 0.9rem;
    color: #444;
    margin: 12px auto 24px;
    max-width: 1200px;
    padding: 0 16px;
    white-space: nowrap;
    overflow-x: auto;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb span {
    color: #888;
}

/* ========== MAIN LAYOUT ========== */
/* Mobile‑first: stacked sidebar + grid */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 12px 40px;   /* was 24px 16px */
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: flex-start;
}

/* ========== FILTER SIDEBAR ========== */
.filter-sidebar {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    border-radius: 20px;
    padding: 16px 14px;        /* was 20px 18px */
    box-shadow:
        0 18px 35px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(34, 197, 94, 0.2);
    max-width: 100%;
}

.filter-sidebar h2 {
    margin: 0 0 18px 0;
    color: #000000;
    font-size: 1.2rem;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(34, 197, 94, 0.25);
}

.filter-sidebar label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

/* Select – ensure it never exceeds viewport width */
.filter-sidebar select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    padding: 12px 38px 12px 12px;
    font-size: 16px;
    line-height: 1.4;

    border-radius: 12px;
    border: 1.5px solid rgba(34, 197, 94, 0.25);
    background-color: #ffffff;

    min-height: 48px;

    /* MOBILE DROPDOWN FIX */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

@media (max-width: 480px) {
    .filter-sidebar {
        padding: 14px 10px;
    }

    .filter-sidebar select {
        font-size: 15px;
    }
}

/* Tablet+ layout – keep column reasonable */
@media (min-width: 768px) {
    .main-container {
        grid-template-columns: 240px 1fr;  /* was 260px */
        gap: 24px;
        padding: 32px 20px 48px;
    }

    .filter-sidebar {
        padding: 18px 14px;
    }
}

.filter-sidebar select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* ========== CATEGORY GRID & CARDS ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.category-box {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.14),
        0 6px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    display: none;             /* controlled by JS via .show */
    position: relative;
}

.category-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #16a34a, #059669);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-box.show {
    display: block;
}

.category-box:hover {
    transform: translateY(-8px);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.22),
        0 10px 20px rgba(34, 197, 94, 0.14);
}

.category-box:hover::before {
    opacity: 1;
}

.category-box img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.category-box:hover img {
    transform: scale(1.05);
}

.category-box-content {
    
    text-align: center;
}

.category-box h4 {
    margin: 0 0 14px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000000;
    line-height: 1.3;
    text-align: center;

}

/* CTA button */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #059669 100%);
    color: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
    transition: all 0.25s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(34, 197, 94, 0.45);
}

.cta-button:active {
    transform: translateY(-1px);
}

/* ========== LOADER ========== */
#loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px 0 8px;
    color: #22c55e;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

#loader::after {
    content: '';
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(34, 197, 94, 0.25);
    border-top: 3px solid #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Larger desktop */
@media (min-width: 1200px) {
    .main-container {
        max-width: 1400px;
    }

    .category-grid {
        gap: 24px;
    }
}

/* Very small mobile tweaks */
@media (max-width: 480px) {
    .banner {
        padding: 50px 12px 40px;
        min-height: 220px;
    }

    .banner-description {
        padding: 18px 16px;
    }

    .category-box img {
        height: 200px;
    }
}

/* ========== ACCESSIBILITY & PRINT ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    #loader::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.2s !important;
    }
}

@media print {
    .banner,
    .filter-sidebar,
    .cta-button {
        display: none;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .category-box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Mobile clean sidebar (phones) */
@media (max-width: 600px) {
    .main-container {
        padding: 16px 10px 28px;
        gap: 18px;
    }

    .filter-sidebar {
        padding: 14px 12px;
        border-radius: 14px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border: 1px solid #e5e7eb;      /* lighter border */
        background: #ffffff;            /* remove strong glass effect */
    }

    .filter-sidebar h2 {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 6px;
        border-bottom: 1px solid #e5e7eb;
    }

    .filter-sidebar label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .filter-sidebar select {
        padding: 10px 34px 10px 10px;
        font-size: 15px;
        border-radius: 10px;
        border: 1px solid #d4d4d8;
        background-position: right 10px center;
        box-shadow: none;
    }
}

@media (max-width: 600px) {
    .filter-sidebar {
        overflow: visible;
    }
    .category-box img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    

    .filter-sidebar select {
        max-width: calc(100vw - 32px);
    }
}