:root {
    --primary: #8B4513;
    --primary-light: #CD853F;
    --accent: #D4AF37;
    --text: #2D2D2D;
    --text-light: #6B6B6B;
    --border: rgba(139,69,19,.08);
    --cream: #FFF5E6;
    --brand-dark: #4E342E;
}

/* Sticky category ribbon (optional, toggled with .open) */
.category-menu {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 12px 0;
    z-index: 100;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    overflow: hidden;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

    .category-menu.open {
        transform: scaleY(1);
        opacity: 1;
    }

    .category-menu a {
        font-weight: 600;
        padding: 10px 18px;
        text-decoration: none;
        border-radius: 25px;
        margin: 5px 8px;
        transition: background-color 0.3s, color 0.3s;
        color: var(--brand-dark);
    }

        .category-menu a.active {
            background-color: #A52A2A !important;
            color: #ffffff !important;
        }

        .category-menu a:hover {
            color: var(--brand-dark);
        }

/* Decorative separator (kept for compatibility) */
.separator-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.title-separator {
    display: block;
    width: 189px;
    height: 24px;
}

/* Product card (if used on this page) */
.product-card {
    border-radius: 15px;
    background-color: #FFF2CC;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
    height: 100%;
}

    .product-card:hover {
        transform: translateY(-5px);
    }

    .product-card img {
        width: 62px;
        height: 62px;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .product-card h5 {
        font-size: 1.05rem;
        font-weight: 700;
        margin: 8px 0 4px;
        color: var(--brand-dark);
    }

    .product-card p {
        font-size: .9rem;
        color: #6D4C41;
        margin: 0 0 8px;
    }

    .product-card .price {
        color: #A0522D;
        font-weight: 700;
    }

/* Floating toggle button (if used) */
#toggleCategoryMenu {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 200;
}

/* Base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Scope container on this view */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header & title */
.header-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    position: relative;
}

    .header-section::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 80px;
        height: 2px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
        border-radius: 2px;
    }

/* Readable title on light cream chip */
.page-title {
    font-weight: 800;
    font-size: 2rem;
    margin: 0;
    color: var(--brand-dark);
    display: inline-block;
    background: var(--cream);
    padding: .35rem .8rem;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Categories grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 1.4rem;
    margin-top: 1rem;
    justify-items: center;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width:768px) {
    .categories-grid {
        grid-template-columns: repeat(3,1fr);
        gap: 1.6rem;
    }
}

@media (min-width:1024px) {
    .categories-grid {
        grid-template-columns: repeat(3,1fr);
    }
}

/* Category card — smaller & less transparent */
.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 280px;
    background: rgba(255,255,255,.4);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 20px;
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    backdrop-filter: blur(18px);
    overflow: hidden;
    will-change: transform;
    outline: none;
}

    .category-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 18px 48px rgba(0,0,0,.22);
        border-color: rgba(255,255,255,.65);
        background: rgba(255,255,255,.5);
    }

    .category-card:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 3px;
    }

/* Category image — smaller */
.category-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,.9);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    margin-bottom: .9rem;
    transition: transform .25s ease;
}

.category-card:hover .category-image {
    transform: scale(1.05);
}

/* Graceful fallback when no image */
.category-image[src=""] {
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 200%;
    animation: shimmer 1.5s infinite;
}

/* Category name */
.category-name {
    font-weight: 800;
    font-size: 1.25rem;
    color: #FFF8E1;
    margin: 0 .7rem;
    letter-spacing: .3px;
    text-shadow: 0 3px 8px rgba(0,0,0,.45);
    max-width: 95%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes shimmer {
    0% {
        background-position: -200% -200%;
    }

    100% {
        background-position: 200% 200%;
    }
}

/* Responsive tweaks */
@media (max-width:767px) {
    .container {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .header-section {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .categories-grid {
        gap: 1rem;
    }

    .category-card {
        height: 240px;
        padding: 1rem;
    }

    .category-image {
        width: 100px;
        height: 100px;
    }

    .category-name {
        font-size: 1.1rem;
    }
}

/* Entry animation */
.category-card {
    animation: fadeInUp .6s ease-out;
    animation-fill-mode: both;
}

    .category-card:nth-child(1) {
        animation-delay: .1s;
    }

    .category-card:nth-child(2) {
        animation-delay: .2s;
    }

    .category-card:nth-child(3) {
        animation-delay: .3s;
    }

    .category-card:nth-child(4) {
        animation-delay: .4s;
    }

    .category-card:nth-child(5) {
        animation-delay: .5s;
    }

    .category-card:nth-child(6) {
        animation-delay: .6s;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
