@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700;800&display=swap');

:root {
    --primary: #174D35;
    --primary-dark: #103B29;
    --gold: #C5A15A;
    --gold-light: #D9BD83;
    --cream: #FAF9F5;
    --white: #FFFFFF;
    --text: #252B27;
    --muted: #777F79;
    --border: #EAECE8;
    --green: #159447;
    --green-dark: #10783a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--cream);
    color: var(--text);
}

body.cart-open {
    overflow: hidden;
}

/* ANNOUNCEMENT BAR */

.announcement {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 12px 15px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* AISLE HERO */

.category-hero {
    background: linear-gradient(120deg, #103B29, #1C6042);
    padding: 75px 7%;
    color: white;
    position: relative;
    overflow: hidden;
}

.category-hero-content {
    max-width: 1200px;
    margin: auto;
    position: relative;
    z-index: 1;
}

.eyebrow {
    color: var(--gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 18px;
}

.category-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1.15;
    margin-bottom: 20px;
}

.category-hero h1 span {
    color: var(--gold-light);
}

.category-hero p {
    max-width: 580px;
    color: rgba(255,255,255,.82);
    font-size: 14px;
    line-height: 1.9;
}

.hero-divider {
    width: 65px;
    height: 3px;
    background: var(--gold);
    margin-top: 30px;
}

/* PRODUCTS SECTION */

.products-section {
    max-width: 1450px;
    margin: auto;
    padding: 65px 6%;
}

.categories-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 40px;
}

.categories-intro h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(27px, 4vw, 38px);
    color: var(--primary-dark);
    margin-bottom: 9px;
}

.categories-intro p {
    font-size: 13px;
    color: var(--muted);
}

.category-count {
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px 24px;
    min-width: 110px;
    flex-shrink: 0;
}

.category-count span {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    color: var(--primary);
}

.category-count p {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* PRODUCT GRID */

.categories-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* PRODUCT CARD */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .3s ease, box-shadow .3s ease;
    min-width: 0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(20, 55, 35, .09);
}

.card-image {
    height: 210px;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #F0F0ED;
}

.card-image img {
    width: 100%;
    height: 100%;
    padding: 13px;
    object-fit: contain;
    transition: transform .4s ease;
}

.card:hover .card-image img {
    transform: scale(1.06);
}

.product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 7px 10px;
    border-radius: 4px;
}

.card-content {
    padding: 19px;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 9px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.card-content h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    min-height: 42px;
    color: var(--text);
}

.price {
    color: var(--primary);
    font-size: 19px;
    font-weight: 800;
    margin-top: 12px;
}

/*ADD TO CART - SINGLE VERSION ONLY*/

.product-actions {
    margin-top: 16px;
}

.add-cart-btn {
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: var(--green);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .25s ease;
}

.add-cart-btn:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
}

.add-cart-btn:active {
    transform: scale(.95);
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--green);
    color: white;
    border-radius: 10px;
    padding: 5px;
    gap: 8px;
    animation: cartPop .2s ease;
}

.quantity-control button {
    width: 38px;
    height: 36px;
    border: none;
    border-radius: 7px;
    background: white;
    color: var(--green);
    font-size: 21px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-control span {
    font-size: 15px;
    font-weight: 700;
}

@keyframes cartPop {
    from { transform: scale(.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/*FLOATING VIEW CART - MATCHES HTML */

.view-cart-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 650px);
    background: var(--green);
    color: white;
    padding: 16px 20px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 30px rgba(0,0,0,.22);
    cursor: pointer;
    z-index: 999;
    transition: .25s ease;
}

.view-cart-bar:hover {
    background: var(--green-dark);
}

.view-cart-bar.hidden {
    display: none;
}

.cart-count {
    background: white;
    color: var(--green);
    padding: 5px 10px;
    border-radius: 7px;
    font-weight: 800;
    margin-right: 10px;
}

.view-cart-label {
    font-weight: 700;
    font-size: 15px;
}

.cart-total {
    font-size: 17px;
    font-weight: 800;
}

/* CART OVERLAY */

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.cart-overlay.active {
    display: flex;
}

.cart-panel {
    background: white;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    border-radius: 22px 22px 0 0;
    animation: cartSlideUp .3s ease;
}

@keyframes cartSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-header h2 {
    font-size: 23px;
    color: #222;
}

.close-cart {
    border: none;
    background: #f1f1f1;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    cursor: pointer;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-info p {
    color: var(--green);
    font-weight: 700;
    font-size: 14px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-controls button {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--green);
    color: white;
    border-radius: 7px;
    font-size: 18px;
    cursor: pointer;
}

.cart-summary {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 2px solid #eee;
}

.cart-summary div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    margin-top: 15px;
}

.empty-cart {
    text-align: center;
    padding: 35px 10px;
    color: #777;
}

/* TOAST - REPLACES alert() */

.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: #111;
    color: #fff;
    padding: 13px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 90%;
    text-align: center;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* FOOTER */

.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,.75);
    text-align: center;
    padding: 25px 15px;
    font-size: 11px;
}

/* TABLET */

@media (max-width: 1050px) {
    .categories-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* MOBILE PIXELS */

@media (max-width: 700px) {
    .announcement {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .category-hero {
        padding: 55px 6%;
    }

    .products-section {
        padding: 45px 4%;
    }

    .categories-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    .card {
        border-radius: 11px;
    }

    .card-image {
        height: 155px;
    }

    .card-content {
        padding: 13px;
    }

    .product-category {
        font-size: 8px;
    }

    .card-content h3 {
        font-size: 12px;
        min-height: 38px;
    }

    .price {
        font-size: 17px;
    }

    .categories-intro {
        align-items: flex-start;
    }

    .category-count {
        padding: 10px;
        min-width: 85px;
    }

    .category-count span {
        font-size: 24px;
    }

    .view-cart-bar {
        bottom: 12px;
        padding: 14px;
        width: 94%;
    }

    .cart-panel {
        padding: 20px;
    }
}

/* MOBILE FIX */

@media (max-width: 430px) {
    .categories-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .card-image {
        height: 130px;
    }

    .card-content {
        padding: 10px;
    }

    .card-content h3 {
        font-size: 11px;
        min-height: 36px;
    }

    .price {
        font-size: 15px;
    }

    .add-cart-btn {
        padding: 11px 10px;
        font-size: 13px;
    }

    .quantity-control {
        gap: 6px;
    }

    .quantity-control button {
        width: 32px;
        height: 32px;
    }
}

/* ACCESSIBILITY */

button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}