/* Self-hosted so the page always renders in Poppins even if the visitor's
   network can't reach fonts.googleapis.com (seen dropping out locally). */
@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../../assets/fonts/poppins/poppins-400.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../../assets/fonts/poppins/poppins-500.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../../assets/fonts/poppins/poppins-600.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../../assets/fonts/poppins/poppins-700.woff2") format("woff2");
}

@font-face {
    font-family: "Poppins";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../../assets/fonts/poppins/poppins-800.woff2") format("woff2");
}

:root {
    --brand-red: #c8102e;
    --brand-red-dark: #960c22;
    --brand-gold: #ffb81c;
    --brand-dark: #181110;
    --brand-cream: #fff8f0;
    --text-muted: #6c757d;
    --radius: 14px;
    --radius-sm: 10px;
    --header-h: 72px;
    --shadow-card: 0 4px 16px rgba(24, 17, 16, .08);
}

/* ==========================================================================
   BASE (mobile first - these rules are the phone experience by default;
   larger screens get MORE space/columns added later via min-width queries,
   never taken away via max-width overrides. This avoids the override-fights
   that broke the previous version.)
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html, body { height: 100%; overflow-x: hidden; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--brand-cream);
    color: #221a19;
    font-size: 16px;
    line-height: 1.5;
    width: 100%;
}

a { text-decoration: none; color: inherit; }

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

button { font-family: inherit; }

.site-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--brand-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    border-bottom: 3px solid var(--brand-red);
    width: 100%;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    min-width: 0;
}

.site-logo img {
    height: 44px;
    width: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    border: 2px solid var(--brand-gold);
}

.site-logo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-logo .tagline {
    display: block;
    font-size: .68rem;
    font-weight: 500;
    color: #d8cfcd;
}

.cart-btn {
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 9px 16px;
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.cart-btn:active { background: var(--brand-red-dark); }

.cart-count {
    background: var(--brand-gold);
    color: var(--brand-dark);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 800;
}

/* ---------- Trust bar ---------- */
.trust-bar { background: var(--brand-gold); color: var(--brand-dark); }

.trust-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: .72rem;
    text-transform: uppercase;
}

.trust-item i { font-size: .85rem; }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: #fff;
    text-align: center;
    padding: 36px 16px;
    width: 100%;
}

.hero-badge {
    display: inline-block;
    background: var(--brand-dark);
    color: var(--brand-gold);
    font-weight: 800;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 10px;
}

.hero p {
    max-width: 480px;
    margin: 0 auto;
    opacity: .95;
    font-size: .92rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-weight: 800;
    font-size: .88rem;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 50px;
}

.hero-cta:active { background: #e6a516; }

/* ---------- Layout ---------- */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 14px 60px;
    width: 100%;
    flex: 1 0 auto;
    min-width: 0;
}

.section-heading {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--brand-dark);
}

.section-subheading {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.menu-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    min-width: 0;
}

/* ---------- Category tabs ---------- */
.category-tabs {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    background: var(--brand-dark);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    margin-bottom: 14px;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.category-tab {
    flex: 0 0 auto;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, .25);
    border-radius: 50px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-tab.active { background: var(--brand-red); border-color: var(--brand-red); }

/* ---------- Menu grid: 2 compact columns on phones by default ---------- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.menu-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* The image box is a fixed-ratio window; the <img> itself is absolutely
   positioned to fill it. This is the bulletproof part - an <img> sized with
   plain width/height:100% can still assert its own intrinsic dimensions in
   some mobile browser layout passes before object-fit resolves, which is
   what caused images to blow out past their card on phones. Making the
   <img> position:absolute removes it from normal flow entirely, so its
   natural size can never influence the layout - only the parent box (sized
   by aspect-ratio) matters. */
.menu-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee;
}

.menu-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.menu-card-title {
    font-weight: 700;
    font-size: .85rem;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.menu-card-desc {
    font-size: .72rem;
    color: var(--text-muted);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-card-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.badge-pill {
    font-size: .58rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    text-transform: uppercase;
}

.badge-veg { background: #e6f4ea; color: #1e7e34; }
.badge-spicy { background: #fdeaea; color: var(--brand-red); }

.ribbon-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-size: .58rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 50px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ribbon-tag-alt { background: var(--brand-dark); color: #fff; }

.menu-card-price {
    position: absolute;
    left: 6px;
    bottom: 6px;
    background: var(--brand-red);
    color: #fff;
    font-weight: 800;
    font-size: .78rem;
    padding: 5px 10px;
    border-radius: 50px;
    border: 2px solid #fff;
}

.menu-card-footer { display: flex; justify-content: flex-end; margin-top: 4px; }

.add-btn {
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: .72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.add-btn:active { background: var(--brand-red-dark); }

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-dark);
    border-radius: 50px;
    padding: 4px 6px;
}

.qty-stepper button {
    background: var(--brand-red);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 800;
    font-size: .8rem;
    cursor: pointer;
    line-height: 1;
}

.qty-stepper span { color: #fff; font-weight: 700; min-width: 14px; text-align: center; font-size: .8rem; }

/* ---------- Cart panel ---------- */
.cart-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

.cart-panel h3 {
    margin-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe6;
}

.cart-line-name { font-weight: 600; font-size: .9rem; }
.cart-line-meta { font-size: .78rem; color: var(--text-muted); }

.cart-line-remove {
    background: none;
    border: none;
    color: var(--brand-red);
    cursor: pointer;
    font-size: .9rem;
    padding: 4px;
}

.cart-empty { color: var(--text-muted); font-size: .88rem; text-align: center; padding: 20px 0; }

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: .88rem;
}

.cart-summary-row.total {
    font-weight: 800;
    font-size: 1.05rem;
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 10px;
}

.checkout-btn {
    display: block;
    width: 100%;
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px;
    font-weight: 800;
    font-size: .95rem;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 14px;
    text-align: center;
}

.checkout-btn:active { background: var(--brand-red-dark); }
.checkout-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ---------- Forms (checkout page) ---------- */
.form-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 14px;
}

.form-card h3 {
    margin-bottom: 14px;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
}

.form-control:focus { outline: none; border-color: var(--brand-red); }

.toggle-group { display: flex; gap: 8px; }

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 11px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: .88rem;
}

.toggle-option.active { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }

.payment-option {
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .92rem;
}

.payment-option.active { border-color: var(--brand-red); background: #fff5f5; }
.payment-option.disabled { opacity: .55; cursor: not-allowed; }

.payment-option .pname { font-weight: 700; flex: 1; }

.badge-soon {
    background: #eee;
    color: #777;
    font-size: .62rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
    text-transform: uppercase;
}

.bank-details {
    background: #f8f5f0;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: .85rem;
    margin-top: 8px;
    display: none;
}

.alert-box {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    margin-bottom: 14px;
}

.alert-danger { background: #fdeaea; color: var(--brand-red); }
.alert-success { background: #e6f4ea; color: #1e7e34; }

/* ---------- Confirmation ---------- */
.confirm-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 36px 20px;
    text-align: center;
}

.confirm-panel .icon { font-size: 2.8rem; color: #1e7e34; margin-bottom: 10px; }
.confirm-panel h2 { margin-bottom: 8px; font-size: 1.3rem; }
.confirm-panel p { color: var(--text-muted); margin: 4px 0; font-size: .92rem; }

.confirm-order-no {
    display: inline-block;
    background: var(--brand-cream);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 800;
    font-size: 1.05rem;
    margin: 14px 0;
}

/* ---------- Footer ---------- */
.site-footer { flex-shrink: 0; background: var(--brand-dark); color: #cfc4c1; margin-top: auto; width: 100%; }

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.footer-col h4 {
    color: #fff;
    font-size: .92rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.footer-brand span { font-size: 1.15rem; font-weight: 800; color: #fff; text-transform: uppercase; }

.footer-col p { font-size: .85rem; line-height: 1.55; margin-top: 8px; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }

.footer-links a { font-size: .85rem; display: inline-flex; align-items: center; gap: 8px; }
.footer-links a i { color: var(--brand-gold); width: 14px; text-align: center; }

.footer-branch { font-size: .85rem; margin-bottom: 12px; line-height: 1.5; }
.footer-branch strong { color: #fff; display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.footer-branch strong i, .footer-branch > i { color: var(--brand-gold); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    text-align: center;
    padding: 14px;
    font-size: .8rem;
}

/* ---------- Mobile cart drawer (phones + tablets) ---------- */
.cart-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(360px, 90vw);
    height: 100vh;
    border-radius: 0;
    overflow-y: auto;
    transition: right .25s ease;
    z-index: 100;
}

.cart-panel.open { right: 0; }

.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 99;
}

.cart-overlay.open { display: block; }

.cart-close {
    display: block;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #999;
}

/* ==========================================================================
   TABLET AND UP (>= 640px) - more breathing room, bigger type
   ========================================================================== */
@media (min-width: 640px) {

    :root { --header-h: 84px; }

    .site-header-inner { padding: 14px 20px; gap: 16px; }
    .site-logo { font-size: 1.4rem; gap: 14px; }
    .site-logo img { height: 56px; width: 56px; }
    .site-logo .tagline { font-size: .82rem; }
    .cart-btn { padding: 12px 22px; font-size: 1rem; }

    .hero { padding: 56px 20px; }
    .hero h1 { font-size: 2.4rem; }
    .hero p { font-size: 1.05rem; }
    .hero-cta { font-size: 1rem; padding: 15px 30px; }

    .page-wrap { padding: 26px 20px 80px; }
    .section-heading { font-size: 1.75rem; }
    .section-subheading { font-size: 1rem; }

    .category-tab { padding: 10px 20px; font-size: .95rem; }

    .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

    .menu-card-body { padding: 14px; gap: 8px; }
    .menu-card-title { font-size: 1.1rem; }
    .menu-card-desc { font-size: .9rem; }
    .menu-card-price { font-size: 1.05rem; padding: 8px 14px; left: 10px; bottom: 10px; }
    .add-btn { font-size: .9rem; padding: 9px 18px; }
    .ribbon-tag { font-size: .68rem; padding: 5px 11px; top: 10px; left: 10px; }
}

/* ==========================================================================
   DESKTOP (>= 992px) - two-column page layout with a sticky cart sidebar
   ========================================================================== */
@media (min-width: 992px) {

    .menu-layout { flex-direction: row; align-items: flex-start; }

    main#menu { flex: 1; min-width: 0; }

    /* Enough horizontal room on desktop to just wrap onto a second line
       instead of needing a scrollbar - scrolling tabs are a mobile/touch
       pattern, not a desktop one. */
    .category-tabs { flex-wrap: wrap; overflow-x: visible; }

    .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .cart-panel {
        position: sticky;
        top: calc(var(--header-h) + 16px);
        right: auto;
        width: 340px;
        flex-shrink: 0;
        height: auto;
        border-radius: var(--radius);
        overflow-y: visible;
    }

    .cart-close { display: none; }
    .cart-overlay { display: none !important; }

    .footer-inner { flex-direction: row; justify-content: space-between; }
    .footer-col { flex: 1; }
}

@media (min-width: 1200px) {
    .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
