/* Shared storefront responsive corrections. Loaded last to resolve legacy CSS conflicts. */
.storefront-search { position: relative; }
.header-live-search { position: absolute; top: calc(100% + 7px); right: 0; left: 0; z-index: 1200; max-height: 430px; overflow-y: auto; border: 1px solid #dde4ed; border-radius: 10px; background: #fff; box-shadow: 0 16px 38px rgba(15, 29, 52, .18); }
.header-live-search[hidden] { display: none; }
.header-live-search > a { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 62px; padding: 8px 11px; color: #172138; border-bottom: 1px solid #edf1f5; }
.header-live-search > a:hover { background: #fff7f1; }
.header-live-search img, .header-live-search > a > span { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; }
.header-live-search > a > span { display: grid; color: #fff; background: #ff6900; place-items: center; }
.header-live-search strong, .header-live-search small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-live-search strong { font-size: 12px; }
.header-live-search small { margin-top: 3px; color: #7a879a; font-size: 10px; }
.header-live-search b { color: #ff6900; font-size: 11px; white-space: nowrap; }
.header-live-search .live-search-all { display: block; min-height: 0; padding: 11px; color: #ff6900; text-align: center; font-weight: 700; }
.live-search-loading, .live-search-empty { padding: 20px; color: #728098; text-align: center; font-size: 12px; }

@media (max-width: 991px) {
    .category-merchants-shell, .listing-shell, .catalog-shell, .merchant-list-shell { width: calc(100% - 28px) !important; }
    .restaurant-grid, .category-restaurant-grid, .merchants-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .fp-content-layout { grid-template-columns: minmax(0, 1fr) 300px !important; gap: 18px !important; }
    .fp-items, .fp-items-featured { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .fp-similar-list { overflow: hidden !important; }
}

@media (max-width: 767px) {
    /* `clip` prevents horizontal spill without turning the body into a nested
       scroll container, which would disable native sticky positioning. */
    html, body { max-width: 100%; overflow-x: clip; }
    img { max-width: 100%; }
    .container { max-width: none !important; }
    .storefront-topbar { min-height: 29px; }
    .storefront-topbar-inner { min-width: 0; font-size: 9px; }
    .storefront-header-inner { width: calc(100% - 24px) !important; }
    .storefront-search { height: 43px !important; }
    .header-live-search { position: absolute; top: calc(100% + 7px); right: 0; left: 0; max-height: min(430px, calc(100vh - 170px)); }
    .storefront-header-inner { position: relative; grid-template-columns: 130px minmax(0, 1fr) auto !important; }
    .storefront-actions { position: static !important; grid-column: 3 !important; grid-row: 1 !important; z-index: 3; display: flex !important; opacity: 1 !important; visibility: visible !important; }
    .storefront-actions a { display: inline-flex !important; color: #10182f !important; opacity: 1 !important; visibility: visible !important; }
    .storefront-brand { grid-column: 1 !important; grid-row: 1 !important; max-width: 130px; }
    .storefront-location { grid-column: 2 !important; grid-row: 1 !important; width: 100% !important; min-width: 0; height: 40px !important; padding: 0 9px !important; }
    .storefront-location span { min-width: 0; }
    .storefront-location strong, .storefront-location small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .storefront-search { grid-column: 1 / -1 !important; grid-row: 2 !important; }
  .storefront-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 7px;
}
    .storefront-tabs a { width: auto !important; min-width: 0 !important; text-align: center; white-space: normal; }

    .service-banner { display: flex !important; align-items: flex-start !important; flex-direction: column !important; flex-wrap: nowrap; }
    .service-banner > div { width: 100%; min-width: 0; flex: 1; }
    .service-banner button { position: static !important; align-self: flex-end; max-width: 100%; }
    .hero-slide { align-items: flex-end; }
    .hero-slide > div { max-width: 100%; }
    .hero h1 { max-width: 330px; font-size: 21px !important; overflow-wrap: anywhere; }
    .category-grid, .dynamic-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .restaurant-grid, .category-restaurant-grid, .merchants-grid { grid-template-columns: 1fr !important; }
    .restaurant-image { height: 175px !important; }
    .restaurant-footer { gap: 8px; }

    .category-merchants-page { padding-top: 16px !important; }
    .category-merchants-header { align-items: flex-start !important; flex-direction: column; gap: 14px; }
    .category-merchants-header > a { align-self: flex-end; }
    .category-merchant-breadcrumb { overflow-x: auto; }

    .listing-layout, .catalog-layout { grid-template-columns: 1fr !important; }
    .listing-sidebar { position: static !important; }
    .listing-grid, .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

    .fp-shell { width: calc(100% - 24px) !important; }
    .fp-profile { align-items: flex-start !important; gap: 13px !important; }
    .fp-restaurant-photo { width: 88px !important; height: 88px !important; flex-basis: 88px !important; }
    .fp-profile h1 { font-size: 22px !important; letter-spacing: 0 !important; overflow-wrap: anywhere; }
    .fp-profile-copy { width: calc(100% - 101px); overflow: hidden; }
    .fp-delivery-meta, .fp-rating-meta { max-width: 100%; white-space: normal !important; }
    /* Keep the menu/category strip pinned like the desktop layout while scrolling. */
    .fp-menu-toolbar { position: -webkit-sticky !important; position: sticky !important; top: 0 !important; z-index: 1100 !important; height: 58px !important; min-height: 58px !important; background: rgba(255,255,255,.98) !important; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
    .fp-toolbar-inner { width: 100% !important; height: 58px !important; min-height: 58px !important; padding: 0 10px; }
    .fp-menu-search { width: 180px !important; height: 36px !important; flex-basis: 180px !important; }
    .fp-menu-tabs { overflow-x: auto !important; scrollbar-width: none; }
    .fp-menu-tabs::-webkit-scrollbar { display: none; }
    .fp-menu-tabs a { min-width: 145px !important; padding: 20px 10px 16px !important; }
    .fp-content-layout { display: block !important; padding-top: 20px !important; }
    .fp-items, .fp-items-featured { grid-template-columns: 1fr !important; gap: 13px !important; }
  
    
    body.fp-mobile-cart-open { overflow: hidden; }
    .fp-cart { position: fixed !important; top: 0; right: 0; bottom: 0; z-index: 1600; display: flex !important; width: min(430px, 100%) !important; max-width: 100%; min-height: 100vh !important; margin: 0 !important; overflow-y: auto; border: 0 !important; border-radius: 0 !important; box-shadow: -10px 0 35px rgba(0,0,0,.18); transform: translateX(105%); transition: transform .25s ease; }
    .fp-cart.mobile-cart-open { transform: translateX(0); }
    .fp-cart-desktop-title { display: none; }
    .fp-cart-mobile-title, .fp-cart-close { display: block; }
    .fp-cart-close { width: 30px; height: 30px; border: 1px solid #ddd; border-radius: 50%; background: #fff; font-size: 16px; }
    .fp-mobile-order-mode { display: flex; gap: 3px; padding: 3px; margin: 20px 0 2px; border-radius: 9px; background: #f7f7f7; }
    .fp-mobile-order-mode button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; }
    .fp-mobile-order-mode button.active { border: 1px solid #d8dadd; background: #fff; }
    .fp-mobile-order-mode small { display: block; color: #666; font-size: 10px; }
    .fp-mobile-cart-backdrop { position: fixed; inset: 0; z-index: 1500; display: block; visibility: hidden; background: rgba(0,0,0,.48); opacity: 0; transition: opacity .25s, visibility .25s; }
    .fp-mobile-cart-backdrop.open { visibility: visible; opacity: 1; }
    .fp-mobile-cart-bar { position: fixed; right: 14px; bottom: 14px; left: 14px; z-index: 1400; display: none; grid-template-columns: 1fr 1fr 1fr; align-items: center; min-height: 58px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: #ff6900; box-shadow: 0 8px 22px rgba(0,0,0,.2); font-size: 14px; }
    .fp-mobile-cart-bar strong { text-align: center; }
    .fp-mobile-cart-bar > b:last-child { text-align: right; }
    .fp-mobile-cart-bar.has-items { display: grid; }
    .fp-cart-add-more { display: flex; gap: 10px; align-items: center; padding: 16px 2px; color: #242424; border-bottom: 1px solid #eee; }
    .fp-similar-list { overflow: hidden !important; }
    .fp-product-dialog { max-height: calc(100vh - 20px) !important; }
    .fp-dialog-image { height: 200px !important; }

    /* Keep the support bubble clear of product controls and the mobile cart bar. */
    .shop-details-page .floating-support { bottom: 84px; }

    .fp-checkout { padding-top: 22px !important; }
    .fp-checkout-shell { width: calc(100% - 24px) !important; }
    .fp-checkout-grid { grid-template-columns: 1fr !important; }
    .fp-checkout-summary { position: static !important; min-height: 0 !important; }

    .address-modal-backdrop { padding: 0 !important; }
    .address-modal { width: 100% !important; height: 100%; max-height: 100% !important; border-radius: 0 !important; }
    .map-panel { height: 250px !important; }

    .storefront-footer .footer-grid { width: calc(100% - 28px) !important; }
    .footer-social { max-width: none !important; }
    .footer-social a { flex: 0 0 37px; }
    .dynamic-content-page, .product-search-page { padding: 25px 0 45px !important; }
    .dynamic-content-page article, .product-search-shell { width: calc(100% - 24px) !important; }
}

@media (max-width: 479px) {
    .storefront-brand { min-width: 0; }
    .storefront-brand img { max-width: 118px !important; }
    .header-cart { margin-right: 4px; }
    .storefront-location span { min-width: 0; }
    .storefront-location strong, .storefront-location small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .category-grid, .dynamic-category-grid, .listing-grid, .catalog-grid { grid-template-columns: 1fr 1fr !important; gap: 9px !important; }
    .category-card { padding: 12px !important; }
    .category-card h3 { font-size: 12px !important; }
    .restaurant-footer { display: grid !important; grid-template-columns: 1fr 1fr; }
    .restaurant-footer a { grid-column: 1 / -1; text-align: center; }
    .fp-breadcrumb { gap: 8px !important; }
    .fp-profile { flex-direction: column; }
  .fp-restaurant-photo {
    width: 37% !important;
    height: 150px !important;
    flex-basis: 150px !important;
    border: 1px solid #ff5b00;
}
    .fp-profile-copy { width: 100%; }
    .fp-toolbar-inner { gap: 6px !important; }
    .fp-menu-search { width: 120px !important; flex-basis: 120px !important; padding: 0 11px !important; }
    .fp-menu-tabs a { min-width: 140px !important; padding-right: 10px !important; padding-left: 10px !important; }
    .fp-tabs-next { flex-basis: 34px !important; width: 34px !important; }
    .fp-product-copy h3 { white-space: normal !important; }
    .fp-cart-line { grid-template-columns: 44px minmax(0, 1fr); }
    .fp-cart-line > img, .fp-cart-image-placeholder { width: 44px !important; height: 44px !important; }
    .fp-cart-quantity { grid-column: 2; justify-self: end; margin-top: -30px; }
    .fp-checkout-fields.two-columns { grid-template-columns: 1fr !important; }
    .fp-checkout-address, .fp-checkout-summary { padding: 16px !important; }
    .fp-checkout-shell > h1 { font-size: 23px !important; }
    .address-modal-head { padding: 15px !important; }
    .address-modal-body { padding: 14px !important; }
    .use-current-location { max-width: 150px; }
    .storefront-footer .footer-grid { grid-template-columns: 1fr !important; }
    .product-search-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
    .product-search-grid { grid-template-columns: 1fr !important; }
}
