/* ===========================================================
   Jones Lanchonete Delivery — estilos
   =========================================================== */

:root {
    --bg: #17121a;
    --bg-soft: #1f1922;
    --surface: #241d29;
    --surface-hover: #2c2431;
    --border: #3a2f3f;
    --text: #f5eef0;
    --text-muted: #b8aab3;
    --orange: #ff7a1a;
    --orange-dark: #e35b00;
    --red: #ee3d3d;
    --gradient: linear-gradient(135deg, #ff7a1a 0%, #ee3d3d 100%);
    --success: #2fbf71;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
    --header-h: 132px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 90px;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 { margin: 0; }

/* ---------------- Topbar ---------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: linear-gradient(180deg, #1c1520 0%, #17121a 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.topbar__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 16px 10px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.brand__logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--orange);
    flex-shrink: 0;
}

.brand__text h1 {
    font-size: 1.25rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__status {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(47,191,113,0.2);
    flex-shrink: 0;
}

.cart-toggle {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}
.cart-toggle:hover { background: var(--surface-hover); transform: translateY(-1px); }

.cart-toggle__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg);
}
.cart-toggle__badge[hidden] { display: none; }

.category-nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 16px 12px;
    scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.category-nav__pill {
    flex-shrink: 0;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.category-nav__pill:hover,
.category-nav__pill:active { background: var(--surface-hover); border-color: var(--orange); }

/* ---------------- Content ---------------- */

.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 10px;
}

.category { margin-bottom: 34px; scroll-margin-top: var(--header-h); }

.category__title {
    font-size: 1.15rem;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: border-color 0.15s, transform 0.15s;
}
.product-card:hover { border-color: var(--orange); }

.product-card__info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.product-card__desc {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.product-card__price {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--orange);
}

.product-card__action { display: flex; justify-content: flex-end; }

.btn-add {
    background: var(--gradient);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.btn-add:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-add:active { transform: translateY(0); }

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 6px;
}

.qty-stepper button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--surface-hover);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}
.qty-stepper button:hover { background: var(--orange); }

.qty-stepper__value {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
}

/* ---------------- Footer ---------------- */

.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 24px 16px 40px;
}

/* ---------------- Cart FAB (mobile) ---------------- */

.cart-fab {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    box-shadow: var(--shadow);
    cursor: pointer;
}
.cart-fab[hidden] { display: none; }

@media (min-width: 760px) {
    /* No desktop já existe o ícone do carrinho no topo; some com a barra flutuante. */
    .cart-fab { display: none !important; }
}

.cart-fab__count {
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.cart-fab__label { flex: 1; text-align: left; }
.cart-fab__total { font-size: 0.95rem; }

/* ---------------- Overlay ---------------- */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 45;
    backdrop-filter: blur(2px);
}

/* ---------------- Cart Drawer ---------------- */

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    background: var(--bg-soft);
    border-left: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.cart-drawer.is-open { transform: translateX(0); }

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--border);
}

.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}
.icon-btn:hover { background: var(--surface-hover); }

.cart-drawer__items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 18px;
}

.cart-empty {
    color: var(--text-muted);
    text-align: center;
    margin-top: 40px;
    line-height: 1.6;
}

.cart-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-line__info { flex: 1; min-width: 0; }
.cart-line__name { font-weight: 600; font-size: 0.92rem; }
.cart-line__price { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

.cart-line__remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px;
}
.cart-line__remove:hover { color: var(--red); }

.cart-drawer__footer {
    padding: 14px 18px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.cart-min-warning {
    color: #ffb020;
    font-size: 0.8rem;
    margin: 6px 0 0;
}

/* ---------------- Buttons ---------------- */

.btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--gradient);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }

.btn-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }

/* ---------------- Modal ---------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,0.6);
}
.modal.is-open { display: flex; }

@media (min-width: 640px) {
    .modal { align-items: center; }
}

.modal__box {
    background: var(--bg-soft);
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding: 20px 20px 26px;
    border: 1px solid var(--border);
}

@media (min-width: 640px) {
    .modal__box { border-radius: 20px; }
}

.modal__box--small {
    text-align: center;
    max-width: 400px;
    border-radius: 20px;
    padding: 32px 24px;
}

.success-icon { font-size: 3rem; margin-bottom: 6px; }
.modal__box--small p { color: var(--text-muted); margin: 8px 0 20px; }

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ---------------- Form ---------------- */

.form-section { margin-bottom: 18px; }
.form-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.checkout-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.checkout-form input,
.checkout-form textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
}
.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: var(--orange);
}

.form-row { display: flex; gap: 10px; }
.form-row .grow { flex: 2; }
.form-row .small { flex: 1; }

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    margin: 0;
}
.payment-option:has(input:checked) {
    border-color: var(--orange);
    background: rgba(255,122,26,0.12);
}
.payment-option input { width: auto; margin: 0; }

.payment-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 8px 0 0;
}

.checkout-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.checkout-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 4px 0;
    color: var(--text-muted);
}
.checkout-summary__row--total {
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 8px;
}

.form-error {
    background: rgba(238,61,61,0.15);
    color: #ff8080;
    border: 1px solid rgba(238,61,61,0.35);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 14px;
}
