/* ============================================================
   DE VATCHI — layout.css
   Header, footer, drawer, search, menu, toasts, modal,
   cursor, preloader and route veil.
   ============================================================ */

/* ---------- header ---------- */
#site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--red); color: var(--cream);
  transition: transform .45s var(--ease), box-shadow .3s, background .4s;
}
#site-header.hidden { transform: translateY(-100%); }
#site-header.scrolled { box-shadow: 0 14px 34px -14px rgba(40, 0, 0, .5), 0 1px 0 rgba(245,238,228,.08) inset; }
.nav-inner {
  width: var(--container); margin-inline: auto;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-mark { font-family: var(--serif); font-size: 34px; line-height: .8; letter-spacing: -.08em; }
.brand-name { font-size: 11px; font-weight: 600; letter-spacing: .22em; }
.nav-links { display: flex; flex: 1; justify-content: center; gap: 18px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { position: relative; padding: 6px 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; transition: opacity .25s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: 22px; }
.icon-button { display: grid; place-items: center; opacity: .9; transition: opacity .25s, transform .25s; }
.icon-button:hover { opacity: 1; transform: translateY(-1px); }
.bag-button { display: inline-flex; align-items: center; gap: 7px; padding: 5px; }
.bag-button svg { display: block; transition: transform .25s var(--ease); }
.bag-button:hover svg { transform: translateY(-1px); }
.bag-count {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid rgba(245, 238, 228, .5); border-radius: 999px;
  padding: 2px 8px;
}
.bag-count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); background: var(--cream); color: var(--red); } 100% { transform: scale(1); } }
.menu-button { display: none; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- cart drawer ---------- */
.drawer-root { position: fixed; inset: 0; z-index: 400; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(30, 8, 8, .5); opacity: 0; transition: opacity .4s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(430px, 94vw);
  background: var(--cream);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform .5s var(--ease);
  box-shadow: var(--shadow);
}
.drawer-root.open .drawer-overlay { opacity: 1; }
.drawer-root.open .drawer { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px; border-bottom: 1px solid var(--line);
}
.drawer-title { font-family: var(--serif); font-size: 24px; }
.drawer-title em { font-family: var(--mono); font-size: 12px; font-style: normal; color: var(--muted); }
.drawer-close { font-size: 16px; padding: 6px; transition: transform .3s; }
.drawer-close:hover { transform: rotate(90deg); }
.drawer-ship { padding: 16px 26px 0; }
.ship-note { font-size: 12px; letter-spacing: .04em; color: rgba(101, 0, 0, .8); margin-bottom: 8px; }
.ship-note.done { color: #2e6b34; }
.ship-bar { height: 3px; background: rgba(101, 0, 0, .14); overflow: hidden; }
.ship-bar i { display: block; height: 100%; background: var(--red); transition: width .8s var(--ease); }
.drawer-items { flex: 1; overflow-y: auto; padding: 10px 26px; }
.drawer-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.drawer-thumb { width: 74px; height: 92px; overflow: hidden; background: var(--sand); flex: none; }
.drawer-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.drawer-thumb:hover img { transform: scale(1.06); }
.drawer-info { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.drawer-name { font-family: var(--serif); font-size: 18px; line-height: 1.1; }
.drawer-name:hover { color: var(--red); }
.drawer-meta { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.drawer-info .qty { margin-top: 8px; align-self: flex-start; }
.drawer-info .qty button { width: 26px; height: 26px; font-size: 13px; }
.drawer-line { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.drawer-line span { font-family: var(--mono); font-size: 13px; }
.drawer-remove { font-size: 11px; color: var(--muted); transition: color .25s; }
.drawer-remove:hover { color: #a3271f; }
.drawer-empty { text-align: center; padding: 70px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.drawer-empty-mark { font-family: var(--serif); font-size: 54px; color: rgba(101, 0, 0, .25); line-height: 1; }
.drawer-empty p { font-family: var(--serif); font-size: 22px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 20px 26px 26px; display: flex; flex-direction: column; gap: 14px; }
.drawer-subtotal { display: flex; justify-content: space-between; align-items: baseline; }
.drawer-subtotal strong { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.drawer-note { font-size: 11px; color: var(--muted); }
.drawer-view { align-self: center; }

/* ---------- search overlay ---------- */
.search-root {
  position: fixed; inset: 0; z-index: 420;
  background: rgba(245, 238, 228, .97);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .4s;
  overflow-y: auto;
}
.search-root.open { opacity: 1; }
.search-close { position: absolute; top: 22px; right: 4vw; font-size: 18px; padding: 10px; transition: transform .3s; z-index: 2; }
.search-close:hover { transform: rotate(90deg); }
.search-inner { width: min(760px, 88vw); margin: 14vh auto 60px; }
.search-label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(101, 0, 0, .66); margin-bottom: 16px; }
#search-input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong);
  font-family: var(--serif); font-size: clamp(30px, 5vw, 54px);
  padding: 8px 0 16px; color: var(--ink);
}
#search-input:focus { outline: none; border-color: var(--red); }
#search-input::placeholder { color: rgba(101, 0, 0, .3); }
.search-results { margin-top: 34px; }
.search-hint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-hint span { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.search-hit {
  display: grid; grid-template-columns: 54px 1fr auto auto; gap: 16px; align-items: center;
  padding: 14px 10px; border-bottom: 1px solid var(--line);
  transition: background .25s, padding-left .25s;
}
.search-hit:hover { background: rgba(101, 0, 0, .05); padding-left: 16px; }
.search-hit img { width: 54px; height: 66px; object-fit: cover; }
.search-hit-name { font-family: var(--serif); font-size: 20px; }
.search-hit-cat { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.search-hit-price { font-family: var(--mono); font-size: 13px; }
.search-none { padding: 26px 0; color: var(--muted); font-style: italic; }

/* ---------- mobile menu ---------- */
.menu-root {
  position: fixed; inset: 0; z-index: 380;
  background: var(--red); color: var(--cream);
  opacity: 0; transition: opacity .4s;
  overflow-y: auto;
}
.menu-root.open { opacity: 1; }
.menu-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 18vh 8vw 8vh; }
.menu-nav { display: flex; flex-direction: column; gap: 4px; }
.menu-nav a {
  font-family: var(--serif); font-size: clamp(44px, 10vw, 76px); line-height: 1.12;
  opacity: 0; transform: translateY(26px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), color .3s;
  transition-delay: calc(.08s * var(--i) + .15s);
}
.menu-root.open .menu-nav a { opacity: 1; transform: none; }
.menu-nav a:hover { color: #e2b8a0; }
.menu-foot { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(245, 238, 228, .7); }

/* ---------- footer ---------- */
#site-footer { background: var(--red); color: var(--cream); margin-top: 130px; }
.footer-main {
  width: var(--container); margin-inline: auto;
  display: grid; grid-template-columns: 1.2fr 1.6fr 1fr; gap: 60px;
  padding: 90px 0 70px;
}
.footer-brand-lockup .brand-mark { font-size: 56px; }
.footer-brand-lockup .brand-name { font-size: 13px; }
.footer-tag { margin-top: 22px; font-family: var(--serif); font-size: 26px; line-height: 1.2; color: rgba(245, 238, 228, .92); }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.footer-cols > div { display: flex; flex-direction: column; gap: 12px; }
.footer-head { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(245, 238, 228, .6); margin-bottom: 6px; }
.footer-cols a, .contact-info a { font-size: 14px; opacity: .88; transition: opacity .25s, transform .25s; width: fit-content; }
.footer-cols a:hover { opacity: 1; transform: translateX(4px); }
.footer-news p { font-size: 14px; color: rgba(245, 238, 228, .8); margin: 10px 0 20px; max-width: 300px; }
#newsletter-form { display: flex; border-bottom: 1px solid rgba(245, 238, 228, .5); }
#newsletter-email {
  flex: 1; background: transparent; border: 0; color: var(--cream);
  padding: 12px 0; font-size: 15px;
}
#newsletter-email::placeholder { color: rgba(245, 238, 228, .45); }
#newsletter-email:focus { outline: none; }
.news-button { color: var(--cream); padding: 8px; transition: transform .3s var(--ease); }
.news-button:hover { transform: translateX(5px); }
.news-done { font-family: var(--serif); font-size: 20px; padding: 10px 0; color: #e2b8a0; }
#newsletter-note { display: block; margin-top: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(245, 238, 228, .55); }
#newsletter-note.err { color: #ffb3a7; }
.footer-bottom {
  width: var(--container); margin-inline: auto;
  border-top: 1px solid rgba(245, 238, 228, .2);
  padding: 22px 0 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(245, 238, 228, .65);
}
.footer-pay { display: inline-flex; gap: 8px; }
.footer-pay i { font-style: normal; border: 1px solid rgba(245, 238, 228, .3); padding: 4px 8px; }

/* ---------- toasts ---------- */
.toast-root { position: fixed; left: 22px; bottom: 22px; z-index: 600; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--cream);
  padding: 14px 18px 16px; max-width: 340px;
  font-size: 13px;
  position: relative; overflow: hidden; border-radius: 4px;
  opacity: 0; transform: translateY(16px) translateX(-6px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  box-shadow: var(--shadow);
}
.toast::after { /* progress timer line */
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--red); transform-origin: left;
  animation: toastTimer 2.6s linear forwards;
}
@keyframes toastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.show { opacity: 1; transform: none; }
.toast::before { content: ""; }
.toast.ok::first-letter { color: #8fd694; }
.toast { border-left: 3px solid var(--red); }
.toast.err { border-left-color: #a3271f; }
.toast.err::after { background: #a3271f; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(30, 8, 8, .55); opacity: 0; transition: opacity .3s; }
.modal {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--cream); padding: 34px 34px 28px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(18px) scale(.98);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.modal-root.open .modal-overlay { opacity: 1; }
.modal-root.open .modal { opacity: 1; transform: none; }
.modal-title { font-size: 30px; margin-bottom: 14px; }
.modal-body { color: rgba(101, 0, 0, .8); margin-bottom: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; }

/* ---------- custom cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 900; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.visible { opacity: 1; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--red); }
.cursor-ring {
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1px solid rgba(101, 0, 0, .55);
  transition: background .3s, scale .3s var(--ease);
}
.cursor.hover .cursor-ring { scale: 1.7; background: rgba(101, 0, 0, .06); }
.cursor.hover .cursor-dot { scale: 1.6; }
.cursor.click .cursor-ring { scale: 1.25; border-color: var(--red); }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--cream);
  display: grid; place-items: center;
  transition: transform .85s var(--ease) .1s;
}
.preloader.done { transform: translateY(-101%); }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.preloader-mark {
  font-family: var(--serif); font-size: 76px; color: var(--red); line-height: 1;
  animation: fadeUp .9s var(--ease) both, markGlow 1.4s ease-in-out .4s;
}
@keyframes markGlow { 0%,100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 18px rgba(101,0,0,.55); } }
.preloader-name {
  font-family: var(--mono); font-size: 11px; letter-spacing: .5em; text-transform: uppercase;
  color: rgba(101, 0, 0, .7);
  animation: fadeUp .9s .15s var(--ease) both;
}
.preloader-bar { width: 130px; height: 1px; background: rgba(101, 0, 0, .18); overflow: hidden; animation: fadeUp .9s .25s var(--ease) both; }
.preloader-bar i { display: block; height: 100%; background: var(--red); animation: load 1.15s .3s var(--ease) forwards; transform-origin: left; }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- route veil ---------- */
.page-veil {
  position: fixed; inset: 0; z-index: 800;
  background: var(--red);
  transform: scaleY(0); transform-origin: top;
  pointer-events: none;
}

/* ---------- responsive chrome ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-button { display: block; }
  .footer-main { grid-template-columns: 1fr; gap: 44px; padding: 64px 0 50px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
