﻿/* Sattvaved order app – light, mobile-first look */
:root {
    --sv-green: #2f6b2f;
    --sv-green-dark: #245524;
    --sv-green-soft: #e6f1e4;
    --sv-orange: #f5a01a;
    --sv-orange-dark: #d98a0c;
    --sv-bg: #f6f8f4;
    --sv-card: #ffffff;
    --sv-text: #1f2a1f;
    --sv-muted: #6b7a6b;
    --sv-border: #e3e9df;
    --sv-radius: 16px;
    --sv-shadow: 0 2px 10px rgba(30, 60, 30, 0.08);
    --bottom-bar-h: 74px;
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--sv-bg);
    color: var(--sv-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
    padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--sv-green); }

.app-container { max-width: 720px; margin: 0 auto; padding: 0 14px; }

/* Header */
.app-header {
    position: sticky; top: 0; z-index: 20;
    background: #fff;
    border-bottom: 1px solid var(--sv-border);
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    padding: 8px 0;
    padding-top: calc(8px + env(safe-area-inset-top));
}
.brand img { height: 46px; width: auto; display: block; }

.cart-btn {
    position: relative;
    width: 46px; height: 46px;
    border: none; border-radius: 12px;
    background: var(--sv-green); color: #fff;
    font-size: 1.35rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 8px rgba(47,107,47,0.35);
    transition: transform .15s ease;
}
.cart-btn:active { transform: scale(.94); }
.cart-badge {
    position: absolute; top: -7px; right: -7px;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 11px;
    background: var(--sv-orange); color: #fff;
    font-size: .8rem; font-weight: 700; line-height: 22px; text-align: center;
    border: 2px solid #fff;
    animation: pop .25s ease;
}
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Promo */
.promo {
    margin: 14px 0 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eaf5e6, #fff7e6);
    border-radius: var(--sv-radius);
    border: 1px solid #e2eddc;
}
.promo-title { font-size: 1.15rem; font-weight: 700; color: var(--sv-green-dark); margin: 0 0 6px; }
.promo-points { list-style: none; padding: 0; margin: 0; font-size: .9rem; color: #38503a; }
.promo-points li { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.promo-points i { color: var(--sv-green); margin-top: 2px; }

.section-title {
    font-size: 1.05rem; font-weight: 700; color: var(--sv-green-dark);
    margin: 18px 0 10px; display: flex; align-items: baseline; gap: 8px;
}
.section-title i { color: var(--sv-orange); }
.section-title small { font-size: .8rem; font-weight: 500; color: var(--sv-muted); }

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

.product-card {
    background: var(--sv-card);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    overflow: hidden;
    display: flex; flex-direction: column;
    border: 2px solid transparent;
    transition: border-color .2s ease;
}
.product-card.in-cart { border-color: var(--sv-green); }
.product-img { aspect-ratio: 1 / 1; background: #eef3e8; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.product-name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.product-name-en { font-size: .78rem; color: var(--sv-muted); }
.product-price { font-weight: 700; color: var(--sv-green-dark); margin-top: 4px; }
.product-price span { font-weight: 500; font-size: .8rem; color: var(--sv-muted); }
.product-actions { margin-top: 8px; }

.btn-add {
    width: 100%; height: 40px;
    border: none; border-radius: 10px;
    background: var(--sv-green); color: #fff;
    font-weight: 600; font-size: .95rem;
    transition: background .15s, transform .1s;
}
.btn-add:active { background: var(--sv-green-dark); transform: scale(.97); }

.stepper {
    display: flex; align-items: center; justify-content: space-between;
    height: 40px; border-radius: 10px;
    background: var(--sv-green-soft);
    border: 1.5px solid var(--sv-green);
    overflow: hidden;
}
.stepper button {
    width: 42px; height: 100%;
    border: none; background: transparent;
    color: var(--sv-green-dark); font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
}
.stepper button:active { background: rgba(47,107,47,.15); }
.stepper .qty { font-weight: 800; font-size: 1.1rem; color: var(--sv-green-dark); min-width: 24px; text-align: center; }

/* Panels (cart, checkout) */
.panel {
    background: var(--sv-card);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    padding: 14px 14px 16px;
    margin: 18px 0;
}
.panel .section-title { margin-top: 0; }

.cart-list { display: flex; flex-direction: column; }
.cart-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-areas:
        "img info remove"
        "img ctrl ctrl";
    column-gap: 10px; row-gap: 6px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--sv-border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item img { grid-area: img; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; align-self: start; }
.cart-item .ci-info { grid-area: info; min-width: 0; }
.cart-item .ci-name { font-weight: 700; line-height: 1.2; }
.cart-item .ci-en { font-weight: 400; font-size: .78rem; color: var(--sv-muted); }
.cart-item .ci-meta { font-size: .8rem; color: var(--sv-muted); }
.cart-item .ci-remove {
    grid-area: remove; align-self: start;
    border: none; background: transparent; color: #b04a3a; font-size: 1.1rem; padding: 0 2px;
}
.cart-item .ci-ctrl { grid-area: ctrl; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-item .stepper { width: 118px; height: 36px; flex-shrink: 0; }
.cart-item .stepper button { width: 38px; }
.cart-item .ci-line { font-size: .85rem; color: var(--sv-muted); text-align: right; white-space: nowrap; }
.cart-item .ci-line strong { font-size: 1rem; color: var(--sv-green-dark); }
.cart-total {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 10px; padding-top: 12px;
    border-top: 2px dashed var(--sv-border);
    font-size: 1.05rem;
}
.cart-total strong { font-size: 1.3rem; color: var(--sv-green-dark); }

.form-label { font-weight: 700; margin-bottom: 4px; font-size: 1.02rem; }
.form-label small { font-weight: 500; color: var(--sv-muted); font-size: .8rem; }
.en { font-weight: 500; font-size: .78em; opacity: .85; }
.form-label .req { color: #c0392b; }
.form-control { border-radius: 12px; border-color: var(--sv-border); }
.form-control:focus { border-color: var(--sv-green); box-shadow: 0 0 0 .2rem rgba(47,107,47,.15); }

.pay-box {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin: 6px 0 14px;
    background: #fff7e6; border: 1px solid #f7dfae; border-radius: 12px;
}
.pay-box i { font-size: 1.7rem; color: var(--sv-orange-dark); }
.pay-box strong { color: #7a4f00; }
.pay-box .small { color: #8a6a2a; }

.btn-submit {
    width: 100%; height: 54px;
    border: none; border-radius: 14px;
    background: var(--sv-orange); color: #fff;
    font-weight: 800; font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(245,160,26,.4);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit:active { background: var(--sv-orange-dark); }
.btn-submit:disabled { opacity: .7; }
.delivery-note { font-size: .85rem; color: var(--sv-muted); text-align: center; margin: 12px 0 0; }

.app-footer {
    text-align: center; font-size: .85rem; color: var(--sv-muted);
    padding: 12px 0 24px;
}

/* Sticky bottom bar */
.bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff;
    border-top: 1px solid var(--sv-border);
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bottom-bar[hidden] { display: none; }
.bottom-summary { display: flex; flex-direction: column; line-height: 1.15; }
.bottom-summary span { font-size: .8rem; color: var(--sv-muted); }
.bottom-summary strong { font-size: 1.25rem; color: var(--sv-green-dark); }
.btn-order-now {
    height: 48px; padding: 0 22px;
    border: none; border-radius: 12px;
    background: var(--sv-green); color: #fff;
    font-weight: 700; font-size: 1rem;
    box-shadow: 0 3px 10px rgba(47,107,47,.35);
}
.btn-order-now:active { background: var(--sv-green-dark); }

/* Success page */
.success-hero { text-align: center; padding: 26px 10px 8px; }
.success-icon {
    width: 76px; height: 76px; margin: 0 auto 12px;
    border-radius: 50%; background: var(--sv-green); color: #fff;
    font-size: 2.4rem; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(47,107,47,.35);
}
.success-hero h1 { font-size: 1.5rem; font-weight: 800; color: var(--sv-green-dark); }
.success-hero p { color: #3a4a3a; margin-bottom: 8px; }
.order-no {
    display: inline-block; padding: 6px 14px;
    background: var(--sv-green-soft); border-radius: 999px; color: var(--sv-green-dark);
}
.summary-table td, .summary-table th { border-color: var(--sv-border); vertical-align: top; }
.summary-table tfoot th { font-size: 1.05rem; color: var(--sv-green-dark); }
.address-box { background: var(--sv-bg); border-radius: 12px; padding: 10px 12px; }
.btn-whatsapp {
    height: 52px; border-radius: 14px; background: #25d366; color: #fff;
    font-weight: 700; font-size: 1.02rem; text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-whatsapp:hover { color: #fff; background: #1ebd59; }

/* Admin orders */
.order-card { margin: 12px 0; }
.order-items { list-style: none; padding: 8px 10px; margin: 0; background: var(--sv-bg); border-radius: 10px; }
.order-items li { display: flex; justify-content: space-between; padding: 2px 0; font-size: .92rem; }
