/* ==========================================================================
   Secret Ingredient Baking - mobile-first layer (v1.1)
   Phones/tablets (<= 900px): bottom tab bar, compact header, list-style menu,
   tap-friendly cart + checkout. Desktop keeps the sidebar layout.
   ========================================================================== */

/* ---------- cart count + shared bits (all sizes) ---------- */
.sib-cart-count[data-n="0"] { }
.sib-tabbar { display: none; }
.sib-call { display: none; }
.sib-toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--color-ink); color: #fff; font-weight: 700; font-size: .9rem; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 2000; white-space: nowrap; }
.sib-toast.on { opacity: 1; transform: translate(-50%, 0); }

.sib-ctrl { display: inline-flex; align-items: center; }
.sib-add-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--color-gold); color: var(--color-ink); font-family: var(--font-display); font-weight: 700; text-decoration: none; }
.sib-add-btn:hover { background: var(--color-ink); color: #fff; text-decoration: none; }
.sib-stepper { display: inline-flex; align-items: center; background: var(--color-ink); color: #fff; border-radius: 999px; }
.sib-stepper button { width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 1.4rem; line-height: 1; border-radius: 50%; cursor: pointer; }
.sib-stepper button:hover { background: rgba(255,255,255,.18); }
.sib-stepper output { min-width: 26px; text-align: center; font-weight: 800; }
.sib-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.sib-row .product-price { margin: 0; }
.sib-unavailable { color: var(--color-plum); font-weight: 700; }

.sib-menu-head h1 { margin-bottom: .2em; }
.sib-menu-head p { color: var(--color-sage-deep); max-width: 58ch; margin: 0 auto 1.4em; }
.sib-menu-tools { position: sticky; top: 0; z-index: 30; background: var(--color-cream); padding: 10px 0 0; margin-bottom: 18px; box-shadow: 0 6px 10px -8px rgba(0,0,0,.25); }
.sib-search input { width: 100%; height: 48px; border-radius: 999px; border: 2px solid var(--color-ink); background: var(--color-white); padding: 0 18px; font-size: 1rem; margin-bottom: 8px; }
.sib-menu-tools .category-tabs { position: static !important; margin: 0 !important; padding: 0 0 12px !important; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.sib-menu-tools .category-tabs::-webkit-scrollbar { display: none; }
.category-tabs a { flex: none; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.sib-noresults { text-align: center; padding: 30px 0; color: var(--color-ink); }

/* order bar (menu + home) */
.sib-order-bar { background: var(--color-plum); color: #fff; border-radius: 18px; padding: 10px 10px 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.4); position: sticky; bottom: 14px; z-index: 40; margin-top: 18px; }
.sib-order-bar.is-empty { display: none; }
.sib-order-bar b { font-family: var(--font-display); display: block; }
.sib-order-bar small { display: block; color: var(--color-wheat); font-size: .8rem; }
.sib-order-bar .btn { min-height: 46px; padding: 0 20px; font-size: .95rem; }

/* cart page ([sib_cart]) */
.sib-cartcard { background: var(--color-white); border-radius: var(--radius-card); padding: 6px 18px 18px; box-shadow: var(--shadow-card); margin-bottom: 18px; }
.sib-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--color-cream); }
.sib-line-img img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.sib-line-info h3 { margin: 0; font-size: .98rem; text-transform: none; }
.sib-line-unit { font-size: .85rem; color: #6b5c50; }
.sib-line-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sib-line-total { font-family: var(--font-display); font-weight: 700; color: var(--color-plum); }
.sib-totals { padding-top: 14px; }
.sib-totals > div { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.sib-note { font-size: .88rem; color: #6b5c50; margin: 8px 0 0; }
.sib-cart .wc-proceed-to-checkout a.checkout-button { width: 100%; display: block; text-align: center; }
.sib-more { display: flex !important; width: 100%; margin-top: 10px; color: var(--color-plum-deep); }
.sib-empty { text-align: center; padding: 40px 10px; }
.sib-empty .btn { margin-top: 8px; }

/* checkout widgets (all sizes) */
.sib-fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.sib-fieldset legend { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 8px; }
.sib-dates { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.sib-dates::-webkit-scrollbar { display: none; }
.sib-date, .sib-win { position: relative; display: block; }
.sib-date input, .sib-win input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sib-date > span { flex: none; width: 64px; min-height: 76px; border-radius: 16px; border: 2px solid var(--color-ink); background: var(--color-white); display: flex; flex-direction: column; align-items: center; justify-content: center; scroll-snap-align: start; }
.sib-date { flex: none; }
.sib-date small { font-size: .72rem; font-weight: 800; color: #6b5c50; }
.sib-date b { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; }
.sib-date i { font-style: normal; font-size: .68rem; color: #6b5c50; }
.sib-date input:checked + span { background: var(--color-gold); border-color: var(--color-gold); }
.sib-date input:checked + span * { color: var(--color-ink); }
.sib-date input:focus-visible + span, .sib-win input:focus-visible + span { outline: 3px solid var(--color-plum); outline-offset: 2px; }
.sib-date.is-off > span { border-style: dashed; border-color: #cbbd9f; background: transparent; opacity: .5; }
.sib-date.is-off input { cursor: not-allowed; }
.sib-wins { display: grid; gap: 8px; }
.sib-win > span { display: flex; align-items: center; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--color-ink); background: var(--color-white); font-weight: 800; }
.sib-win input:checked + span { background: var(--color-sage-deep); border-color: var(--color-sage-deep); color: #fff; }
.sib-hide { display: none !important; }
.sib-zip-hint { display: block; font-size: .82rem; color: #6b5c50; margin-top: 4px; }

/* shipping choice as big Pickup / Delivery buttons */
.woocommerce ul#shipping_method { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.woocommerce ul#shipping_method li { position: relative; margin: 0; padding: 0; }
.woocommerce ul#shipping_method input.shipping_method { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.woocommerce ul#shipping_method label { display: block; margin: 0; min-height: 72px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--color-ink); background: var(--color-white); font-family: var(--font-display); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: .95rem; }
.woocommerce ul#shipping_method input:checked + label, .woocommerce ul#shipping_method input[type="hidden"] + label { background: var(--color-plum-deep); border-color: var(--color-plum-deep); color: #fff; }
.woocommerce ul#shipping_method input:focus-visible + label { outline: 3px solid var(--color-gold); outline-offset: 2px; }
.woocommerce ul#shipping_method li:only-child { grid-column: 1 / -1; }

/* payment methods as cards */
.woocommerce #payment ul.payment_methods li { border: 2px solid var(--color-ink); border-radius: 16px; background: var(--color-white); padding: 12px 14px; margin-bottom: 10px; }
.woocommerce #payment ul.payment_methods li:has(input:checked) { border-color: var(--color-plum); background: #fff6fa; }
.woocommerce #payment ul.payment_methods li label { display: inline; margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--font-display); font-size: 1rem; }
.woocommerce #payment ul.payment_methods li input[type="radio"] { width: 20px; height: 20px; margin-right: 8px; accent-color: var(--color-plum); }
.woocommerce #payment div.payment_box { background: var(--color-cream); }

/* confirmation page */
.sib-thanks { background: var(--color-white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); border-left: 6px solid var(--color-sage); padding: 20px; margin-bottom: 24px; }
.sib-thanks h2 { font-size: 1.4rem; text-transform: none; }
.sib-thanks-when { font-size: 1.1rem; }
.sib-thanks-cash { background: var(--color-cream); border-radius: 10px; padding: 10px 14px; }
.sib-thanks-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.sib-thanks-actions .btn { flex: 1 1 140px; }
.sib-infogrid, .sib-steps-wrap { max-width: var(--max-width); margin-left: auto; margin-right: auto; }
.sib-infogrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 24px 24px 0; }
.sib-infocard { background: var(--color-white); border-radius: 14px; padding: 14px 16px; box-shadow: 0 2px 0 var(--color-wheat); }
.sib-infocard h3 { margin: 0 0 2px; font-size: 1rem; }
.sib-infocard p { margin: 0; font-size: .88rem; color: #6b5c50; }
.sib-steps-wrap { padding: 20px 24px 0; }
.sib-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.sib-steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; background: var(--color-white); border-radius: 14px; padding: 14px 16px; }
.sib-steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--color-sage); color: #fff; font-family: var(--font-display); font-weight: 700; display: grid; place-items: center; }
.sib-steps b { display: block; font-family: var(--font-display); }
.sib-steps span { font-size: .9rem; color: #6b5c50; }

/* ==========================================================================
   Phones & tablets
   ========================================================================== */
@media (max-width: 900px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); font-size: 16px; }
  html { scroll-padding-top: 130px; }
  .sib-menu-tools { top: calc(60px + env(safe-area-inset-top)); }

  /* compact app-style header; the tab bar replaces the hamburger menu */
  .top-info-bar, .menu-toggle, .primary-navigation, .site-tagline { display: none !important; }
  .site-header { position: sticky; top: 0; }
  .site-header .container { padding: calc(8px + env(safe-area-inset-top)) 14px 8px; }
  .site-branding { flex: 1; min-width: 0; }
  .site-logo, .site-logo img, .site-branding .custom-logo { width: 44px; height: 44px; }
  .site-title { font-size: 1.05rem; line-height: 1.1; }
  .sib-call { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--color-gold); border-radius: 50%; flex: none; }
  .sib-call svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* bottom tab bar */
  .sib-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--color-white); border-top: 1px solid var(--color-wheat); box-shadow: 0 -6px 18px rgba(0,0,0,.08); }
  .sib-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; font-weight: 700; color: #6b5c50; text-decoration: none; }
  .sib-tab:hover { text-decoration: none; color: #6b5c50; }
  .sib-tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sib-tab[aria-current="page"] { color: var(--color-plum); }
  .sib-tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--color-plum); }
  .sib-tab .sib-cart-count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 19px; height: 19px; border-radius: 10px; background: var(--color-plum); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 5px; }
  .sib-tab .sib-cart-count[data-n="0"] { display: none; }

  /* order bar floats above the tab bar */
  .sib-order-bar { position: fixed; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom) + 10px); margin: 0; z-index: 800; }
  .sib-toast { bottom: calc(150px + env(safe-area-inset-bottom)); }

  .section { padding: 40px 0; }
  .container { padding: 0 16px; }
  h1 { font-size: 1.8rem; } h2 { font-size: 1.4rem; }

  /* hero */
  .hero { padding: 34px 0 36px; }
  .hero .container { grid-template-columns: 1fr; gap: 22px; }
  .hero-art { order: -1; max-width: 190px; padding: 10px; background: transparent; box-shadow: none; }
  .hero-art img { filter: drop-shadow(0 8px 18px rgba(0,0,0,.4)); border-radius: 0; }
  .hero-copy { text-align: center; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .sib-infogrid { padding: 16px 16px 0; }
  .sib-steps-wrap { padding: 10px 16px 0; }
  .site-footer { padding-bottom: 30px; margin-top: 30px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }

  /* weekly favorites become a swipeable rail */
  #homeFeatured.product-grid { display: flex !important; overflow-x: auto; gap: 12px; scroll-snap-type: x mandatory; padding: 4px 16px 10px; margin: 0 -16px; grid-auto-rows: unset; scrollbar-width: none; }
  #homeFeatured.product-grid::-webkit-scrollbar { display: none; }
  #homeFeatured .product-card { flex: 0 0 76%; max-width: 300px; scroll-snap-align: center; display: flex; flex-direction: column; }
  #homeFeatured .product-card-media { aspect-ratio: 4/3; width: 100%; height: auto; }

  /* checkout + cart: single column, comfy tap targets */
  .woocommerce form .form-row input.input-text, .woocommerce form .form-row select, .woocommerce form .form-row textarea { font-size: 16px; min-height: 48px; }
  .woocommerce-checkout form.checkout { display: block; }
  .woocommerce-checkout #order_review { margin-top: 18px; padding: 18px 16px; }
  .woocommerce-checkout #order_review_heading { display: none; }
  .woocommerce #payment .place-order { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 60; background: linear-gradient(rgba(251,243,227,0), var(--color-cream) 30%); padding: 22px 0 10px; margin: 0; }
  .woocommerce #place_order { box-shadow: 0 8px 22px rgba(166,49,110,.4); }
  .woocommerce table.shop_table_responsive tr td::before { font-weight: 700; }
  .woocommerce-message a.button, .woocommerce-info a.button { float: none; display: block; margin-top: 10px; text-align: center; }
  .woocommerce .col2-set { margin: 0; }
}

/* ---------- menu cards: list layout on phones ---------- */
@media (max-width: 640px) {
  .product-grid { display: block; }
  .product-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; border-radius: 0; box-shadow: none; border-top: 0 !important; border-bottom: 1px solid var(--color-wheat); background: transparent; padding: 12px 0; overflow: visible; }
  .product-card:hover { transform: none; box-shadow: none; }
  .product-card.is-special { box-shadow: none; background: linear-gradient(90deg, rgba(217,158,43,.16), transparent); }
  .product-card-media { aspect-ratio: 1/1; width: 96px; height: 96px; border-radius: 14px; }
  .product-card-body { padding: 0; min-width: 0; }
  .product-card-body h3 { font-size: 1rem; margin: 0 0 2px; }
  .product-card-body p { font-size: .84rem; margin: 0; flex: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .nutrition-hint { margin-top: 4px; background: none; padding: 6px 0; font-size: .8rem; text-transform: none; text-decoration: underline; text-underline-offset: 3px; letter-spacing: 0; }
  .sib-badge { position: static; display: inline-block; grid-column: 1 / -1; justify-self: start; margin-bottom: 4px; }
  .product-category-block { margin-bottom: 28px; }
  .product-category-block h2 { font-size: 1.15rem; margin-bottom: 8px; }
  #homeFeatured .product-card { display: flex; flex-direction: column; background: var(--color-white); border-radius: var(--radius-card); padding: 0; border-bottom: 0; box-shadow: var(--shadow-card); overflow: hidden; }
  #homeFeatured .product-card-media { width: 100%; height: auto; aspect-ratio: 4/3; border-radius: 0; }
  #homeFeatured .product-card-body { padding: 12px 14px 14px; }
  #homeFeatured .sib-badge { position: absolute; top: 10px; left: 10px; margin: 0; }

  /* nutrition facts become a bottom sheet */
  .nutrition-overlay { align-items: flex-end; padding: 0; }
  .nutrition-modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 88vh; animation: sibSheet .28s ease; padding-bottom: env(safe-area-inset-bottom); }
  .nutrition-modal-header { border-radius: 22px 22px 0 0; }
  @keyframes sibSheet { from { transform: translateY(100%); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .nutrition-modal { animation: none; } .sib-toast { transition: none; } }
