/* ==============================================
   Dry Fruits & Seeds Store — Visual System
   Direction: spice-market / kraft-sack aesthetic.
   Signature element: hand-tied paper "hang tags"
   used for price + category badges, like the tags
   on burlap sacks at a real spice stall.
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,600;0,700;1,500&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Color: roasted-cacao dark, kraft paper light, turmeric accent */
    --cacao:      #2A1F14;   /* deep roasted-cacao brown — primary dark */
    --kraft:      #EFE3CB;   /* kraft paper cream — primary light */
    --turmeric:   #E0A526;   /* turmeric accent */
    --pistachio:  #86976B;   /* pistachio secondary */
    --chili:      #C1432A;   /* dried-chili — alerts/highlights */
    --ivory:      #FBF6EA;   /* card backgrounds */
    --ink:        #2A1F14;   /* body text */
    --ink-soft:   #6B5D48;   /* muted text */

    --radius: 6px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--kraft);
    background-image:
        radial-gradient(rgba(42,31,20,0.035) 1px, transparent 1px);
    background-size: 14px 14px;
    color: var(--ink);
    line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.4em; color: var(--cacao); }
a { color: var(--chili); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }

/* --- Navbar --- */
.site-navbar { background: var(--cacao); color: var(--ivory); padding: 14px 20px; border-bottom: 4px solid var(--turmeric); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; }
.navbar-logo { color: var(--ivory); font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; letter-spacing: 0.02em; }
.navbar-hamburger { display: none; background: none; border: none; color: var(--ivory); font-size: 1.6rem; }
.navbar-links { display: flex; gap: 18px; align-items: center; }
.navbar-links a { color: var(--ivory); font-weight: 500; font-size: 0.95rem; }
.navbar-links a:hover { color: var(--turmeric); text-decoration: none; }
.cart-badge {
    background: var(--turmeric); color: var(--cacao); border-radius: 50%;
    padding: 2px 7px; font-size: 0.72rem; font-weight: 700; margin-left: 4px;
}

@media (max-width: 768px) {
    .navbar-hamburger { display: block; }
    .navbar-links {
        display: none; flex-direction: column; align-items: flex-start;
        position: absolute; top: 58px; right: 0; left: 0;
        background: var(--cacao); padding: 18px; z-index: 20;
        border-bottom: 4px solid var(--turmeric);
    }
    .navbar-links.open { display: flex; }
}

/* --- Flash messages --- */
.flash-message { padding: 12px 20px; text-align: center; font-weight: 600; }
.flash-success { background: #E9EEDF; color: #4C5A38; }
.flash-error { background: #F6DFD8; color: var(--chili); }

/* --- Layout --- */
.site-main { max-width: 1100px; margin: 0 auto; padding: 24px 20px; min-height: 60vh; }

/* --- Homepage hero --- */
.homepage-banner {
    background: var(--cacao); color: var(--ivory);
    padding: 56px 32px; margin: -24px -20px 32px; text-align: left;
    background-image: radial-gradient(circle at 85% 20%, rgba(224,165,38,0.18), transparent 55%);
    position: relative;
}
.homepage-banner h1 { color: var(--ivory); font-size: 2.1rem; max-width: 520px; margin-bottom: 0.3em; }
.homepage-banner p { color: var(--kraft); opacity: 0.85; max-width: 460px; margin-bottom: 20px; }

/* --- Signature element: hang-tag badges --- */
/* Used for prices/categories — resembles a hand-tied paper tag,
   complete with a punched hole and a knotted string, like the
   tags used on burlap spice sacks. */
.product-price, .checkout-btn, .admin-btn {
    position: relative;
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 700;
}

.product-price {
    background: var(--ivory);
    color: var(--cacao);
    padding: 4px 12px 4px 20px;
    border-radius: 3px 8px 8px 3px;
    border: 1px solid rgba(42,31,20,0.15);
    font-size: 0.95rem;
}
.product-price::before {
    content: '';
    position: absolute;
    left: 8px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px;
    background: var(--kraft);
    border: 1px solid var(--ink-soft);
    border-radius: 50%;
}

.checkout-btn, .admin-btn {
    background: var(--turmeric);
    color: var(--cacao);
    padding: 12px 26px 12px 34px;
    border-radius: 3px 10px 10px 3px;
    border: none;
    cursor: pointer;
    box-shadow: 2px 3px 0 rgba(42,31,20,0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.checkout-btn::before, .admin-btn::before {
    content: '';
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    width: 7px; height: 7px;
    background: var(--cacao);
    border-radius: 50%;
}
.checkout-btn:hover, .admin-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 4px 0 rgba(42,31,20,0.3);
    text-decoration: none;
}

/* --- Product grid --- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
    background: var(--ivory);
    border-radius: var(--radius);
    padding: 14px;
    display: block;
    border: 1px solid rgba(42,31,20,0.1);
    box-shadow: 0 2px 6px rgba(42,31,20,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(42,31,20,0.12);
    text-decoration: none;
}
.product-card img {
    width: 100%; border-radius: 4px; aspect-ratio: 1; object-fit: cover;
    margin-bottom: 10px; background: var(--kraft);
}
.product-card h3, .product-card h4 { font-size: 1rem; margin-bottom: 6px; }
.out-of-stock-badge, .badge-out-of-stock { color: var(--chili); font-size: 0.8rem; font-weight: 600; }

/* --- Forms --- */
.auth-form-wrapper { max-width: 400px; margin: 40px auto; background: var(--ivory); padding: 28px; border-radius: 8px; border: 1px solid rgba(42,31,20,0.1); }
form label { display: block; margin-top: 14px; font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); }
form input, form select, form textarea {
    width: 100%; padding: 10px; margin-top: 4px;
    border: 1px solid #D9CBAD; border-radius: var(--radius);
    font-family: var(--font-body); background: #fff;
}
form button {
    margin-top: 20px; padding: 12px 20px; background: var(--cacao);
    color: var(--ivory); border: none; border-radius: var(--radius); cursor: pointer; width: 100%;
    font-weight: 600; font-family: var(--font-body);
}
form button:hover { background: #3D2E1E; }
.form-errors { background: #F6DFD8; color: var(--chili); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; }

/* --- Products page --- */
.products-page { display: flex; gap: 24px; flex-wrap: wrap; }
.products-sidebar, .category-filter { min-width: 170px; }
.category-filter-list, .category-filter ul { list-style: none; padding: 0; }
.category-filter-list li, .category-filter li { padding: 6px 0; }
.category-filter-list li.active a, .category-filter li.active a { font-weight: 700; color: var(--chili); }

/* --- Product detail --- */
.product-detail-page { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 768px) { .product-detail-page { grid-template-columns: 1fr 1fr; } }
.product-detail-image img { width: 100%; border-radius: 8px; background: var(--ivory); }
.product-category-tag {
    display: inline-block; background: var(--pistachio); color: #fff;
    font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.product-extra-info { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #D9CBAD; }
.review-card { padding: 12px 0; border-bottom: 1px solid #EEE1C4; }
.review-stars { color: var(--turmeric); font-weight: 700; margin-left: 8px; }

/* --- Cart --- */
.cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #E7D9B8; align-items: center; }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--ivory); }
.cart-item-details { flex: 1; }
.cart-qty-input { width: 60px; padding: 6px; border: 1px solid #D9CBAD; border-radius: 4px; }
.stock-warning { color: var(--chili); font-size: 0.85rem; font-weight: 600; }
.cart-summary { margin-top: 20px; padding: 20px; background: var(--ivory); border-radius: 8px; border: 1px solid rgba(42,31,20,0.1); }
.cart-grand-total { font-weight: 700; font-size: 1.15rem; font-family: var(--font-display); }

/* --- Checkout --- */
.checkout-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .checkout-layout { grid-template-columns: 1.3fr 1fr; } }
.checkout-summary { background: var(--ivory); padding: 18px; border-radius: 8px; height: fit-content; border: 1px solid rgba(42,31,20,0.1); }
.checkout-summary-item, .checkout-summary-line { display: flex; justify-content: space-between; padding: 5px 0; }
.checkout-summary-total { font-weight: 700; font-size: 1.15rem; margin-top: 10px; font-family: var(--font-display); }

/* --- Footer --- */
.site-footer { background: var(--cacao); color: var(--kraft); padding: 36px 20px 14px; margin-top: 48px; border-top: 4px solid var(--turmeric); }
.footer-content { display: flex; flex-wrap: wrap; gap: 28px; max-width: 1100px; margin: 0 auto; }
.footer-col { flex: 1; min-width: 160px; }
.footer-col h4 { color: var(--turmeric); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col a { color: var(--kraft); opacity: 0.85; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { padding: 3px 0; }
.footer-bottom { text-align: center; margin-top: 22px; font-size: 0.82rem; color: #B8A98A; }
