/* App feel on phones and tablets (14 Nov 2026). No layout or colour changes to the pages themselves.
   Loaded after ux-20261114.css. Home-screen install is handled by manifest.json and the icons in this folder. */

/* Taps answer at once: no double-tap-to-zoom pause on controls (pinch zoom and scrolling still work). */
a,button,select,input,textarea,label,summary,[role=button]{touch-action:manipulation}

/* Pressing a button no longer selects its label or pops the text-selection handles. */
button,.ux-bar a,#mobile-menu a{-webkit-user-select:none;user-select:none}

/* Phone menu: each link is a full 44px row (was 20px of text with 24px dead gaps). Same look and height. */
@media (max-width:1023px){
  #mobile-menu{padding-top:20px;padding-bottom:20px}
  #mobile-menu>a{display:flex;align-items:center;min-height:44px;margin-top:0!important}
}

/* Touch screens have no hover, so show a brief pressed state instead. */
@media (hover:none){
  a:active,button:active,[role=button]:active{opacity:.78}
}

/* Opened from the home-screen icon: keep the page clear of the notch in landscape. */
@media (display-mode:standalone) and (orientation:landscape){
  body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
}

/* ───────── 15 Nov 2026: overlap and tidy-up fixes ───────── */

/* A photo that is still downloading shows a picture mark instead of a blank grey box. */
.dcard-img:has(img){background:#e9ecf1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3bccb' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='m21 15-5-5-8 8'/%3E%3C/svg%3E") center/44px no-repeat}

@media (max-width:767px){
  /* Chat button: lives in the right-hand slot of the pinned contact bar, on every page, so it can never
     sit on top of a car, a price or a button. It no longer floats, lifts or tucks away. */
  .ux-bar{grid-template-columns:1.7fr 1fr 48px}
  html[data-ux-bar] .ux-bar-all{display:none}
  html body{padding-bottom:64px;padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  html body #zara-fab,html[data-ux-bar] body #zara-fab,html body #zara-fab.za-away{right:12px!important;bottom:8px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;
    width:48px;height:48px;transform:none!important;opacity:1!important;pointer-events:auto!important;box-shadow:none;
    /* 15 Nov: no glide. The bar jumps instantly when the browser's toolbar shows or hides; the button must jump with it. */
    transition:none!important}
  /* Typing in a form: the bar and chat button step aside so the keyboard does not push them over the field. */
  body:has(input:not([type=checkbox]):not([type=radio]):focus,textarea:focus) .ux-bar,
  body:has(input:not([type=checkbox]):not([type=radio]):focus,textarea:focus) #zara-fab{display:none!important}

  /* Home page and "More vehicles": two cars per row, like the inventory (the home page was ~18 screens long). */
  html body .dgrid-4,html body .lux-similar .dgrid-3{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-body{padding:10px 10px 12px;gap:4px}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-title{font-size:14px;line-height:1.3;font-weight:600;letter-spacing:-.01em}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-sub{font-size:12px;margin-top:0}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-specs{display:block;border:0;padding:0;font-size:13px}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-specs>span{display:none}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-specs>span:nth-child(2){display:flex}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-price{padding-top:2px}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-price b{font-size:14px;line-height:1.3}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) :is(.dcard-go,.dcard-count,.dcard-price small){display:none}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .pill{top:6px;left:6px;font-size:11px;padding:3px 8px}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .price-reduced-badge{font-size:11px}

  /* Every two-per-row card lines up the same way: name (room for two lines), mileage, price, badge.
     Before, the price was pushed to the bottom and left uneven gaps in the shorter card of each pair. */
  /* 15 Nov (later): every grid reserves exactly two lines for the name (a longer name ends in "…" and is shown in
     full on the car's page), the mileage line keeps its height when a car has no mileage, and the
     "year · body · engine" line stays on one line. */
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .dcard-title{min-height:2.6em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .dcard-specs{min-height:1.65em}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .dcard-price{margin-top:0}
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .dcard-price>div{display:flex;flex-direction:column;align-items:flex-start;line-height:1.3}
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .dcard-price br{display:none}
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .price-reduced-badge{margin-top:5px}

  /* Filter drawer: no lone box with an empty space beside it. */
  .ux-filters.open>select[aria-label="Filter by body type"]:has(+select[style*="display: none"]+select[style*="display: none"]),
  .ux-filters.open>select[aria-label="Filter by transmission"]:not([style*="display: none"])+select[aria-label="Filter by fuel"]:not([style*="display: none"]){grid-column:1/-1}
}
@media (max-width:767px){
  /* An odd last car takes the full row instead of leaving an empty half. */
  html body :is(.dgrid-4,.lux-similar .dgrid-3)>a:nth-of-type(odd):last-of-type{grid-column:1/-1}
}
@media (max-width:359px){
  /* Smallest phones (iPhone SE 1st gen, 320 wide): slightly smaller card text so rows still line up,
     and the sort box gives its text room beside the arrow (font stays 16px so iPhone does not zoom in). */
  html body :is(.ux-inv-grid,.dgrid-4,.lux-similar .dgrid-3) .dcard-title{font-size:13px}
  html body :is(.dgrid-4,.lux-similar .dgrid-3) .dcard-sub{font-size:11px;letter-spacing:-.01em}
  html body .ux-filter-row select[aria-label="Sort vehicles"]{padding-left:10px;padding-right:6px}
}
@media (max-width:1199px){
  /* Showroom card: with the full hours format ("8:00 AM – 5:00 PM") the three columns no longer fit, so list them as rows. */
  html body .ng-showroom-hours{grid-template-columns:1fr;gap:0}
  html body .ng-showroom-hours>div{display:flex;justify-content:space-between;align-items:baseline;padding:7px 0}
  html body .ng-showroom-hours>div+div{border-left:0;padding-left:0;border-top:1px solid #ffffff1a}
  html body .ng-showroom-hours dt{font-size:12px;margin:0}
}
