/* Contact page on phones, shopping-app style (draft). Computers and tablets are unchanged. */
.shop-tabs, .shop-dock, .shop-close { display: none; }
.shop-shade[hidden] { display: none; }

@media (max-width: 760px) {
  /* Fewer words: the heading stays, the two paragraphs and the hint go */
  .shop-phone .enquiry-intro > div,
  .shop-phone .concern-hint,
  .shop-phone .concern-picker .concern-group-name { display: none !important; }
  .shop-phone .enquiry-by-picture .enquiry-intro h1 { font-size: clamp(34px, 9.5vw, 42px); }
  .shop-phone .concern-picker legend { font-size: 20px; margin-bottom: 4px; }

  /* Category bar, sticky under the site header */
  .shop-phone .shop-tabs {
    position: sticky; top: var(--header-offset, 89px); z-index: 5;
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px 14px; padding: 10px 16px;
    background: var(--paper, #FAF6F3);
    box-shadow: 0 1px 0 var(--rule, rgb(121 36 42 / .2));
    scroll-snap-type: x proximity;
  }
  .shop-phone .shop-tabs::-webkit-scrollbar { display: none; }
  .shop-tab {
    flex: none; scroll-snap-align: center;
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 40px; padding: 0 14px;
    border: 1px solid var(--rule, rgb(121 36 42 / .2)); border-radius: 999px;
    background: var(--white, #fff); color: var(--letter-ink, #79242A);
    font: 500 14px/1 var(--font-ui, Jost, Arial, sans-serif); white-space: nowrap; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
  }
  .shop-tab small {
    min-width: 20px; padding: 3px 6px; border-radius: 999px;
    background: rgb(121 36 42 / .08); font-size: 12px; font-weight: 500; text-align: center;
  }
  .shop-tab[aria-selected="true"] { background: var(--accent, #8A2A3D); border-color: var(--accent, #8A2A3D); color: #fff; }
  .shop-tab[aria-selected="true"] small { background: rgb(255 255 255 / .22); }
  .shop-tab:focus-visible { outline: 3px solid var(--letter-ink, #79242A); outline-offset: 2px; }

  /* Product-style grid: three small cards per row */
  .shop-phone .concern-group[hidden] { display: none; }
  .shop-phone .letter-world .concern-tiles,
  .shop-phone .concern-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .shop-phone .letter-world .enquiry-form .concern-tile,
  .shop-phone .concern-tile {
    gap: 7px; padding: 6px 6px 9px; border-radius: 14px;
    background: var(--white, #fff);
    box-shadow: 0 0 0 1px rgb(121 36 42 / .08), 0 6px 14px -10px rgb(51 48 51 / .4);
    animation: none;
  }
  .shop-phone .concern-picture { aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; outline: 0 !important; }
  .shop-phone .concern-picture img { width: 100%; height: 100%; object-fit: cover; opacity: 1 !important; filter: none !important; }
  .shop-phone .concern-name {
    padding: 0 3px; font-size: 13px; line-height: 1.28;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .shop-phone .concern-tile:has(input:checked) { box-shadow: 0 0 0 2px var(--accent, #8A2A3D), 0 8px 18px -10px rgb(121 36 42 / .55); }
  .shop-phone .concern-tile input:checked ~ .concern-name { color: var(--accent, #8A2A3D); font-weight: 500; }
  .shop-phone .concern-tile:active { scale: .97; }

  /* The form waits in a sheet */
  .shop-phone .enquiry-form { gap: 0; }
  html.shop-phone:not(.shop-sheet-open) .enquiry-card { display: none; }
  html.shop-sheet-open .enquiry-card {
    position: fixed; left: 0; right: 0; bottom: var(--shop-keyboard, 0px); z-index: 1001;
    max-height: min(66svh, calc(100svh - var(--shop-keyboard, 0px) - 24px)); overflow-y: auto; overscroll-behavior: contain;
    gap: 10px; margin: 0;
    padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 40px -18px rgb(51 48 51 / .45);
    animation: shop-sheet-up .42s cubic-bezier(.23, 1, .32, 1) both;
  }
  html.shop-sheet-open .enquiry-card .enquiry-lines,
  html.shop-sheet-open .enquiry-card .form-note { display: none; }
  html.shop-sheet-open .enquiry-chosen { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 0 44px 10px 0; }
  html.shop-sheet-open .enquiry-chosen img { width: 44px; aspect-ratio: 1; }
  html.shop-sheet-open .enquiry-chosen strong { font-size: 20px; }
  html.shop-sheet-open .enquiry-card legend { font-size: 18px; }
  .shop-phone .shop-close {
    display: none; position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 40px; height: 40px; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; background: rgb(121 36 42 / .07); color: var(--letter-ink, #79242A); cursor: pointer;
  }
  html.shop-sheet-open .shop-close { display: inline-flex; }
  .shop-shade {
    position: fixed; inset: 0; z-index: 1000; background: rgb(35 14 20 / .38);
    animation: shop-fade .3s ease-out both;
  }

  /* Bottom bar: a floating wine "basket" bar, lifted off the screen edge */
  .shop-phone .shop-dock {
    position: fixed; z-index: 900;
    left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: 560px; margin-inline: auto;
    display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 10px 10px 10px 10px;
    border-radius: 22px;
    background: var(--letter-ink, #79242A); color: #fff;
    box-shadow: 0 18px 36px -14px rgb(60 14 24 / .6), 0 4px 10px rgb(60 14 24 / .18);
    animation: shop-dock-in .5s cubic-bezier(.23, 1, .32, 1) .3s both;
  }
  .shop-dock img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; box-shadow: 0 0 0 2px rgb(255 255 255 / .9); }
  .shop-dock p { display: grid; gap: 2px; margin: 0; min-width: 0; }
  .shop-dock span { font: 500 11px/1.2 var(--font-ui, Jost, Arial, sans-serif); letter-spacing: .1em; text-transform: uppercase; color: rgb(255 255 255 / .72); }
  .shop-dock strong { font: 400 20px/1.15 var(--font-display, 'EB Garamond', Georgia, serif); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shop-next {
    min-height: 50px; padding: 0 24px; border: 0; border-radius: 16px;
    background: #fff; color: var(--letter-ink, #79242A);
    font: 600 16px/1 var(--font-ui, Jost, Arial, sans-serif); letter-spacing: .03em; cursor: pointer;
  }
  .shop-next::after { content: " \2192"; }
  .shop-next:active { scale: .97; }
  .shop-next:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
  html.shop-sheet-open .shop-dock { visibility: hidden; }

  /* Room for the bar at the foot of the page; the chat bubble steps aside here */
  html.shop-phone body { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  html.shop-phone .contact-bubble { display: none !important; }
}

@keyframes shop-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes shop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shop-dock-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html.shop-sheet-open .enquiry-card, .shop-shade, .shop-dock { animation: none !important; }
}
