/**
 * Sugar Pappi — storefront responsive + UI consistency layer
 * Loads AFTER sugarpappi-update.css. Does not change brand colors or business logic.
 */

/* Body uses Bootstrap light-blue (#f1f8ff) which reads as a large beige/blank field
   whenever white page chrome does not cover the viewport. Keep brand pink; force white page canvas. */
html,
body {
    background-color: #ffffff !important;
}

:root {
    --sp-pink: #ff2d87;
    --sp-pink-dark: #d8186c;
    --sp-black: #0b0b0b;
    --sp-ink: #111111;
    --sp-muted: #6b6b6b;
    --sp-surface: #ffffff;
    --sp-border: rgba(17, 17, 17, 0.08);
    --sp-radius-sm: 10px;
    --sp-radius-md: 14px;
    --sp-radius-lg: 20px;
    --sp-radius-pill: 999px;
    --sp-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.06);
    --sp-shadow-md: 0 14px 34px rgba(0, 0, 0, 0.10);
    --sp-ease: cubic-bezier(.22, 1, .36, 1);
    --sp-gutter: clamp(16px, 3vw, 28px);
    --sp-max: 1320px;
    --sp-section-y: clamp(40px, 6vw, 80px);
    --sp-touch: 44px;
}

/* ── Foundation ── */
html {
    scroll-behavior: smooth;
}
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    color: var(--sp-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img,
svg,
video {
    max-width: 100%;
    height: auto;
}
button,
a,
.btn,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}
:focus-visible {
    outline: 3px solid rgba(255, 45, 135, 0.45);
    outline-offset: 2px;
}

/*
 * Shared site grid
 * - .sp-site-container / Bootstrap .container : readable contained content
 * - full-bleed heroes/banners must NOT inherit side gutters
 * Do NOT pad every .container-xxl — that caused double gutters + hero side gaps.
 */
.sp-site-container,
.container {
    width: 100%;
    max-width: var(--sp-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sp-gutter);
    padding-right: var(--sp-gutter);
}

/* Outer page shell stays edge-to-edge so heroes can go full-bleed */
.container-xxl.bg-white.p-0,
.container-xxl.p-0,
.main-content > .container-xxl.p-0 {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Contained sections that use container-xxl as the content grid */
.container-xxl:not(.p-0):not(.bg-white) {
    max-width: var(--sp-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sp-gutter);
    padding-right: var(--sp-gutter);
}

/* Prevent double horizontal padding: .container-xxl > .container */
.container-xxl > .container,
.container-xxl .container.sp-nested-container,
#featured-items > .container,
.cz-menu-page .container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* ── Full-bleed visual sections (hero / banner / drive bar) ── */
.sp-page-hero,
.gallery-hero-header,
.sp-cart-hero,
.sp-hero,
.sp-drive-bar,
.sp-full-bleed {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* If a hero is nested inside a padded/max-width ancestor, break out to viewport */
.sp-page-hero,
.gallery-hero-header,
.sp-cart-hero,
.sp-full-bleed {
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.sp-page-hero h1,
.gallery-hero-header h1 {
    width: min(100% - (var(--sp-gutter) * 2), var(--sp-max));
    margin-left: auto;
    margin-right: auto;
}

/* Homepage shop-info: uses .container-xxl inside — no extra gutters here */
.sp-home-intro {
    width: 100%;
}

/*
 * Shared section rhythm — Featured spacing is the source of truth
 * Every .sp-section gets the same vertical padding on all pages
 */
.sp-section {
    width: 100%;
    padding-top: var(--sp-section-y);
    padding-bottom: var(--sp-section-y);
    background: #fff;
}
.sp-section + .sp-section {
    /* Keep rhythm even when sections stack; avoid double-visual gap from old py-5 */
    margin-top: 0;
}
.sp-section-head {
    margin-bottom: clamp(28px, 4vw, 48px);
}
.sp-section-heading {
    margin-bottom: 0;
    color: var(--sp-ink);
    letter-spacing: -0.02em;
    font-weight: 800;
}
.sp-section .section-title {
    margin-bottom: 0.5rem;
}

/* ── Premium Featured carousel (luxury polish, no clipping) ── */
.sp-premium-carousel {
    position: relative;
    /* Room for owl-nav above + card shadows at edges */
    padding-top: 8px;
    padding-bottom: 12px;
    margin-left: 0;
    margin-right: 0;
}
.sp-premium-carousel .owl-stage-outer {
    overflow: hidden;
    /* Soft inset so first/last cards aren't clipped by border/shadow */
    padding: 12px 4px 20px;
    margin: -12px -4px -8px;
}
.sp-premium-carousel .owl-item .item {
    padding: 8px 10px;
    box-sizing: border-box;
}
/* Premium product cards — Featured carousel + Menu grid share this look */
.sp-section .popular-item,
.sp-premium-carousel .popular-item {
    background: #fff !important;
    border: 1px solid var(--sp-border) !important;
    border-radius: var(--sp-radius-md) !important;
    box-shadow: var(--sp-shadow-sm);
    transition: transform 280ms var(--sp-ease), box-shadow 280ms var(--sp-ease), border-color 280ms ease;
    text-decoration: none !important;
    color: inherit;
}
.sp-section .popular-item:hover,
.sp-premium-carousel .popular-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--sp-shadow-md);
    border-color: rgba(255, 45, 135, 0.22) !important;
}
.sp-premium-carousel .popular-item img {
    width: 150px !important;
    height: 150px !important;
    object-fit: cover !important;
    border-radius: var(--sp-radius-sm);
}
.sp-premium-carousel .owl-nav {
    top: -52px;
    right: 0;
    gap: 10px;
}
.sp-premium-carousel .owl-nav .arrow-icon,
.sp-premium-carousel .owl-nav button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: var(--sp-pink) !important;
    color: #fff !important;
    border: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(255, 45, 135, 0.28);
    transition: transform 220ms var(--sp-ease), background 220ms ease;
}
.sp-premium-carousel .owl-nav .arrow-icon:hover,
.sp-premium-carousel .owl-nav button:hover {
    background: var(--sp-pink-dark) !important;
    transform: translateY(-1px);
}

/* Premium FAQ accordion */
.sp-premium-faq .accordion-item {
    border: 1px solid var(--sp-border) !important;
    border-radius: var(--sp-radius-md) !important;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: var(--sp-shadow-sm);
}
.sp-premium-faq .accordion-button {
    font-weight: 600;
    padding: 1rem 1.25rem;
    background: #fff;
}
.sp-premium-faq .accordion-button:not(.collapsed) {
    background: rgba(255, 45, 135, 0.04);
    color: var(--sp-ink);
    box-shadow: none;
}
.sp-premium-faq .accordion-body {
    padding: 0 1.25rem 1.25rem;
    color: var(--sp-muted);
}

/* ── Typography ── */
h1, .h1 {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0.02em;
}
h2, .h2 {
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem);
    line-height: 1.2;
    font-weight: 800;
}
h3, .h3 {
    font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
    line-height: 1.3;
    font-weight: 700;
}
p, .small, label, .form-label {
    line-height: 1.55;
}

/* ── Buttons (premium consistency) ── */
.btn,
.sp-btn,
.cz-add-btn,
.sp-store-continue-btn,
.sp-btn-pink {
    min-height: var(--sp-touch);
    transition: transform 220ms var(--sp-ease), box-shadow 220ms var(--sp-ease), background 220ms ease, color 220ms ease, border-color 220ms ease;
}
.btn:not(:disabled):hover,
.sp-btn:not(:disabled):hover,
.cz-add-btn:hover,
.sp-store-continue-btn:not(:disabled):hover {
    transform: translateY(-1px);
}
.btn:not(:disabled):active,
.sp-btn:not(:disabled):active,
.cz-add-btn:active,
.sp-store-continue-btn:not(:disabled):active {
    transform: scale(0.98);
}
.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary,
.btn.sp-btn-pink,
.sp-btn-pink {
    background: linear-gradient(135deg, var(--sp-pink), var(--sp-pink-dark));
    border-color: transparent;
    color: #fff !important;
}
.btn-primary:hover,
.sp-btn-pink:hover {
    background: linear-gradient(135deg, var(--sp-pink-dark), #c41260);
    color: #fff !important;
}

/* ── Promo / status bars ── */
.promo-bar {
    font-size: clamp(12px, 2.6vw, 14px);
    line-height: 1.35;
    padding: 8px var(--sp-gutter) !important;
    text-align: center;
}
.promo-bar a {
    word-break: break-word;
}
.app-download-banner,
.sp-app-banner {
    font-size: clamp(11px, 2.5vw, 13px);
    padding: 9px var(--sp-gutter);
    gap: 8px;
    text-align: center;
}
.sp-closed-bar,
.sp-timer-bar,
.sp-drive-bar {
    padding: 12px var(--sp-gutter);
    font-size: clamp(13px, 2.8vw, 16px);
    line-height: 1.4;
}
.sp-closed-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}
.sp-closed-bar .btn {
    min-height: 36px;
    white-space: nowrap;
}
.sp-drive-bar {
    font-size: clamp(15px, 3vw, 22px) !important;
}

/* ── Header / nav ── */
.navbar {
    padding-left: var(--sp-gutter) !important;
    padding-right: var(--sp-gutter) !important;
}
.navbar .navbar-brand img {
    max-height: 52px;
    width: auto;
}
.navbar .navbar-toggler,
.sp-header-actions .header-icon,
.sp-header-actions .nav-link {
    min-width: var(--sp-touch);
    min-height: var(--sp-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.navbar-dark .navbar-nav .nav-link {
    white-space: nowrap;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}
@media (max-width: 1199.98px) and (min-width: 992px) {
    .navbar-dark .navbar-nav .nav-link {
        font-size: 12px;
        letter-spacing: 0.04em;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }
}
@media (max-width: 991.98px) {
    .navbar .navbar-brand img {
        max-height: 42px;
    }
    .sidebar {
        width: min(88vw, 360px) !important;
        padding-bottom: 32px;
    }
    .sidebar .sp-nav-link {
        min-height: var(--sp-touch);
        font-size: 13px;
    }
}

/* ── Heroes ── */
/* Hero: keep premium full-bleed feel without a huge empty band below CTAs.
   Overrides sugarpappi-update.css mobile min-height:100vh which reserved unused viewport. */
.sp-hero {
    min-height: clamp(520px, 78vh, 820px);
}
@media (max-width: 991.98px) {
    .sp-hero {
        min-height: clamp(480px, 72vh, 720px);
    }
}
.sp-hero-content {
    padding: clamp(72px, 12vw, 110px) var(--sp-gutter) clamp(32px, 6vw, 48px);
    width: min(100%, 760px);
}
.sp-page-hero,
.gallery-hero-header {
    min-height: clamp(200px, 32vw, 340px);
    background-size: cover;
    background-position: center;
}
.sp-page-hero h1,
.gallery-hero-header h1 {
    font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem);
    padding: clamp(28px, 5vw, 56px) var(--sp-gutter);
    text-align: center;
    max-width: 900px;
}
.sp-cta {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}
.sp-cta .sp-btn {
    width: 100%;
    max-width: 420px;
    min-width: 0;
}
.sp-cities {
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.5);
}
.sp-locations-head {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* ── Cards / product grid ── */
.cz-card {
    border-radius: var(--sp-radius-md);
    border: 1px solid var(--sp-border);
    box-shadow: var(--sp-shadow-sm);
    overflow: hidden;
    background: #fff;
    transition: transform 250ms var(--sp-ease), box-shadow 250ms var(--sp-ease);
    height: 100%;
}
.cz-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sp-shadow-md);
}
.cz-card-media {
    width: 100%;
}
.cz-card-media img.cz-card-main-img,
.cz-card-media .cz-card-main-img {
    width: 100%;
    max-width: 100%;
    object-fit: cover;
}
@media (max-width: 575.98px) {
    .cz-card-media img.cz-card-main-img,
    .cz-card-media .cz-card-main-img {
        height: clamp(140px, 42vw, 170px) !important;
    }
}
.cz-card-body {
    padding: 14px 16px 16px;
}
.cz-card-body h5 {
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.25;
}
.cz-card-desc {
    min-height: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cz-add-btn {
    width: 100%;
    border-radius: var(--sp-radius-sm);
    font-weight: 700;
    min-height: 44px;
}
.cz-cats-wrap {
    gap: 8px;
    margin-bottom: 8px;
}
.cz-cat {
    min-height: 40px;
}
.cz-cat-arrow {
    min-width: 40px;
    min-height: 40px;
}

/* Store / order cards */
.store-card,
.sp-order-card {
    border-radius: var(--sp-radius-md);
}
.sp-orders {
    width: min(100% - (var(--sp-gutter) * 2), 920px);
    padding-left: 0;
    padding-right: 0;
}
.sp-order-item {
    align-items: flex-start;
    gap: 12px;
}
.sp-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sp-item-actions .btn {
    min-height: 40px;
}

/* ── Forms ── */
.form-control,
.form-select,
input.form-control,
textarea.form-control,
select.form-select {
    min-height: var(--sp-touch);
    border-radius: var(--sp-radius-sm);
    font-size: 16px;
}
textarea.form-control {
    min-height: 120px;
}
.form-label {
    font-weight: 600;
    margin-bottom: 6px;
}
.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
}
.form-check-label {
    padding-left: 4px;
}

/* Footer newsletter — avoid overlap on narrow screens */
.footer .position-relative.mx-auto {
    max-width: 100%;
}
@media (max-width: 575.98px) {
    .footer .position-relative.mx-auto {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .footer .footer-email-box {
        padding-right: 1rem !important;
    }
    .footer #signupButton {
        position: static !important;
        width: 100%;
        margin: 0 !important;
        min-height: var(--sp-touch);
    }
}

/* ── Cart / checkout ── */
.sp-cart-hero {
    min-height: clamp(260px, 42vw, 380px);
    padding: clamp(20px, 4vw, 28px) var(--sp-gutter) clamp(36px, 6vw, 56px);
}
.carting-card,
.mobile-notify-block {
    max-width: min(92vw, 400px);
}
/*
 * Delivery / Pick-up toggle
 * Global .nav-pills .nav-link:hover sets color:#fff — on this light-grey
 * pill track that makes inactive "Pick-up" text invisible on hover.
 */
.del-pickup-container .custom-pills .nav-link {
    color: #111 !important;
    background-color: transparent !important;
    border-bottom: 0 !important;
}
.del-pickup-container .custom-pills .nav-link:hover,
.del-pickup-container .custom-pills .nav-link:focus {
    color: #111 !important;
    background-color: rgba(255, 255, 255, 0.65) !important;
}
.del-pickup-container .custom-pills .nav-link.active,
.del-pickup-container .custom-pills .show > .nav-link {
    color: #111 !important;
    background-color: #fff !important;
    border-radius: 50px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.14);
}

/* Delivery / Pick-up toggle: center on tablet/mobile when column stacks */
@media (max-width: 991.98px) {
    .del-pickup-container {
        justify-content: center !important;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    .del-pickup-container .custom-pills {
        margin-left: auto;
        margin-right: auto;
        max-width: 320px;
        width: 100%;
    }
    .col-lg-4 > .tab-content#pillsDelPickup,
    .del-pickup-container + .tab-content {
        width: 100%;
    }
}
@media (max-width: 767.98px) {
    .del-pickup-container .custom-pills .nav-link {
        min-height: var(--sp-touch);
        font-size: 14px;
    }
    .table-responsive {
        border-radius: var(--sp-radius-sm);
    }
}

/* ── Auth / profile shells ── */
.sp-auth-page .container,
body.sp-auth-body .container {
    width: min(100% - (var(--sp-gutter) * 2), 960px);
}
@media (max-width: 767.98px) {
    .sp-auth-page .row.g-0 > [class*="col-"],
    body.sp-auth-body .row.g-0 > [class*="col-"] {
        max-width: 100%;
    }
}

/* ── Gallery / contact / static ── */
.gallery-hero-header + *,
.sp-page-hero + * {
    padding-top: clamp(20px, 3vw, 36px);
}
@media (max-width: 575.98px) {
    .row.g-4 > [class*="col-"] {
        margin-bottom: 4px;
    }
}

/* ── Modals (global, beyond store modal) ── */
.modal-dialog {
    margin: 12px auto;
    width: min(calc(100vw - 24px), 100%);
}
.modal-content {
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.menu-modal .modal-dialog {
    width: min(calc(100vw - 24px), 520px);
}

/* ── Empty / soft polish ── */
.sp-store-empty,
.empty-state,
.sp-empty-state,
.text-muted.empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--sp-muted);
    border: 1px dashed var(--sp-border);
    border-radius: var(--sp-radius-md);
    background: #fafafa;
}
.sp-empty-state .btn {
    min-width: 160px;
}

/* ── Breakpoint refinements ── */
@media (max-width: 1366px) {
    :root {
        --sp-max: 1200px;
    }
}
@media (max-width: 1024px) {
    :root {
        --sp-section-y: clamp(32px, 5vw, 56px);
    }
    .cz-card-desc {
        -webkit-line-clamp: 3;
    }
}
@media (max-width: 768px) {
    .sp-hero .sp-cities {
        font-size: 11px;
        letter-spacing: 0.06em;
        padding: 0 4px;
    }
    .sp-locations-head {
        font-size: 11px;
        margin-top: 20px;
    }
    .sp-order-item {
        flex-wrap: wrap;
    }
    .sp-order-item img {
        width: 56px;
        height: 56px;
    }
    .sp-item-actions {
        width: 100%;
    }
    .sp-item-actions .btn {
        flex: 1 1 auto;
    }
}
@media (max-width: 480px) {
    .promo-bar {
        padding-top: 7px !important;
        padding-bottom: 7px !important;
    }
    .navbar {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
    .sp-brand {
        font-size: clamp(34px, 11vw, 48px);
    }
    .cz-card-body h5 {
        font-size: 16px;
    }
}
@media (max-width: 360px) {
    :root {
        --sp-gutter: 14px;
    }
    .sp-btn {
        letter-spacing: 0.05em;
        font-size: 12px;
        padding: 12px 16px;
    }
    .cz-cat {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}
@media (max-width: 320px) {
    .navbar .navbar-brand img {
        max-height: 36px;
    }
    .sp-header-actions {
        gap: 8px !important;
    }
}

/* ── Cart page ── */
.cart .product_img,
.cart_card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--sp-radius-sm);
    flex-shrink: 0;
}
.cart .btn-parent {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cart .btn-parent .btn {
    width: auto;
    min-width: calc(25% - 8px);
    flex: 1 1 22%;
    min-height: 44px;
    padding: 8px 6px;
}
.cart .tip-input-container {
    flex-wrap: wrap;
    gap: 8px;
}
.cart .tip-input-container .btn {
    width: auto !important;
    flex: 1 1 30%;
    min-height: 44px;
}
.cart .item-btn {
    min-width: 40px;
    min-height: 40px;
}
@media (max-width: 575.98px) {
    .cart .btn-parent .btn {
        flex: 1 1 45%;
        min-width: 40%;
    }
    .cart .btn_input {
        margin-left: 0 !important;
    }
    .cart .cart_card {
        padding: 12px !important;
    }
}

/* ── Checkout ── */
.checkout .select-input,
.checkout .payment-cards .select-input {
    flex-wrap: wrap;
    gap: 10px;
}
.checkout .select-input .select,
.checkout .payment-cards .select,
.checkout form.payment input,
.checkout .select-input input {
    width: 100% !important;
    min-height: var(--sp-touch);
    font-size: 16px;
}
@media (min-width: 768px) {
    .checkout .select-input .select,
    .checkout .payment-cards .select,
    .checkout form.payment input {
        width: 30% !important;
    }
    .checkout .select-input input {
        width: 66% !important;
    }
}
.checkout .contact input,
.checkout .pay .btn {
    min-height: var(--sp-touch);
    width: 100%;
}

/* ── Gallery ── */
.gallery-img {
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--sp-radius-sm);
}
.gallery-img-block {
    margin-bottom: 16px !important;
}

/* ── Homepage info / popular strip ── */
.popular-item {
    border-radius: var(--sp-radius-md);
    overflow: hidden;
}
.popular-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
@media (max-width: 767.98px) {
    .owl-carousel .popular-item {
        min-height: 0 !important;
    }
    .menu-tabs-container .tab-scroll-btn.left {
        left: 0;
    }
    .menu-tabs-container .tab-scroll-btn.right {
        right: 0;
    }
}

/* ── Auth cards ── */
.sp-auth-body .card,
body.sp-auth-page .card {
    border-radius: var(--sp-radius-md);
    border: 1px solid var(--sp-border);
    box-shadow: var(--sp-shadow-sm);
}
.sp-auth-body .btn,
body.sp-auth-page .btn {
    min-height: var(--sp-touch);
}

/* ── Sticky header offset ── */
.sp-site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}
.sp-closed-bar + .sp-site-header,
.sp-timer-bar + .sp-site-header {
    top: 0;
}

/*
 * Mobile mini-cart / notify dropdown: raise the sticky header stacking context
 * above #spHeaderBackdrop (1040). Without this, the backdrop paints over the
 * cart (darkened UI) and intercepts Continue To Cart clicks.
 * Desktop (≥992px) is unchanged — backdrop is not shown there.
 */
@media (max-width: 991.98px) {
    body.sp-header-modal-open .sp-site-header {
        z-index: 1050 !important;
    }
}

/* ── Drive-in / wholesale / static content ── */
.sp-drive-bar + .container,
.page-content-section {
    padding-top: clamp(24px, 4vw, 48px);
    padding-bottom: clamp(24px, 4vw, 48px);
}
/*
 * Homepage/menu product modals are wrapped in:
 *   <div class="container-fluid cart food-modal"> ... .modal ... </div>
 * Those wrappers were staying in document flow (~2px each × 280+ products)
 * and created a huge blank band under FAQs before the footer.
 * display:contents removes the wrapper from layout; the .modal stays portaled via BS.
 */
.container-fluid.food-modal,
.container-fluid.cart.food-modal,
.cart.food-modal {
    display: contents !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}
.menu-modal:not(.show) {
    display: none !important;
}

/* Wholesale product cards only (visible cards, not modal wrappers) */
.food-modal.border,
.food-modal.h-100 {
    display: flex !important;
    border-radius: var(--sp-radius-md) !important;
    border: 1px solid var(--sp-border) !important;
    box-shadow: var(--sp-shadow-sm);
    transition: transform 250ms var(--sp-ease), box-shadow 250ms var(--sp-ease);
    background: #fff;
}
.food-modal.border:hover,
.food-modal.h-100:hover {
    transform: translateY(-2px);
    box-shadow: var(--sp-shadow-md);
}
.food-modal.border img,
.food-modal.h-100 img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--sp-radius-sm);
}
.food-modal.border h5,
.food-modal.h-100 h5 {
    font-size: clamp(16px, 1.5vw, 18px);
    font-weight: 800;
}
@media (max-width: 767.98px) {
    .food-modal.border,
    .food-modal.h-100 {
        margin-bottom: 4px;
    }
}

/* Static policy / FAQ readability */
.section .container h1,
.section .container h2,
.section .container h3 {
    word-wrap: break-word;
}
.accordion-button {
    min-height: var(--sp-touch);
    font-size: clamp(14px, 2.5vw, 16px);
}

/* Menu grid: comfortable single column on narrow phones */
@media (max-width: 575.98px) {
    .cz-menu-page .row.g-4 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
@media (min-width: 576px) and (max-width: 767.98px) {
    .cz-menu-page .row.g-4 > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Sticky cart dropdown on small screens */
@media (max-width: 991.98px) {
    .carting-card.dropdown-menu {
        width: min(calc(100vw - 24px), 400px) !important;
        max-height: calc(100dvh - 24px);
    }
}

/* ── Spinner: do not leave a full-viewport flex layer when hidden ── */
#spinner:not(.show) {
    display: none !important;
    pointer-events: none !important;
}

/* ── Mobile sidebar (parity with desktop nav) ── */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 16px 28px !important;
    z-index: 1060 !important;
}
.sp-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 45, 135, 0.35);
}
.sp-sidebar-brand img {
    height: 42px;
    width: auto;
}
.sp-close-nav {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
}
.sidebar .sp-nav-link {
    min-height: 48px;
    border-radius: 10px;
    padding: 12px 8px !important;
}
.sidebar .sp-nav-link.active {
    color: var(--sp-pink) !important;
}
.sp-sidebar-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 45, 135, 0.35);
}
.sp-sidebar-search {
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
}
#sidenav-overlay {
    z-index: 1055 !important;
}

/* ── Modal close (X) standardization ── */
.modal .modal-content {
    position: relative;
}
.modal .btn-close,
.modal .sp-store-modal-close,
.menu-modal .time-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px !important;
    opacity: 1;
    left: auto !important;
}
.menu-modal .modal-content,
#time-Modal .modal-content,
#locationModal .modal-content,
#locationDescription .modal-content {
    position: relative !important;
}
.menu-modal .modal-footer,
#time-Modal .modal-footer,
#locationModal .modal-footer,
#locationDescription .modal-footer {
    /* allow close buttons to position against .modal-content, not the footer */
    position: static !important;
}
.menu-modal .time-modal-close,
#time-Modal .time-modal-close,
#locationModal .location-modal-close,
#locationModal .time-modal-close,
#locationDescription .time-modal-close,
#locationDescription .location-description-btn {
    /* Reposition footer close control to top-right of the modal panel */
    position: absolute !important;
    top: 10px;
    right: 10px;
    bottom: auto;
    left: auto !important;
    background: rgba(17, 17, 17, 0.72) !important;
    border: 0 !important;
    color: #fff !important;
    font-size: 22px !important;
    border-radius: 10px !important;
}
.modal .btn-close:hover,
.modal .sp-store-modal-close:hover,
.menu-modal .time-modal-close:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

/* Ensure Bootstrap modals stay within viewport */
.modal-dialog {
    width: min(calc(100vw - 24px), 100%);
    max-width: min(calc(100vw - 24px), 520px);
    margin: 12px auto;
}
.modal-dialog.modal-lg {
    max-width: min(calc(100vw - 24px), 720px);
}
.modal.show .modal-content {
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal.show .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
 * MOBILE / RESPONSIVE-ONLY FIXES (issues 1–10)
 * All rules below are scoped to max-width breakpoints.
 * Desktop (≥992px) must remain visually unchanged.
 * ========================================================= */

/* —— Shared tablet + phone (≤991.98px) —— */
@media (max-width: 991.98px) {
    /* 1. Cart badge — sit on the icon, not floating off the header edge */
    .sp-header-actions .fa-shopping-cart.header-icon,
    .sp-header-actions .fa-bell.header-icon {
        position: relative;
        overflow: visible;
    }
    .sp-header-actions .cart-counter,
    .sp-header-actions .bell-counter {
        top: -2px !important;
        right: -4px !important;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 10px;
        line-height: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 2. Shop Closed / Schedule Order — tighter, stacked, less vertical bloat */
    .sp-closed-bar {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px 16px !important;
        font-size: 13px;
        line-height: 1.35;
    }
    .sp-closed-bar form.d-inline {
        display: block !important;
        margin-left: 0 !important;
        width: 100%;
        max-width: 260px;
    }
    .sp-closed-bar .btn {
        width: 100%;
        min-height: 36px;
        padding: 6px 14px;
        font-size: 13px;
        font-weight: 700;
    }

    /* 3. Pick-up / Delivery segmented control — equal segments, readable */
    .del-pickup-container {
        justify-content: center !important;
        width: 100%;
    }
    .del-pickup-container .custom-pills {
        width: 100%;
        max-width: 100%;
    }
    .del-pickup-container .custom-pills .nav-item {
        flex: 1 1 0;
    }
    .del-pickup-container .custom-pills .nav-link {
        width: 100%;
        text-align: center;
        color: #111 !important;
        padding: 0.55rem 0.75rem;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .del-pickup-container + .tab-content,
    .col-lg-4 > .tab-content#pillsDelPickup {
        width: 100%;
    }
    .del-pickup-container + .tab-content .delivery-table {
        width: 100%;
    }

    /* 5–6. Menu category arrows + horizontal slider */
    .cz-cats-wrap {
        gap: 6px;
        width: 100%;
    }
    .cz-cats-track {
        min-width: 0;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        overscroll-behavior-x: contain;
    }
    .cz-cats .nav-item {
        scroll-snap-align: start;
    }
    .cz-cat-arrow {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        font-size: 20px !important;
        flex-shrink: 0;
    }
    .cz-cat {
        padding: 8px 14px !important;
        font-size: 13px !important;
        min-height: 36px;
    }

    /* Homepage menu tab arrows (outside .menu-tabs-container) */
    #menuContainer {
        gap: 8px;
    }
    #menuContainer .tab-scroll-btn,
    button.tab-scroll-btn.left,
    button.tab-scroll-btn.right {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
        min-height: 32px;
        font-size: 16px;
        flex-shrink: 0;
    }
    .menu-tabs-container .tab-scroll-btn {
        width: 34px !important;
        height: 34px !important;
    }
    .menu-tabs-wrapper {
        margin-top: 4px;
    }
    .menu-category-tabs .nav-link {
        padding: 10px 14px !important;
        font-size: 12px !important;
    }

    /* 7–9. Modal layering, scroll-lock, fit on small screens */
    body.modal-open {
        overflow: hidden !important;
        overscroll-behavior: none;
        width: 100%;
        /* iOS: prevent background rubber-band under open modal */
        position: fixed;
        left: 0;
        right: 0;
    }
    .modal,
    .menu-modal {
        z-index: 20010 !important;
    }
    .modal-backdrop {
        z-index: 20000 !important;
    }
    .menu-modal.show {
        padding: 10px 10px !important;
        align-items: center;
        justify-content: center;
    }
    .menu-modal .modal-dialog,
    .menu-modal .modal-dialog.modal-dialog-centered {
        width: calc(100% - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 20px) !important;
        margin: 0 auto !important;
    }
    .menu-modal .modal-content {
        max-height: calc(100dvh - 20px) !important;
        border-radius: 12px;
    }
    .menu-modal .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    .modal-dialog {
        width: min(calc(100vw - 16px), 100%);
        max-width: min(calc(100vw - 16px), 520px);
        margin: 10px auto;
    }
    .modal.show .modal-content {
        max-height: calc(100dvh - 20px);
    }

    /* 10. Spacing / alignment from mobile screenshots */
    .sp-section {
        padding-top: clamp(28px, 5vw, 44px);
        padding-bottom: clamp(28px, 5vw, 44px);
    }
    .sp-section-head {
        margin-bottom: clamp(18px, 3vw, 28px);
    }
    .sp-home-intro {
        padding-top: 8px;
    }
    .sp-premium-carousel .owl-nav {
        top: -44px;
    }
    .sp-premium-carousel .owl-nav .arrow-icon,
    .sp-premium-carousel .owl-nav button {
        width: 34px !important;
        height: 34px !important;
    }
}

/* —— Phone (≤767.98px) —— */
@media (max-width: 767.98px) {
    /* 1. Badge — also cover menu-page dark navbar cart if present */
    .navbar .d-lg-none .cart-counter,
    .navbar .sp-header-actions .cart-counter {
        top: -2px !important;
        right: -4px !important;
    }

    /* 4. Footer SignUp — high contrast on pink footer */
    .footer #signupButton {
        position: static !important;
        width: 100%;
        margin: 0 !important;
        min-height: 44px;
        background: #ffffff !important;
        color: #ff2d87 !important;
        border: 0 !important;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    }
    .footer .footer-email-box {
        padding-right: 1rem !important;
        margin-bottom: 0;
    }
    .footer .sp-footer-signup {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 100% !important;
    }

    /* 5–6. Slightly tighter category controls */
    .cz-cats-wrap {
        gap: 5px;
    }
    .cz-cat-arrow {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 18px !important;
    }

    /* 10. Homepage featured / menu stack spacing */
    #featured-items.sp-section {
        padding-bottom: clamp(20px, 4vw, 32px);
    }
    #menuContainer .w-100.d-flex {
        justify-content: flex-end !important;
        margin-top: 4px !important;
    }
}

/* —— Small phones (≤575.98px) —— */
@media (max-width: 575.98px) {
    .sp-closed-bar {
        padding: 8px 14px !important;
        font-size: 12px;
    }
    .del-pickup-container .custom-pills .nav-link {
        font-size: 13px;
        padding: 0.5rem 0.5rem;
    }
    .menu-modal img[alt="product-img"] {
        max-height: 200px !important;
    }
}
