/* Phone and tablet layer (Nov 2026). Loaded after customer.css; reuses brand.css tokens.
   Desktop (> 1000px) is unchanged except where noted. */

:root { --action-bar-h: 0px; }

/* Header cart shortcut: visible whenever the desktop nav is hidden */
.header-actions { display: none; align-items: center; gap: 10px; }
.header-cart { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: .85rem; font-weight: 650; text-decoration: none; }
.header-cart:hover { background: var(--soft); }
.header-cart b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--blue); color: #fff; font-size: .75rem; }
.header-cart b.empty { background: var(--soft); color: var(--muted); }
@media (max-width: 800px) {
  .header-actions { display: flex; }
  .header-actions .mobile-menu { display: block; }
}
@media (max-width: 340px) {
  .header-cart .header-cart-label { display: none; }
  .header-cart, .mobile-menu summary { padding: 10px 12px; }
}

/* Phone numbers never break across lines */
a[href^="tel:"] { white-space: nowrap; }

/* Tablets: two equipment cards per row instead of one narrow column */
@media (min-width: 561px) and (max-width: 1000px) {
  .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .equipment-grid > .empty-state { grid-column: 1 / -1; }
  .catalog-search { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
  .catalog-search > button { grid-column: 1 / -1; }
}

/* Touch screens: comfortable tap targets for small text links */
@media (pointer: coarse), (max-width: 800px) {
  .footer-grid a { display: flex; align-items: center; min-height: 44px; margin-bottom: 0; font-size: .9rem; }
  .footer-grid p { font-size: .9rem; }
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .cart-heading > a, .cart-item-actions a, .cart-item-actions button,
  .calendar-actions .text-button, .checkout-summary a { display: inline-flex; align-items: center; min-height: 44px; }
  .cart-price-details summary { min-height: 44px; display: flex; align-items: center; }
  .text-link { display: inline-flex; align-items: center; min-height: 44px; }
}
/* Tablet landscape keeps the desktop nav; make its links finger-sized */
@media (pointer: coarse) and (min-width: 801px) {
  .desktop-nav > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Forms: no zoom on focus, readable textarea text */
.rental-page textarea, .customer-details textarea { font-family: inherit; line-height: 1.45; }
@media (max-width: 800px) {
  .rental-page input:not([type=checkbox]):not([type=radio]), .rental-page select, .rental-page textarea,
  .catalog-search input, .catalog-search select { font-size: 16px; }
}

/* Phones: primary buttons span the width */
@media (max-width: 560px) {
  .booking-panel .button, .rental-page .form-actions .button, .cart-empty .button,
  #rental-form > button[type=submit], .narrow-form .button { width: 100%; }
  .rental-page .form-actions { flex-direction: column; align-items: stretch; }
  .rental-page .form-actions .action-note { text-align: center; }
  .detail-heading h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); overflow-wrap: anywhere; }
  .rental-page h1 { font-size: clamp(1.6rem, 7.5vw, 2.2rem); }
}

/* Sticky action bar: the next step stays in reach on phones and tablets */
.action-bar { display: none; }
@media (max-width: 900px) {
  .action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
    padding: 12px max(16px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px #0022661a; }
  .action-bar-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .action-bar-info small { color: var(--muted); font-size: .75rem; }
  .action-bar-info strong { color: var(--navy); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
  .action-bar .button { flex: 1; min-height: 50px; margin: 0; white-space: nowrap; }
  body.has-action-bar { --action-bar-h: 76px; padding-bottom: calc(var(--action-bar-h) + env(safe-area-inset-bottom)); }
  /* The in-flow button is redundant once the bar is showing */
  body.has-action-bar .action-bar-source { display: none; }
}
@media (max-width: 900px) and (min-width: 561px) {
  .action-bar { justify-content: flex-end; padding-left: 32px; padding-right: 32px; }
  .action-bar .button { flex: 0 1 320px; }
  .action-bar-info { margin-right: auto; }
}

/* Tablet portrait: equipment detail keeps photo and price side by side */
@media (min-width: 700px) and (max-width: 900px) {
  .detail-layout { grid-template-columns: 1.1fr 1fr; grid-template-areas: "media panel" "about about"; }
  .detail-layout > .booking-panel { position: static; }
}

/* Tablet: cart summary beside items from 700px */
@media (min-width: 700px) and (max-width: 800px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

/* Calendar dates: square, easy-to-hit cells */
@media (max-width: 560px) {
  .calendar-dates { gap: 4px; }
  .calendar-date { min-height: 44px; }
}

/* Promo code: stack field and button wherever the summary column is narrow */
@media (max-width: 1000px) {
  .rental-cart .cart-promo-row { flex-wrap: wrap; }
  .rental-cart .cart-promo-row input, .rental-cart .cart-promo-row button { flex: 1 1 100%; min-height: 48px; }
}

/* Ask AI chat */
.ask-ai { --ask-gap: 16px; }
.ask-ai-launch { position: fixed; right: max(var(--ask-gap), env(safe-area-inset-right)); bottom: calc(var(--action-bar-h) + var(--ask-gap) + env(safe-area-inset-bottom));
  z-index: 45; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; font: inherit; font-size: .9rem; font-weight: 650; box-shadow: 0 8px 24px #00226640; cursor: pointer; }
.ask-ai-launch:hover { background: var(--blue); }
.ask-ai-launch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ask-ai.is-open .ask-ai-launch { display: none; }
.ask-ai-panel { position: fixed; right: var(--ask-gap); bottom: calc(var(--action-bar-h) + var(--ask-gap)); z-index: 60;
  display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100dvh - var(--action-bar-h) - 40px));
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 8px; box-shadow: 0 18px 50px #00226633; overflow: hidden; }
.ask-ai-panel[hidden] { display: none; }
.ask-ai-head { display: flex; align-items: flex-start; gap: 6px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.ask-ai-head > div { flex: 1; min-width: 0; }
.ask-ai-head h2 { margin: 0; font-size: 1.05rem; color: var(--navy); }
.ask-ai-disclaimer { margin: 4px 0 0; font-size: .78rem; line-height: 1.35; color: var(--muted); }
.ask-ai-head button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.ask-ai-head button:hover { background: var(--soft); color: var(--ink); }
.ask-ai-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--soft); }
.ask-ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 8px; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.ask-ai-msg p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
.ask-ai-msg p + p { margin-top: 8px; }
.ask-ai-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.ask-ai-user { align-self: flex-end; background: var(--blue); color: #fff; }
.ask-ai-wait { color: var(--muted); font-style: italic; }
.ask-ai-error { border-color: #e7b4ae; background: #fff8f7; color: #8a1f17; }
.ask-ai-sources { margin: 8px 0 0; padding: 8px 0 0 18px; border-top: 1px solid var(--line); font-size: .8rem; }
.ask-ai-sources a { color: var(--blue); }
.ask-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-ai-chips button { min-height: 40px; padding: 8px 12px; border: 1.5px solid #b9c6ea; border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-size: .85rem; font-weight: 600; text-align: left; cursor: pointer; }
.ask-ai-chips button:hover { border-color: var(--blue); }
.ask-ai-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.ask-ai-form textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 11px 12px; border: 1.5px solid #b8c2d6; border-radius: 6px; font: inherit; font-size: 16px; line-height: 1.4; resize: none; }
.ask-ai-form textarea:focus { border-color: var(--blue); outline: 3px solid #204ce533; outline-offset: 0; }
.ask-ai-send { flex: none; width: 46px; height: 46px; border: 0; border-radius: 6px; background: var(--blue); color: #fff; font-size: 1.1rem; cursor: pointer; }
.ask-ai-send:disabled { background: #9aa8c7; cursor: default; }
/* Phones: bottom sheet over the page */
@media (max-width: 560px) {
  .ask-ai-launch { padding: 0 16px; }
  .ask-ai-panel { left: 0; right: 0; bottom: 0; width: 100%; height: min(88dvh, 640px); border-radius: 14px 14px 0 0; border-left: 0; border-right: 0; z-index: 60; }
  html.ask-ai-sheet-open { overflow: hidden; }
}
@media print { .ask-ai, .action-bar { display: none !important; } }
