/* ============================================================
   YAISU — desktop layer. Loaded after app.css and css/*.css.
   Everything here lives inside the min-width media query.
   Contract shared by all desktop work:
     --wrap   : max content width, centered
     --gut    : horizontal page gutter (minimum side padding)
     --tbh    : topbar height on desktop (without border)
     --hdr    : sticky header height incl. border — sticky tops use calc(var(--hdr) + 24px)
     --edge   : side padding that centres --wrap inside a
                full-width block: padding-inline:var(--edge)
     --vsec   : vertical rhythm between home sections
   Owner: shell + marketing layout (topbar, search, home, footer,
   login, sent, toast). Catalog / product / selection live in
   desktop-pages.css.
   ============================================================ */
@media (min-width: 1024px) {
  :root {
    --wrap: 1280px; --gut: 40px; --tbh: 64px;
    --hdr: calc(var(--tbh) + 1px + env(safe-area-inset-top));
    --edge: max(var(--gut), calc((100vw - var(--wrap)) / 2));
    --vsec: clamp(72px, 6.4vw, 112px);
  }
  .app { max-width: none; }

  /* ---------- topbar: logo · categories · search field · price list · account · cart (one row, DOM order) ---------- */
  .topbar { height: var(--tbh); padding: env(safe-area-inset-top) var(--edge) 0; display: flex; align-items: center; gap: 28px; }
  .tb-menu, .tb-search, .search-close { display: none; }
  .topbar > .logo { flex: 0 0 auto; padding: 6px 0; font-size: 30px; }

  .desknav { display: flex; flex: 0 1 auto; min-width: 0; align-items: center; gap: 22px; }
  .desknav > a, .nav-more-btn { position: relative; height: 40px; display: flex; align-items: center; gap: 6px; font: 600 14px/1 var(--body); white-space: nowrap; color: var(--fg2); transition: color .15s ease; }
  .desknav > a[hidden], .nav-more[hidden], .nav-pop[hidden], .nav-pop > a[hidden] { display: none; }
  .desknav > a::after, .nav-more-btn::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
  .desknav > a[aria-current], .nav-more-btn.current { color: var(--fg); }
  .desknav > a[aria-current]::after, .nav-more-btn.current::after, .desknav > a:focus-visible::after { transform: none; }
  .nav-more { position: relative; }
  .nav-more-btn { padding: 0; background: none; border: 0; cursor: pointer; }
  .nav-more-btn::after { right: 18px; }
  .nav-pop { position: absolute; top: calc(100% + 12px); left: -16px; z-index: 5; min-width: 240px; padding: 8px 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
  .nav-pop > a { min-height: 44px; display: flex; align-items: center; padding: 0 18px; font: 600 14px/1.2 var(--body); color: var(--fg2); }
  .nav-pop > a[aria-current] { color: var(--fg); box-shadow: inset 2px 0 var(--red); }
  .nav-pop > a:focus-visible { outline-offset: -2px; }

  .tb-end { flex: 1 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 22px; }
  .searchbar { display: flex; position: relative; top: auto; left: auto; right: auto; bottom: auto; flex: 1 1 260px; min-width: 240px; max-width: 400px; height: 42px; padding: 0 12px; gap: 10px; background: var(--panel); border: 1px solid var(--ctl); transition: border-color .15s ease; }
  .searchbar:focus-within { border-color: var(--fg); }
  .searchbar:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
  .searchbar input:focus-visible { outline: none; }
  .s-ico { display: block; flex: 0 0 auto; color: var(--muted); }
  .searchbar input { height: 40px; padding: 0; border: 0; font-size: 15px; }
  .tb-link { display: flex; align-items: center; height: 40px; font: 600 14px/1 var(--body); white-space: nowrap; color: var(--fg2); transition: color .15s ease; }
  .tb-link[aria-current] { color: var(--fg); }
  /* language & currency switcher: a small "EN · $" button after the account link */
  .tb-pref { flex: 0 0 auto; height: 32px; padding: 0 10px; background: none; border: 1px solid var(--ctl); font: 500 13px/1 var(--mono); letter-spacing: .04em; cursor: pointer; }
  .tb-cart { flex: 0 0 auto; gap: 10px; height: 40px; font: 600 14px/1 var(--body); white-space: nowrap; transition: color .15s ease; }
  .tb-cart .badge { display: none; }
  .cart-lbl { display: inline; }

  /* overlay menu is a phone pattern: never shown on desktop (burger is hidden) */
  .menu { display: none; }

  /* language & currency dialog: centered 420px card */
  .pd { align-items: center; padding: 24px; }
  .pd-card { max-width: 420px; padding: 28px; gap: 18px; border: 1px solid var(--line2); box-shadow: 0 24px 64px rgba(0, 0, 0, .6); }

  .toast { top: auto; left: auto; right: 24px; bottom: calc(16px + env(safe-area-inset-bottom) + var(--toast-lift, 0px)); width: 360px; max-width: calc(100vw - 48px); margin: 0; transform: translateY(8px); }

  /* ---------- home: hero (copy left, photo bleeding right), ≤ 70vh ---------- */
  .hero { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: min(70vh, 760px); }
  .hero-img { grid-area: 1 / 2; height: auto; }
  .hero-img img { object-position: center 18% !important; }
  /* scrim (no text-shadow): solid at the seam, fading into the photo under the overlapping headline */
  .hero .scrim { top: 0; bottom: 0; left: -1px; right: auto; width: 42%; height: auto; background: linear-gradient(to right, var(--bg) 0, rgba(11, 11, 11, .72) 40%, rgba(11, 11, 11, 0)); }
  .hero-copy { grid-area: 1 / 1; margin: 0; padding: 32px 0 40px var(--edge); justify-content: flex-end; gap: 20px; z-index: 1; }
  .hero-copy h1 { font-size: clamp(64px, min(9.6vw, 13vh), 160px); line-height: .94; letter-spacing: .01em; width: max-content; max-width: none; white-space: nowrap; }
  .hero-copy p { max-width: 460px; font-size: 17px; }
  .hero-copy .grid2 { grid-template-columns: repeat(2, minmax(0, 224px)); gap: 12px; }

  /* ---------- home: category grid — 3 columns of ≤ 480px cards ---------- */
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 var(--edge); margin-top: var(--vsec); }
  .cat-grid .cat { height: clamp(420px, 34vw, 480px); }
  .cat-grid .scrim { height: 62%; }
  .cat-grid .cat-copy { left: 24px; right: 24px; bottom: 24px; gap: 16px; }
  .cat-grid .cat-copy h2 { font-size: clamp(48px, 4.4vw, 72px); line-height: .88; }
  .cat-grid .cat-meta { padding-top: 14px; }
  .cat-grid .cat-meta .textlink { display: inline-flex; }

  /* ---------- footer: word | catalog | shop | help, fine print below ---------- */
  .foot { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); column-gap: 40px; row-gap: 56px; padding: 80px var(--edge) 40px; align-items: start; overflow: hidden; }
  .foot .cols { display: contents; }
  .foot nav:nth-of-type(1) { grid-area: 1 / 2; }
  .foot nav:nth-of-type(2) { grid-area: 1 / 3; }
  .foot nav:nth-of-type(3) { grid-area: 1 / 4; }
  .foot nav a, .foot-pref { min-height: 36px; }
  .foot .word { grid-area: 1 / 1; align-self: start; font-size: clamp(120px, 11vw, 180px); margin: -0.02em 0 0 -0.03em; }
  .foot .fine { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid rgba(11, 11, 11, .16); }

  /* ---------- login: photo panel | form panel ---------- */
  .login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-bg { position: relative; grid-area: 1 / 1; height: auto; border-right: 1px solid var(--line); }
  .login-bg img { position: absolute; inset: 0; object-position: center 22%; }
  .login-bg .scrim { display: none; }
  .login-body { grid-area: 1 / 2; justify-self: center; justify-content: center; width: 100%; max-width: calc(420px + 2 * var(--gut)); margin: 0; padding: 64px var(--gut); gap: 20px; }
  .login-body .word { font-size: clamp(112px, 9vw, 160px); }
  .login-body > p { margin-top: 12px !important; text-align: left !important; }

  /* ---------- sent: photo panel | confirmation ---------- */
  .view > section:has(> .sent-ph) { position: relative; min-height: calc(100vh - var(--hdr)); justify-content: center; padding: 40px var(--edge) 40px calc(50% + 80px) !important; }
  .view > section:has(> .sent-ph) > :not(.sent-ph) { max-width: 460px; }
  .view > section:has(> .sent-ph) > h1 { font-size: clamp(80px, 7.2vw, 120px) !important; }
  .view > section:has(> .sent-ph) > .btn { width: auto; align-self: flex-start; padding: 0 40px; }
  .sent-ph { display: block; position: absolute; top: 0; bottom: 0; left: 0; width: 50%; overflow: hidden; border-right: 1px solid var(--line); }
  .sent-ph img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }

  /* ---------- hover (pointer devices only); button hovers live in app.css ---------- */
  @media (hover: hover) {
    .desknav > a:hover, .nav-more-btn:hover, .tb-link:hover, .nav-pop > a:hover { color: var(--fg); }
    .desknav > a:hover::after { transform: none; }
    .tb-cart:hover, .topbar > .logo:hover { color: var(--red); }
    .tb-pref:hover { border-color: var(--fg); }
    .searchbar:hover:not(:focus-within) { border-color: var(--fg2); }
    .cat-img img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
    .cat:hover .cat-img img { transform: scale(1.04); }
    .cat .textlink { transition: color .15s ease; }
    .cat:hover .textlink { color: var(--red); }
    .foot nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
  }
}

/* 1024–1279: a narrower search field keeps one or two more categories inline instead of under "More" */
@media (min-width: 1024px) and (max-width: 1279px) {
  .searchbar { flex-basis: 200px; min-width: 180px; max-width: 260px; }
}
