/* ===================================
   CATEGORIES SECTION - FULL WIDTH GRID LAYOUT
   =================================== */

/* Categories Section Container */
.categories-list-view {
    position: relative;
    width: 100%;
    padding: 0 !important;
}

.categories-list-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23f4f1e1" fill-opacity="0.3" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: 100% 100px;
    pointer-events: none;
    opacity: 0.5;
}

/* Categories Container */
.categories-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 1;
}

/* Categories Grid - 3 columns desktop */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
}

/* Category Item */
.category-item {
    position: relative;
    height: 500px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Category Link – fills the card */
.category-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

/* Category Image - Background Style */
.category-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.category-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.category-item:hover .category-link img {
    transform: scale(1.08);
}

/* Category Overlay - gradient for text readability */
.category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.15) 0%,
            rgba(0, 0, 0, 0.35) 50%,
            rgba(0, 0, 0, 0.65) 100%
    );
    transition: background 0.4s ease;
    z-index: 1;
}

.category-item:hover .category-overlay {
    background: linear-gradient(
            180deg,
            rgba(23, 95, 83, 0.3) 0%,
            rgba(23, 95, 83, 0.5) 50%,
            rgba(23, 95, 83, 0.75) 100%
    );
}

/* Category Content - centered button near bottom */
.category-content {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 24px;
    transition: transform 0.4s ease;
}

.category-item:hover .category-content {
    transform: translateX(-50%) translateY(-8px);
}

/* Category Name Button */
.category-name {
    display: inline-block;
    padding: 10px 26px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-color, #3A3A3C);
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.category-name::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-color, #175f53);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.category-item:hover .category-name {
    color: var(--notification-color, #f4f1e1);
    border-color: var(--notification-color, #f4f1e1);
    transform: scale(1.05);
}

.category-item:hover .category-name::before {
    width: 400px;
    height: 400px;
}

/* Optional count under the button */
.category-count {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.category-item:hover .category-count {
    opacity: 1;
    transform: translateY(0);
}


/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Large Tablets (Keep 3 columns but shorter cards) */
@media (max-width: 992px) {
    .category-item {
        height: 380px;
    }
}

/* Tablets (2 columns) */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-item {
        height: 340px;
    }

    .category-content {
        bottom: 30px;
        padding: 0 18px;
    }

    .category-name {
        padding: 9px 22px;
        font-size: 14px;
    }
}

/* Mobile Devices (2 columns) */
@media (max-width: 576px) {
    .categories-list-view {
        padding: 30px 0;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-item {
        height: 280px;
    }

    .category-content {
        bottom: 24px;
        padding: 0 12px;
    }

    .category-name {
        padding: 8px 18px;
        font-size: 13px;
    }
}

/* Very Small Devices */
@media (max-width: 400px) {
    .category-item {
        height: 220px;
    }

    .category-content {
        bottom: 18px;
        padding: 0 10px;
    }

    .category-name {
        padding: 7px 16px;
        font-size: 12px;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

.category-link:focus {
    outline: 3px solid var(--primary-color, #175f53);
    outline-offset: 4px;
}

.category-link:focus .category-overlay {
    background: linear-gradient(
            180deg,
            rgba(23, 95, 83, 0.3) 0%,
            rgba(23, 95, 83, 0.5) 50%,
            rgba(23, 95, 83, 0.8) 100%
    );
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .category-item,
    .category-link img,
    .category-overlay,
    .category-content,
    .category-name,
    .category-count {
        transition: none;
    }

    .category-item:hover {
        transform: none;
    }

    .category-item:hover .category-link img {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .categories-list-view {
        background: white;
    }

    .category-overlay {
        display: none;
    }

    .category-name {
        background: white;
        color: black;
        border: 2px solid black;
    }
}
