/* =========================================
   CATEGORIES PAGE — MODERN EDITION
========================================= */

* {
    box-sizing: border-box;
}

:root {
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --surface: #ffffff;
    --bg: #f7f8fa;

    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-soft: #eef2ff;

    --radius-lg: 16px;
    --radius-md: 12px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    scroll-behavior: smooth;
}


/* =========================================
   MAIN PAGE
========================================= */

.categories-page {
    width: 100%;
    min-height: 100vh;
    padding: 45px 6% 80px;
}


/* =========================================
   SCROLL-REVEAL BASE STATE
========================================= */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.6s var(--ease),
        transform 0.6s var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}


/* =========================================
   PAGE HEADING
========================================= */

.categories-hero {
    text-align: center;
    margin-bottom: 30px;
}

.hero-badge {
    display: inline-block;

    margin-bottom: 14px;
    padding: 6px 14px;

    border-radius: 999px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.categories-hero h1 {
    margin: 0 0 12px;

    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.02em;

    background: linear-gradient(120deg, var(--ink), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.categories-hero p {
    margin: 0 auto;
    max-width: 560px;

    font-size: 16px;
    line-height: 1.6;

    color: var(--muted);
}


/* =========================================
   STICKY QUICK-JUMP NAV
========================================= */

.quick-nav {
    position: sticky;
    top: 0;
    z-index: 20;

    margin: 0 0 45px;

    padding: 10px 0;

    background: rgba(247, 248, 250, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);

    border-bottom: 1px solid var(--line);
}

.quick-nav-track {
    display: flex;

    gap: 10px;

    overflow-x: auto;

    padding: 4px 2px;

    scrollbar-width: thin;
}

.quick-nav-track::-webkit-scrollbar {
    height: 5px;
}

.quick-nav-track::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 999px;
}

.quick-nav-pill {
    flex: 0 0 auto;

    padding: 8px 16px;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: var(--surface);
    color: var(--ink);

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;
    white-space: nowrap;

    transition:
        background 0.25s var(--ease),
        color 0.25s var(--ease),
        border-color 0.25s var(--ease),
        transform 0.25s var(--ease);
}

.quick-nav-pill:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent);
}

.quick-nav-pill.active {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}


/* =========================================
   ALL CATEGORIES SECTION
========================================= */

.all-categories-section {
    margin-bottom: 60px;
}


/* =========================================
   SECTION TITLE
========================================= */

.section-title {
    margin-bottom: 22px;
}

.section-title h2 {
    margin: 0 0 6px;

    font-size: 26px;
    font-weight: 700;

    color: var(--ink);
}

.section-subtitle {
    margin: 0;

    font-size: 14px;

    color: var(--muted);
}


/* =========================================
   CATEGORY CARDS — overlay / poster style
========================================= */

.category-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
}


.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg, 16px);
    text-decoration: none;
    color: var(--ink, #0f172a);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.3s var(--ease),
        box-shadow 0.3s var(--ease),
        border-color 0.3s var(--ease);
}

.category-card:hover,
.category-card:focus-visible {
    transform: translateY(-5px);
    border-color: #93c5fd;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

.category-card:hover .category-arrow {
    background: #2563eb;
    color: #ffffff;
    transform: translateX(3px);
}


/* Category image box */

.category-image {
    position: relative;
    width: 100%;
    height: 145px;
    background: radial-gradient(circle at center, #ffffff 40%, #f8fafc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .category-image img {
    transform: scale(1.08);
}


/* Hide dark overlay so image graphics remain clear and bright */

.category-overlay {
    display: none;
}


/* Shimmer skeleton used when no image is set */

.category-no-image,
.no-product-image {
    width: 100%;
    height: 100%;
}

.shimmer {
    background: linear-gradient(
        100deg,
        #e5e7eb 30%,
        #f3f4f6 50%,
        #e5e7eb 70%
    );
    background-size: 200% 100%;

    animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 150% 0; }
    100% { background-position: -50% 0; }
}


/* Category name + arrow footer */

.category-card-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    box-sizing: border-box;
    margin-top: auto;
}

.category-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink, #0f172a);
    text-shadow: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-arrow {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
    transform: none;
    transition: all 0.25s ease;
}


/* =========================================
   CATEGORY PRODUCTS SECTION
========================================= */

.category-products-section {
    width: 100%;
}


/* =========================================
   SINGLE CATEGORY SECTION
========================================= */

.category-section {
    margin-bottom: 55px;

    scroll-margin-top: 90px;
}


/* =========================================
   CATEGORY HEADING
========================================= */

.category-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.category-heading h2 {
    position: relative;

    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0;

    padding-left: 14px;

    font-size: 25px;
    font-weight: 700;

    color: var(--ink);
}


/* Left line */

.category-heading h2::before {
    content: "";

    position: absolute;

    left: 0;
    top: 4px;

    width: 4px;
    height: calc(100% - 8px);

    border-radius: 4px;

    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.category-count {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 26px;
    height: 22px;

    padding: 0 7px;

    border-radius: 999px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 12px;
    font-weight: 700;
}


/* =========================================
   VIEW ALL BUTTON
========================================= */

.view-all-btn {
    display: inline-flex;

    align-items: center;
    gap: 6px;
    justify-content: center;

    padding: 9px 17px;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: var(--surface);

    color: var(--ink);

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    transition:
        background 0.25s var(--ease),
        color 0.25s var(--ease),
        border-color 0.25s var(--ease),
        transform 0.25s var(--ease),
        box-shadow 0.25s var(--ease);
}

.view-all-btn span {
    transition: transform 0.25s var(--ease);
}

.view-all-btn:hover {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));

    border-color: transparent;

    color: #ffffff;

    transform: translateY(-2px);

    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.28);
}

.view-all-btn:hover span {
    transform: translateX(3px);
}


/* =========================================
   PRODUCTS GRID
========================================= */

.category-products {
    display: grid;

    grid-template-columns: repeat(5, minmax(0, 1fr));

    gap: 18px;
}


/* =========================================
   PRODUCT CARD
========================================= */

.product-card {
    display: block;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--line);
    border-radius: var(--radius-lg);

    text-decoration: none;

    color: inherit;

    transition:
        transform 0.35s var(--ease),
        box-shadow 0.35s var(--ease),
        border-color 0.35s var(--ease);
}

.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-6px);

    border-color: transparent;

    box-shadow:
        0 16px 30px rgba(17, 24, 39, 0.12);
}


/* =========================================
   PRODUCT IMAGE
========================================= */

.product-image {
    position: relative;

    width: 100%;
    height: 190px;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #f3f4f6;
}

.product-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    transition: transform 0.4s var(--ease);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}


/* "Quick View" ribbon revealed on hover */

.product-quick-view {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    padding: 8px 0;

    text-align: center;

    background: rgba(17, 24, 39, 0.85);
    color: #ffffff;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;

    transform: translateY(100%);

    transition: transform 0.3s var(--ease);
}

.product-card:hover .product-quick-view {
    transform: translateY(0);
}


/* =========================================
   PRODUCT INFORMATION
========================================= */

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin: 0 0 8px;

    font-size: 16px;
    font-weight: 600;

    line-height: 1.4;

    color: var(--ink);

    display: -webkit-box;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;

    min-height: 45px;
}


/* =========================================
   PRODUCT PRICE
========================================= */

.product-price {
    margin: 0;

    font-size: 17px;
    font-weight: 700;

    background: linear-gradient(120deg, var(--ink), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* =========================================
   NO PRODUCTS
========================================= */

.no-products {
    width: 100%;

    padding: 25px;

    text-align: center;

    background: var(--surface);

    border: 1px dashed var(--line);

    border-radius: 10px;
}

.no-products p {
    margin: 0;

    font-size: 14px;

    color: var(--muted);
}


/* =========================================
   NO CATEGORIES
========================================= */

.no-categories {
    width: 100%;

    padding: 60px 20px;

    text-align: center;

    background: var(--surface);

    border: 1px solid var(--line);

    border-radius: 12px;
}

.no-categories h2 {
    margin: 0 0 10px;

    font-size: 24px;

    color: var(--ink);
}

.no-categories p {
    margin: 0;

    font-size: 15px;

    color: var(--muted);
}


/* =========================================
   LARGE TABLET
========================================= */

@media (max-width: 1200px) {

    .categories-page {
        padding: 40px 4% 70px;
    }

    .category-container {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .category-products {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

}


/* =========================================
   TABLET
========================================= */

@media (max-width: 1000px) {

    .category-container {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .category-products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-image {
        height: 175px;
    }

}


/* =========================================
   SMALL TABLET
========================================= */

@media (max-width: 800px) {

    .categories-page {
        padding: 35px 4% 60px;
    }

    .categories-hero h1 {
        font-size: 32px;
    }

    .category-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .category-image {
        height: 130px;
        padding: 10px;
    }

    .category-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 15px;
    }

    .product-image {
        height: 170px;
    }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    .categories-page {
        padding: 24px 15px 50px;
    }


    /* Page heading */

    .categories-hero {
        margin-bottom: 24px;
    }

    .categories-hero h1 {
        font-size: 27px;

        line-height: 1.3;
    }

    .categories-hero p {
        font-size: 14px;

        line-height: 1.5;
    }


    /* Quick nav */

    .quick-nav {
        margin-bottom: 30px;
    }


    /* All categories */

    .all-categories-section {
        margin-bottom: 45px;
    }

    .section-title {
        margin-bottom: 16px;
    }

    .section-title h2 {
        font-size: 22px;
    }


    /* Category cards */

    .category-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .category-card {
        border-radius: 14px;
    }

    .category-image {
        height: 118px;
        padding: 8px;
    }

    .category-card-footer {
        padding: 9px 10px 10px;
    }

    .category-card h3 {
        font-size: 13px;
        line-height: 1.3;
    }

    .category-arrow {
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        font-size: 10px;
    }


    /* Category product section */

    .category-section {
        margin-bottom: 40px;

        scroll-margin-top: 70px;
    }


    /* Category heading */

    .category-heading {
        gap: 10px;

        margin-bottom: 16px;
    }

    .category-heading h2 {
        padding-left: 11px;

        font-size: 21px;
    }

    .category-heading h2::before {
        width: 3px;

        top: 4px;

        height: calc(100% - 8px);
    }


    /* View all */

    .view-all-btn {
        padding: 7px 11px;

        font-size: 12px;
    }


    /* Product grid */

    .category-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }


    /* Product image */

    .product-image {
        height: 150px;
    }


    /* Product info */

    .product-info {
        padding: 12px;
    }

    .product-info h3 {
        font-size: 14px;

        line-height: 1.35;

        min-height: 38px;
    }

    .product-price {
        font-size: 15px;
    }

}


/* =========================================
   VERY SMALL MOBILE
========================================= */

@media (max-width: 380px) {

    .categories-page {
        padding-left: 12px;
        padding-right: 12px;
    }


    .category-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .category-image {
        height: 100px;
        padding: 6px;
    }

    .category-card-footer {
        padding: 8px 8px 9px;
    }

    .category-card h3 {
        font-size: 12px;
    }


    .category-products {
        grid-template-columns: 1fr;
    }


    .product-image {
        height: 190px;
    }

}