/* =========================================================
   ESPRIT SUSHI — Composants de pages
   ========================================================= */

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(35,44,36,.42);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .35s;
}
.cart-overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 310;
  width: min(440px, 100vw); background: var(--cream);
  box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .42s cubic-bezier(.2,.85,.2,1);
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: none; }
.cart-head { display: flex; align-items: center; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.cart-head h3 { font-size: 1.7rem; flex: 1; }
.cart-close, .cart-back { background: none; border: none; font-size: 1.7rem; line-height: 1; color: var(--ink-soft); width: 38px; height: 38px; border-radius: 50%; transition: background .2s; }
.cart-close:hover, .cart-back:hover { background: rgba(42,38,32,.07); }
.cart-back { font-size: 1.3rem; }
.cart-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-lines { display: flex; flex-direction: column; gap: 14px; }
.cart-line { display: flex; align-items: center; gap: 14px; }
.cart-line-media { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: var(--shadow-sm); }
.cart-line-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cart-line-info strong { font-weight: 700; font-size: 0.96rem; }
.cart-line-info span { color: var(--ink-soft); font-size: 0.86rem; }
.qty { display: flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.qty-btn { width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--cream-2); color: var(--ink); font-size: 1.1rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: var(--matcha); color: #fff; }
.qty-val { min-width: 20px; text-align: center; font-weight: 700; font-size: 0.9rem; }

.cart-mode { margin-top: 26px; }
.cart-mode label { display: block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
.mode-row { display: flex; gap: 8px; background: var(--cream-2); padding: 5px; border-radius: var(--r-pill); }
.mode-opt { flex: 1; border: none; background: transparent; padding: 9px 8px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.82rem; color: var(--ink-soft); transition: all .2s; }
.mode-opt.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

.cart-foot { border-top: 1px solid var(--line); padding: 20px 24px; background: var(--cream); }
.cart-totals { margin-bottom: 14px; }
.cart-totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.94rem; color: var(--ink-soft); }
.cart-totals .row.total { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--ink); padding-top: 10px; }
.cart-clear { width: 100%; background: none; border: none; color: var(--ink-faint); font-weight: 700; font-size: 0.84rem; padding: 12px 0 2px; }
.cart-clear:hover { color: var(--salmon-deep); }

.cart-empty { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cart-empty-art { width: 90px; height: 90px; border-radius: 50%; background: var(--cream-2); position: relative; }
.cart-empty-art::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 3px dashed var(--matcha-soft); }
.cart-empty p { color: var(--ink-soft); }

.checkout-form .field { margin-bottom: 14px; }
.checkout-form label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.checkout-form input, .checkout-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); font-family: inherit; font-size: 0.94rem; color: var(--ink); transition: border .2s, box-shadow .2s;
}
.checkout-form input:focus, .checkout-form textarea:focus { outline: none; border-color: var(--matcha); box-shadow: 0 0 0 3px var(--matcha-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-note { display: flex; align-items: center; gap: 9px; font-size: 0.86rem; color: var(--ink-soft); background: var(--matcha-soft); padding: 11px 14px; border-radius: var(--r-sm); margin-top: 6px; }
.pay-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--matcha-deep); flex: none; }

.cart-success { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.success-check { width: 78px; height: 78px; border-radius: 50%; background: var(--matcha); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(126,158,79,.4); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(0); } }
.success-num { display: flex; flex-direction: column; gap: 4px; background: var(--cream-2); padding: 14px 22px; border-radius: var(--r-md); }
.success-num span { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.success-num strong { font-family: var(--serif); font-size: 1.8rem; color: var(--matcha-deep); }

/* ---------- Carte page ---------- */
.carte-toolbar {
  position: sticky; top: var(--nav-h); z-index: 90;
  background: rgba(251,247,239,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: 16px 0;
}
.toolbar-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.search-box input { width: 100%; padding: 12px 16px 12px 42px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); font-family: inherit; font-size: 0.92rem; }
.search-box input:focus { outline: none; border-color: var(--matcha); box-shadow: 0 0 0 3px var(--matcha-soft); }
.sort-select { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); font-family: inherit; font-weight: 600; font-size: 0.88rem; color: var(--ink); cursor: pointer; }

.cat-bar { display: flex; gap: 9px; overflow-x: auto; padding: 14px 0 2px; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip { white-space: nowrap; padding: 9px 18px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; font-size: 0.86rem; color: var(--ink-soft); transition: all .2s; }
.cat-chip:hover { border-color: var(--matcha); color: var(--matcha-deep); }
.cat-chip.active { background: var(--nori); border-color: var(--nori); color: var(--cream); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 22px; }
.prod-card { background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
.prod-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.prod-card .prod-media { aspect-ratio: 16/11; }
/* Real product photo fills the media tile; gradient stays as fallback underneath */
.prod-media .prod-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.prod-card:hover .prod-media .prod-img { transform: scale(1.05); }
.prod-media.has-img::before { display: none; } /* drop seigaiha pattern over a photo */
.prod-media.has-img::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(20,26,20,.32) 0%, transparent 38%), linear-gradient(to bottom, rgba(20,26,20,.18) 0%, transparent 30%); }
.prod-tags { position: absolute; top: 12px; right: 12px; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.prod-tag { background: rgba(255,255,255,.92); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill); }
.prod-tag.sig { background: var(--nori); color: var(--gold); }
.prod-tag.new { background: var(--salmon); color: #fff; }
.prod-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.prod-name { font-family: var(--serif); font-size: 1.42rem; font-weight: 600; line-height: 1.05; }
.prod-desc { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; flex: 1; }
.prod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.prod-price { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--matcha-deep); }
.prod-add { display: inline-flex; align-items: center; gap: 7px; background: var(--matcha); color: #fff; border: none; padding: 10px 16px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.84rem; transition: all .2s; }
.prod-add:hover { background: var(--matcha-deep); transform: scale(1.04); }
.prod-add.done { background: var(--salmon); }
.carte-empty { text-align: center; padding: 80px 20px; color: var(--ink-soft); font-size: 1.1rem; grid-column: 1/-1; }
.cat-group-title { grid-column: 1/-1; display: flex; align-items: baseline; gap: 14px; margin: 14px 0 -4px; }
.cat-group-title h3 { font-size: 2rem; }
.cat-group-title span { color: var(--ink-faint); font-size: 0.9rem; font-weight: 600; }

/* ---------- Generic media tile (placeholder w/ label) ---------- */
.media-tile { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media-tile .mt-label { position: relative; z-index: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.7rem; letter-spacing: 0.06em; color: rgba(255,255,255,.92); background: rgba(35,44,36,.32); padding: 6px 12px; border-radius: var(--r-pill); backdrop-filter: blur(3px); }
.media-tile::after { content:""; position:absolute; inset:0; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 12px, transparent 12px 24px); }
/* Real photo / embed fills the tile and removes the placeholder pattern */
.media-tile.has-photo::after { display: none; }
.media-tile .tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; display: block; }
.media-tile .tile-map { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1; display: block; }

/* ---------- Galerie ---------- */
.gal-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 150px; gap: 16px; }
.gal-grid image-slot { width: 100%; height: 100%; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.g-a { grid-column: span 5; grid-row: span 2; }
.g-b { grid-column: span 4; grid-row: span 2; }
.g-c { grid-column: span 3; grid-row: span 2; }
.g-d { grid-column: span 4; grid-row: span 2; }
.g-e { grid-column: span 4; grid-row: span 2; }
.g-f { grid-column: span 4; grid-row: span 2; }
.g-g { grid-column: span 7; grid-row: span 2; }
.g-h { grid-column: span 5; grid-row: span 2; }
@media (max-width: 760px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
  .gal-grid > * { grid-column: span 1 !important; grid-row: span 1 !important; }
  .g-a, .g-g { grid-column: span 2 !important; }
}

/* ---------- Reviews ---------- */
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.rev-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; }
.rev-stars { color: var(--gold); letter-spacing: 2px; font-size: 1rem; }
.rev-text { font-family: var(--serif); font-size: 1.32rem; line-height: 1.35; color: var(--ink); }
.rev-author { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.rev-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 0.95rem; }
.rev-author b { display: block; font-size: 0.92rem; }
.rev-author span { font-size: 0.8rem; color: var(--ink-faint); }

.rating-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.rating-big { font-family: var(--serif); font-size: 5rem; font-weight: 700; line-height: 1; color: var(--matcha-deep); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px; box-shadow: var(--shadow-sm); }
.contact-info-item { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-info-item:last-child { border-bottom: none; }
.cii-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--matcha-soft); color: var(--matcha-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.cii-body h4 { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.cii-body p, .cii-body a { font-size: 1.05rem; font-weight: 600; }
.cii-body .big { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--matcha-deep); }
.hours-list span { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 0.94rem; }
.hours-list span:last-child { border-bottom: none; }
.hours-list .closed { color: var(--salmon-deep); font-weight: 700; }
.hours-list .today { color: var(--matcha-deep); font-weight: 800; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Admin ---------- */
.admin-shell { min-height: 100vh; background: var(--cream-2); }
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.admin-login-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 48px; width: min(420px, 100%); text-align: center; }
.admin-login-card .brand-mark { width: 56px; height: 56px; margin: 0 auto 20px; }
.admin-login-card h1 { font-size: 2.4rem; margin-bottom: 6px; }
.admin-login-card p { color: var(--ink-soft); margin-bottom: 26px; }
.admin-login-card input { width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 12px; font-family: inherit; }

.admin-top { background: var(--nori); color: var(--cream); padding: 18px 0; }
.admin-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-top .brand-name { color: var(--cream); }
.admin-top .brand-name small { color: var(--matcha-soft); }
.admin-logout { background: rgba(251,247,239,.12); color: var(--cream); border: none; padding: 9px 18px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.84rem; }
.admin-logout:hover { background: rgba(251,247,239,.22); }

.admin-main { padding: 36px 0 80px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 32px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.kpi .k-label { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.kpi .k-val { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; margin-top: 8px; line-height: 1; }
.kpi .k-val.matcha { color: var(--matcha-deep); }
.kpi .k-val.salmon { color: var(--salmon-deep); }
@media (max-width: 860px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.admin-tab { background: var(--paper); border: 1px solid var(--line); padding: 11px 22px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.9rem; color: var(--ink-soft); }
.admin-tab.active { background: var(--nori); border-color: var(--nori); color: var(--cream); }

.admin-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.admin-panel-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-panel-head h3 { font-size: 1.6rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 800; padding: 14px 26px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 16px 26px; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--cream); }
.o-num { font-family: ui-monospace, monospace; font-weight: 700; color: var(--matcha-deep); }
.o-items { color: var(--ink-soft); font-size: 0.85rem; max-width: 280px; }
.mode-badge { display: inline-block; padding: 4px 11px; border-radius: var(--r-pill); font-size: 0.74rem; font-weight: 800; background: var(--cream-2); }
.status-select { padding: 7px 12px; border-radius: var(--r-pill); border: 1.5px solid var(--line); font-family: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.status-new { border-color: var(--salmon); color: var(--salmon-deep); }
.status-prep { border-color: var(--gold); color: #9a7a25; }
.status-ready { border-color: var(--matcha); color: var(--matcha-deep); }
.status-done { border-color: var(--line); color: var(--ink-faint); }
.price-input { width: 84px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: inherit; font-weight: 700; text-align: right; }
.price-input:focus { outline: none; border-color: var(--matcha); }
.vis-toggle { width: 42px; height: 24px; border-radius: var(--r-pill); border: none; background: var(--matcha); position: relative; cursor: pointer; transition: background .2s; }
.vis-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.vis-toggle.off { background: var(--ink-faint); }
.vis-toggle.off::after { transform: translateX(18px); }
.icon-btn { background: var(--cream-2); border: none; width: 34px; height: 34px; border-radius: 9px; color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--salmon-soft); color: var(--salmon-deep); }
.admin-empty { padding: 60px; text-align: center; color: var(--ink-soft); }
@media (max-width: 720px) { .admin-table .hide-sm { display: none; } }
