/* Functional foundation only. The unlayered Batavia styles own visual design. */
@layer foundation {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body { margin: 0; }
  h1, h2, h3, h4, h5, h6, p, figure { margin: 0; }
  a { color: inherit; text-decoration: none; }
  button, input, select, textarea { color: inherit; font: inherit; }
  button { cursor: pointer; border: 0; background: none; }
  button:disabled { cursor: not-allowed; opacity: .45; }
  img { display: block; max-width: 100%; }
  svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.35; }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  :focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
  :where(#app, #app h1, .outfit-section h2)[tabindex="-1"]:focus { outline: none; }
  [hidden] { display: none; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .icon-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; }
  .price-current { white-space: nowrap; }
  .price s, .product-detail-price s { white-space: nowrap; text-decoration-thickness: 1px; }

  /* Dialog surfaces used by the existing accessible focus and inert handlers. */
  .overlay { position: fixed; inset: 0; z-index: 100; isolation: isolate; }
  .overlay.closing { pointer-events: none; }
  .overlay-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgb(0 0 0 / .4); }
  .panel { position: absolute; inset: 0 0 0 auto; width: 560px; max-width: 100%; padding: 74px 40px 36px; overflow: auto; overscroll-behavior: contain; background: #fff; color: #111; }
  .panel-close { position: absolute; top: 18px; right: 20px; z-index: 4; width: 44px; height: 44px; padding: 10px; background: #fff; }
  .panel > .eyebrow { margin-bottom: 18px; font-size: 11px; letter-spacing: .08em; color: #777; }
  .panel > h2 { margin-bottom: 32px; line-height: 1.15; }
  .panel > h2 small { font-size: 14px; font-family: var(--font, sans-serif); }
  .panel.menu-panel { left: 0; right: auto; width: 660px; padding-top: 88px; }
  .menu-wordmark { position: absolute; top: 30px; left: 36px; width: 187px; }
  .menu-wordmark img { width: 100%; height: auto; filter: invert(1); }
  .menu-search { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .menu-search svg { flex: 0 0 20px; width: 20px; height: 20px; }

  /* The cart is a local preview and continues to use the existing event handlers. */
  .cart-item { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 22px; border-top: 1px solid var(--line, #ddd); padding: 22px 0; }
  .cart-item > a > img { width: 100px; height: 135px; object-fit: cover; background: var(--stone, #eee); }
  .cart-item > div > a { font-size: 14px; line-height: 1.5; }
  .cart-item p { margin-top: 9px; font-size: 12px; color: #777; }
  .cart-item p.price { font-size: 15px; color: #111; }
  .cart-item .price s { margin-left: 8px; color: #888; font-size: 12px; }
  .quantity { display: flex; align-items: center; gap: 12px; margin-top: 13px; font-size: 14px; }
  .quantity > button { min-width: 32px; min-height: 36px; padding: 3px; }
  .quantity .remove { min-width: 0; margin-left: auto; padding: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
  .cart-total { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line, #ddd); margin-top: 20px; padding: 25px 0; font-size: 18px; }
  .cart-preview-note { margin-bottom: 25px; font-size: 12px; line-height: 1.8; color: #777; }
  .cart-panel > .button { width: 100%; }
  .cart-empty { text-align: center; padding-top: 65px; }
  .cart-empty > svg { margin: 0 auto 30px; width: 35px; height: 35px; }
  .cart-empty > p { margin-bottom: 35px; font-size: 28px; line-height: 1.3; }

  /* Search and category selection dialogs. */
  .search-panel { width: 650px; }
  .search-panel form { display: flex; border-bottom: 1px solid #111; margin-bottom: 35px; }
  .search-panel input { min-width: 0; width: 100%; padding: 15px 0; border: 0; border-radius: 0; background: none; font-size: 17px; }
  .search-panel form button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; }
  .search-result { display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line, #ddd); padding: 20px 0; font-size: 14px; }
  .search-result img { flex: 0 0 68px; width: 68px; height: 87px; object-fit: cover; background: var(--stone, #eee); }
  .search-result > span { min-width: 0; flex: 1; line-height: 1.5; }
  .search-result small { display: block; margin-top: 9px; color: #777; }
  .search-result .price s { margin-left: 7px; font-size: 12px; }
  #search-results > .eyebrow { font-size: 11px; }
  #search-results > .text-link { display: inline-block; margin-top: 28px; }
  .search-suggestions { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 25px; font-size: 25px; }
  .filter-nav > a { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line, #ddd); }
  .filter-nav > a > span { color: #777; font-size: 12px; }

  /* Image zoom and the size guide are independent of the page layout. */
  .zoom-panel { width: 100%; padding: 30px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; }
  .zoom-panel > img { max-width: 100%; max-height: calc(100svh - 60px); width: auto; height: auto; object-fit: contain; }
  .size-panel { width: 700px; }
  .size-panel img { width: 100%; height: auto; }
  .size-panel .rich-copy { font-size: 14px; line-height: 1.8; }
  .size-panel .rich-copy p { margin-bottom: 20px; }
  .table-wrap { width: 100%; overflow-x: auto; }
  .size-table { width: 100%; margin: 15px 0 30px; border-collapse: collapse; text-align: left; font-size: 13px; }
  .size-table caption { margin-bottom: 18px; text-align: left; font-size: 11px; color: #777; }
  .size-table th, .size-table td { padding: 18px 13px; border-bottom: 1px solid var(--line, #ddd); white-space: nowrap; font-weight: 400; }
  .size-table thead { background: var(--stone, #f5f5f5); }

  /* Structural gallery controls, without a product-page grid or sticky offsets. */
  .product-gallery { min-width: 0; width: 100%; display: grid; gap: 14px; }
  .gallery-stage { position: relative; width: 100%; aspect-ratio: 2 / 3; touch-action: pan-y; background: var(--stone, #eee); }
  .gallery-photo { position: relative; display: block; padding: 0; overflow: hidden; cursor: zoom-in; }
  .gallery-stage > .gallery-photo { width: 100%; height: 100%; }
  .gallery-stage .gallery-photo > img { width: 100%; height: 100%; object-fit: contain; }
  .gallery-photo > span { position: absolute; right: 14px; bottom: 13px; font-size: 23px; line-height: 1; }
  .gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 48px; padding: 0; background: #fff; color: #111; font-size: 28px; line-height: 1; }
  .gallery-prev { left: 12px; }
  .gallery-next { right: 12px; }
  .gallery-caption-row { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; line-height: 1.6; color: #777; }
  #gallery-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .gallery-thumbnails { min-width: 0; display: flex; gap: 10px; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: thin; }
  .gallery-thumbnail { flex: 0 0 64px; width: 64px; height: 86px; padding: 0; background: var(--stone, #eee); border: 1px solid transparent; opacity: .6; }
  .gallery-thumbnail[aria-pressed="true"] { border-color: #111; opacity: 1; }
  .gallery-thumbnail:hover { opacity: 1; }
  .gallery-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
  .gallery-thumbnail.isolated img { object-fit: contain; }
  .outfit-trigger { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 18px; max-width: calc(100% - 64px); min-height: 42px; padding: 10px 14px; background: #fff; color: #111; font-size: 12px; }
  .outfit-section { scroll-margin-top: 90px; }

  /* Required product selection states, with page spacing owned by interiors.css. */
  .size-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
  .subtle-link { padding: 0; text-decoration: underline; text-underline-offset: 4px; }
  .sizes { display: flex; flex-wrap: wrap; gap: 9px; }
  .sizes button { min-width: 54px; min-height: 46px; padding: 10px; border: 1px solid var(--line, #ddd); }
  .sizes button.selected, .sizes button[aria-pressed="true"] { background: #111; color: #fff; border-color: #111; }
  .field-error { min-height: 16px; color: #9a3a2c; font-size: 12px; }
  .product-details details { border-top: 1px solid var(--line, #ddd); }
  .product-details details:last-child { border-bottom: 1px solid var(--line, #ddd); }
  .product-details summary { display: flex; justify-content: space-between; gap: 20px; padding: 21px 0; cursor: pointer; list-style: none; }
  .product-details summary::-webkit-details-marker { display: none; }
  .product-details details[open] summary span { transform: rotate(45deg); }
  .product-details details > div { padding-bottom: 22px; line-height: 1.8; }
  .product-details details > div p { white-space: pre-line; }

  /* Scoping keeps fallback content rules out of the new page layouts. */
  :where(.info-layout) { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 70px; max-width: 1280px; margin: 0 auto; padding: 0 40px 80px; }
  :where(.info-layout > nav) { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; font-size: 13px; }
  :where(.info-layout > nav > a.active) { text-decoration: underline; text-underline-offset: 5px; }
  :where(.info-layout .rich-copy, .article .rich-copy, .size-panel .rich-copy) { line-height: 1.8; overflow-wrap: anywhere; }
  :where(.info-layout .rich-copy p, .article .rich-copy p) { margin-bottom: 22px; white-space: pre-line; }
  :where(.info-layout .rich-copy img, .article .rich-copy img) { width: auto; height: auto; margin: 25px 0; }
  :where(.article) { max-width: 1280px; margin: 0 auto; padding: 0 40px 80px; }
  :where(.article .rich-copy) { max-width: 780px; margin: 0 auto; }
  :where(.article-image) { width: 100%; height: auto; margin-bottom: 40px; }
  :where(.article-video) { width: 100%; aspect-ratio: 16 / 9; border: 0; margin: 20px 0 35px; }
  :where(.runway-gallery, .people-gallery) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; padding: 0 40px 80px; }
  :where(.runway-gallery .gallery-photo, .people-gallery .gallery-photo) { width: 100%; aspect-ratio: 2 / 3; }
  :where(.runway-gallery .gallery-photo img, .people-gallery .gallery-photo img) { width: 100%; height: 100%; object-fit: cover; }
  :where(.people-gallery h2) { margin-top: 16px; }
  :where(.gallery-caption) { margin: 0 20px 60px; text-align: center; font-size: 12px; color: #777; }
  :where(.service-list) { max-width: 1280px; margin: 0 auto; padding: 0 40px 80px; }
  :where(.service-list article) { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8%; padding: 40px 0; border-top: 1px solid var(--line, #ddd); }
  :where(.service-list article p) { line-height: 1.8; white-space: pre-line; margin-bottom: 20px; }
  :where(.empty) { padding: 80px 20px; text-align: center; }
  :where(.empty p, .empty h1, .empty h2) { margin-bottom: 24px; }

  .toast { position: fixed; left: 50%; bottom: 25px; z-index: 150; max-width: calc(100vw - 40px); padding: 17px 28px; transform: translate(-50%, 20px); background: #111; color: #fff; opacity: 0; pointer-events: none; font-size: 14px; }
  .toast.visible { opacity: 1; transform: translate(-50%, 0); }

  @media (max-width: 720px) {
    .panel { padding: 74px 24px 30px; }
    .panel.menu-panel { width: 100%; padding: 85px 23px 30px; }
    .menu-wordmark { left: 23px; top: 27px; width: 170px; }
    .panel-close { right: 13px; top: 15px; }
    .cart-item { grid-template-columns: 86px minmax(0, 1fr); gap: 17px; }
    .cart-item > a > img { width: 86px; height: 120px; }
    .quantity { gap: 8px; }
    .zoom-panel { padding: 15px; }
    .zoom-panel > img { max-height: 90svh; }
    .size-table { font-size: 11px; }
    .size-table th, .size-table td { padding: 15px 8px; }
    :where(.info-layout) { grid-template-columns: 1fr; gap: 35px; padding: 0 20px 60px; }
    :where(.info-layout > nav) { flex-direction: row; gap: 18px; overflow: auto; white-space: nowrap; padding-bottom: 15px; }
    :where(.article) { padding: 0 20px 60px; }
    :where(.runway-gallery, .people-gallery) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; padding: 0 20px 60px; }
    :where(.service-list) { padding: 0 20px 60px; }
    :where(.service-list article) { grid-template-columns: 1fr; gap: 24px; }
  }
}

/* A quiet first-load state keeps slow mobile connections from showing an empty page. */
.initial-loading{display:grid;place-content:center;justify-items:center;gap:18px;min-height:70svh;padding:80px 24px;color:#666;text-align:center;font:400 14px/1.5 var(--font,Arial,sans-serif)}
.initial-loading>span{width:28px;height:28px;border:1px solid #ddd;border-top-color:#222;border-radius:50%;animation:initial-loading-spin 900ms linear infinite}
@keyframes initial-loading-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.initial-loading>span{animation:none}}
