/* ==========================================================================
   Al-Ghani Fast Foods - Online Ordering
   Built mobile-first: base rules below are the phone layout. Larger screens
   get MORE room added via min-width breakpoints - nothing is ever taken away
   from a smaller screen by a larger one, which avoids the override conflicts
   that broke earlier versions of this stylesheet.

   Breakpoints: 768px (tablet), 1024px (desktop sidebar layout), 1280px (wide desktop)
   ========================================================================== */

@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: 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 {
    --red: #c8102e;
    --red-dark: #960c22;
    --gold: #ffb81c;
    --dark: #181110;
    --cream: #fff8f0;
    --muted: #6c757d;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 16px rgba(24, 17, 16, .08);
    --header-h: 68px;
    --sidebar-w: 320px;
}

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

html { scroll-behavior: smooth; }

html, body {
    height: 100%;
    overflow-x: hidden;   /* belt-and-braces: nothing can force a page-wide horizontal scrollbar */
    max-width: 100%;
}

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

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

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

button { font-family: inherit; border: none; background: none; cursor: pointer; }

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

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

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: var(--header-h);
}

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

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

.site-logo-text { min-width: 0; overflow: hidden; }
.site-logo-text .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-logo-text .tagline { display: block; font-size: .65rem; font-weight: 500; color: #d8cfcd; }

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

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

@keyframes cartBump {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); }
    60% { transform: scale(.95); }
    100% { transform: scale(1); }
}

.cart-btn.bump { animation: cartBump .35s ease; }

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

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

.trust-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
}

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

/* ---------------- Popular items strip ---------------- */
.popular-strip { background: #fff; border-bottom: 1px solid #f0e8e0; }

.popular-strip-inner { max-width: 1280px; margin: 0 auto; padding: 16px; }

.popular-heading {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popular-heading i { color: var(--red); }

.popular-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.popular-card {
    flex: 0 0 auto;
    width: 128px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
}

.popular-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: #eee;
    margin-bottom: 8px;
    position: relative;
}

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

.popular-card-title {
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-card-price { font-size: .74rem; font-weight: 800; color: var(--red); margin-bottom: 6px; }

.popular-card .add-btn { width: 100%; justify-content: center; }
.popular-card .qty-stepper { justify-content: center; }

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

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

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

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

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

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

/* ---------------- Page layout ---------------- */
.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 16px 50px;
    width: 100%;
    flex: 1 0 auto;
    min-width: 0;
}

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

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

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

.menu-main { min-width: 0; }

/* ---------------- Category tabs ---------------- */
/* Horizontal swipe-scroll on mobile (a natural touch pattern); on wider
   screens they wrap onto extra lines instead, since a scrollbar makes no
   sense when there's plenty of horizontal room to just show them all. */
.category-tabs {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    background: var(--dark);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    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 14px;
    font-weight: 700;
    font-size: .78rem;
    white-space: nowrap;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

/* ---------------- Menu sections ---------------- */
/* The whole menu is one long scroll of these - each category (plus the
   virtual "Combo Deals"/"Add-ons" groups) gets its own banner + grid. The
   quick-nav pills above just jump to a section's #id. */
.menu-section { margin-bottom: 24px; scroll-margin-top: calc(var(--header-h) + 10px); }

.menu-section-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(120deg, var(--dark) 0%, #2a1c1a 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    overflow: hidden;
    border-left: 4px solid var(--gold);
}

/* Layered accent stripe behind the banner content - an original geometric
   flourish (not a photo/illustration), just a soft diagonal color wash. */
.menu-section-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 60%, rgba(255, 184, 28, .12) 100%);
    pointer-events: none;
}

.menu-section-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--gold);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
}

.menu-section-banner h3 {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ---------------- Menu grid ---------------- */
/* Explicit column counts per breakpoint (not auto-fit/auto-fill math) so the
   exact width at every size is known and verified up front - see the
   comments per breakpoint below for the numbers this was checked against. */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* ~139-166px/card at 320-375px viewports */
    gap: 10px;
    width: 100%;
    min-width: 0;
}

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

/* The photo box is a fixed-ratio window; the <img> is absolutely positioned
   to fill it completely. This is deliberate: an <img> sized with plain
   width/height:100% can still assert its own natural dimensions during some
   mobile browsers' layout passes before object-fit resolves, which is what
   caused photos to blow out past their card before. Making the <img>
   position:absolute removes it from normal flow entirely, so its natural
   size can never affect the layout - only this fixed box does. */
.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-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    background: var(--gold);
    color: var(--dark);
    font-size: .58rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 50px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

.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: .82rem;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.menu-card-desc {
    font-size: .7rem;
    color: var(--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: .56rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    text-transform: uppercase;
}

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

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

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

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

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

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

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

/* ---------------- Cart panel (slide-in drawer on mobile/tablet) ---------------- */
.cart-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    position: fixed;
    top: 0;
    right: -100%;
    width: min(340px, 88vw);
    height: 100vh;
    overflow-y: auto;
    transition: right .25s ease;
    z-index: 100;
    border-radius: 0;
}

.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;
    font-size: 1.3rem;
    color: #999;
}

.cart-panel h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    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: .88rem; }
.cart-line-meta { font-size: .76rem; color: var(--muted); }

.cart-line-remove { color: var(--red); font-size: .9rem; padding: 4px; }

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

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

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

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

.checkout-btn:active { background: var(--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);
    padding: 16px;
    margin-bottom: 14px;
}

.form-card h3 {
    margin-bottom: 14px;
    font-size: .98rem;
    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: .82rem; margin-bottom: 5px; }

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

.form-control:focus { outline: none; border-color: var(--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: .85rem;
}

.toggle-option.active { background: var(--red); border-color: var(--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: .9rem;
}

.payment-option.active { border-color: var(--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: .6rem;
    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: .84rem;
    margin-top: 8px;
    display: none;
}

.alert-box { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 14px; }
.alert-danger { background: #fdeaea; color: var(--red); }
.alert-success { background: #e6f4ea; color: #1e7e34; }

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

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

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

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

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.footer-col h4 { color: #fff; font-size: .9rem; font-weight: 800; text-transform: uppercase; margin-bottom: 12px; }
.footer-brand span { font-size: 1.1rem; font-weight: 800; color: #fff; text-transform: uppercase; }
.footer-col p { font-size: .82rem; line-height: 1.55; margin-top: 8px; }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: .82rem; display: inline-flex; align-items: center; gap: 8px; }
.footer-links a i { color: var(--gold); width: 14px; text-align: center; }

.footer-branch { font-size: .82rem; 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(--gold); }

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

/* ==========================================================================
   TABLET (>= 768px) - checked: 728px content / 3 cols / 16px gap = 232px/card
   ========================================================================== */
@media (min-width: 768px) {

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

    .site-header-inner { padding: 14px 20px; gap: 16px; }
    .site-logo { font-size: 1.3rem; gap: 14px; }
    .site-logo img { height: 54px; width: 54px; }
    .site-logo-text .tagline { font-size: .78rem; }
    .cart-btn { padding: 12px 20px; font-size: .95rem; }

    .hero { padding: 52px 20px; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .hero-cta { font-size: .95rem; padding: 14px 28px; }

    .page-wrap { padding: 26px 20px 70px; }
    .section-heading { font-size: 1.6rem; }
    .section-subheading { font-size: .95rem; }

    .menu-section-banner { padding: 16px 20px; gap: 16px; }
    .menu-section-icon { width: 42px; height: 42px; font-size: 1.1rem; }
    .menu-section-banner h3 { font-size: 1.2rem; }

    /* Enough horizontal room to just wrap tabs onto extra lines - no
       scrollbar needed once there's this much width available. */
    .category-tabs { flex-wrap: wrap; overflow-x: visible; }
    .category-tab { padding: 10px 18px; font-size: .88rem; }

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

    .menu-card-body { padding: 12px; gap: 6px; }
    .menu-card-title { font-size: 1rem; }
    .menu-card-desc { font-size: .82rem; }
    .menu-card-price { font-size: .95rem; padding: 7px 13px; left: 10px; bottom: 10px; }
    .menu-card-tag { font-size: .65rem; padding: 5px 10px; top: 10px; left: 10px; }
    .add-btn { font-size: .82rem; padding: 8px 15px; }
}

/* ==========================================================================
   DESKTOP (>= 1024px) - sidebar cart layout
   checked: main width = 1024-40-340(sidebar+gap) = 644px / 3 cols / 16px gap = 204px/card
   ========================================================================== */
@media (min-width: 1024px) {

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

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

    .cart-panel {
        position: sticky;
        top: calc(var(--header-h) + 16px);
        right: auto;
        width: var(--sidebar-w);
        flex-shrink: 0;
        height: auto;
        max-height: calc(100vh - var(--header-h) - 32px);
        border-radius: var(--radius);
        overflow-y: auto;
    }

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

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

/* ==========================================================================
   WIDE DESKTOP (>= 1280px)
   checked: main width = 1280-40-340 = 900px / 4 cols / 16px gap = 213px/card
   ========================================================================== */
@media (min-width: 1280px) {
    .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
