/* ==========================================================================
   SyncResto — V3 "AURORA" · modals.css
   Ürün detayı = referansın "detail sheet"i (46vh hero + binen sayfa + tutamaç).
   Sepet / ödeme / giriş modalleri token'lara bağlanır.
   NOT: modaller partials/modals.ejs'te (TÜM temalarda ortak). Yapı/JS aynı;
   burada yalnız görünüm değişir. Açılma mekaniği (.modal.active) base CSS'te.
   ========================================================================== */

/* ---------- ortak modal kabuğu ---------- */
.v3-theme .modal-overlay {
  background: rgba(10, 8, 7, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.v3-theme .modal-content {
  background: var(--bg-0);
  color: var(--ink-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-2);
}
.v3-theme .modal-header,
.v3-theme .modal-body,
.v3-theme .modal-footer { background: transparent; }

/* ==========================================================================
   ÜRÜN DETAYI — Aurora sheet
   ========================================================================== */
.v3-theme #productModal .modal-content {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

/* hero: sabit "pencere", görsel içeride cover */
.v3-theme #productModal .modal-img {
  position: relative;
  height: 42vh;
  min-height: 220px;
  max-height: 380px;
  overflow: hidden;
  /* contain kullandığımız için boşluk kalıyor → tema zemini (açık modda da doğru) */
  background: var(--bg-2);
}
/* Ürün detayında da TAM görsel — kırpma yok (menü fotoğrafı bilgidir) */
.v3-theme #productModal .modal-img img {
  width: 100%; height: 100%;
  object-fit: contain;
}
/* 🔴 Alt kenar birleşimi — ESKİDEN görselin ALT ÜÇTE BİRİNİ karartıyordu
   (yemek kaybolıyordu). Artık yalnız en dipte, sheet ile kaynaşacak kadar. */
.v3-theme #productModal .modal-img::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 82%, var(--bg-0) 100%);
}

/* kapatma düğmesi — foto üstünde yuvarlak cam çip */
.v3-theme #productModal .modal-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  inset-inline-end: 14px;
  z-index: 3;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--on-dark-border);
  background: rgba(20, 17, 15, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--on-dark);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* sheet: hero'nun üstüne biner */
.v3-theme #productModal .modal-body {
  position: relative;
  z-index: 2;
  margin-top: -28px;
  padding: 8px 22px 20px;
  background: var(--bg-0);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}
/* tutamaç */
.v3-theme #productModal .modal-body::before {
  content: "";
  display: block;
  width: 40px; height: 4px;
  margin: 8px auto 18px;
  border-radius: 100px;
  background: var(--border);
}

.v3-theme #productModal .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.v3-theme #productModal .modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.16;
  color: var(--ink-0);
}
.v3-theme #productModal .modal-price {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--gold);
  white-space: nowrap;
  padding-top: 4px;
}
.v3-theme #productModal .modal-desc {
  color: var(--ink-1);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* besin değeri / alerjen çipleri */
.v3-theme .modal-nutrition-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.v3-theme .modal-nutrition-badges > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-1);
  font-size: 0.78rem;
}

/* seçenek grupları (varyant / ekstra) */
.v3-theme .options-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.v3-theme .options-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink-0);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.v3-theme .options-title .tag {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.v3-theme .options-title .tag.required { color: var(--gold); border-color: var(--gold); }

.v3-theme .option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.v3-theme .option-item:hover { border-color: var(--gold); }
.v3-theme .option-item.selected {
  border-color: var(--gold);
  background: var(--bg-2); /* color-mix desteklemeyen tarayici icin taban */
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-1));
}
.v3-theme .option-radio,
.v3-theme .option-checkbox {
  width: 20px; height: 20px;
  flex: none;
  border: 2px solid var(--border);
  background: transparent;
}
.v3-theme .option-radio { border-radius: 50%; }
.v3-theme .option-checkbox { border-radius: 6px; }
.v3-theme .option-item.selected .option-radio,
.v3-theme .option-item.selected .option-checkbox {
  border-color: var(--gold);
  background: var(--gold);
}
.v3-theme .option-name { color: var(--ink-0); font-size: 0.92rem; }
.v3-theme .option-price { color: var(--gold); font-size: 0.88rem; font-weight: 600; white-space: nowrap; }

/* ürün notu */
.v3-theme .modal-note-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  font-weight: 600;
  margin: 20px 0 8px;
}
.v3-theme .modal-note-input,
.v3-theme textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--ink-0);
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: vertical;
}
.v3-theme .modal-note-input:focus { outline: none; border-color: var(--gold); }

/* alt bar — adet + sepete ekle */
.v3-theme #productModal .modal-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), var(--bg-0) 24%);
  border-top: 1px solid var(--border);
}
.v3-theme .qty-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg-1);
  padding: 4px;
}
.v3-theme .qty-selector button {
  width: 36px; height: 36px;
  border: none;
  background: none;
  color: var(--ink-0);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: var(--radius-s);
}
.v3-theme .qty-selector button:hover { background: var(--glass); color: var(--gold); }
.v3-theme .qty-selector span { min-width: 26px; text-align: center; font-weight: 600; }

.v3-theme .add-to-cart-btn {
  flex: 1;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-m);
  background: var(--gold);
  color: var(--bg-0);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .18s var(--ease), transform .15s var(--ease);
}
.v3-theme .add-to-cart-btn:hover { filter: brightness(1.06); }
.v3-theme .add-to-cart-btn:active { transform: scale(0.985); }
.v3-theme .add-to-cart-btn .total-price { font-weight: 800; }

/* ==========================================================================
   SEPET
   ========================================================================== */
.v3-theme .cart,
.v3-theme #cart {
  background: var(--bg-0);
  border-inline-start: 1px solid var(--border);
  color: var(--ink-0);
}
.v3-theme .cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--bg-1);
  margin-bottom: 10px;
}
/* 🔴 Sepet görseli 60px kutuda `cover` ile ağır kırpılıyordu (geniş tabak fotoğrafı).
   Kutu büyütüldü + `contain` → ürünün tamamı görünür. */
.v3-theme .cart-item-img {
  width: 68px;
  height: 68px;
  min-width: 68px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.v3-theme .cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.v3-theme .cart-item-name { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.v3-theme .cart-item-price,
.v3-theme #cartTotal,
.v3-theme #cartSubtotal { color: var(--gold); font-weight: 600; }
.v3-theme .cart-summary,
.v3-theme .cart-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.v3-theme #checkoutBtn {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: var(--radius-m);
  background: var(--gold);
  color: var(--bg-0);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

/* ==========================================================================
   ÖDEME / GİRİŞ / GENEL MODALLER
   ========================================================================== */
.v3-theme #checkoutModal .modal-content,
.v3-theme #authModal .modal-content,
.v3-theme #infoModal .modal-content,
.v3-theme #orderSuccessModal .modal-content,
.v3-theme #orderFailedModal .modal-content {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.v3-theme .form-group label,
.v3-theme .checkout-label {
  color: var(--ink-2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.v3-theme input[type="text"],
.v3-theme input[type="tel"],
.v3-theme input[type="email"],
.v3-theme input[type="password"],
.v3-theme input[type="number"],
.v3-theme select {
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--ink-0);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-family: var(--font-body);
}
.v3-theme input:focus,
.v3-theme select:focus { outline: none; border-color: var(--gold); }

.v3-theme .payment-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg-1);
  color: var(--ink-0);
}
.v3-theme .payment-option.selected { border-color: var(--gold); }

.v3-theme .checkout-steps .step { color: var(--ink-2); }
.v3-theme .checkout-steps .step.active { color: var(--gold); }

/* toplam satırları — para yüzeyi, accent tek yerden */
.v3-theme #checkoutTotal,
.v3-theme #checkoutSubtotal,
.v3-theme .total-row strong { color: var(--gold); }

/* ==========================================================================
   TEMEL TEMA BUTON/ETİKET SIZINTILARI — ödeme, sepet, giriş akışının TAMAMI
   Bu blok TEK KAYNAK: sepet, ödeme adımları, adres, giriş modali hepsi
   partials/modals.ejs'ten geldiği için buradaki bir değişiklik HEPSİNDE geçerli.
   ========================================================================== */

/* Ana eylem butonları — temel temada SİYAH (--secondary) veya YEŞİL gradyan */
.v3-theme .checkout-btn,
.v3-theme .auth-submit,
.v3-theme #pickLocationBtnTop,
.v3-theme #addToCartBtn,
.v3-theme .btn-primary {
  background-image: none;
  background-color: var(--gold);
  color: var(--bg-0);
  border: 1px solid var(--gold);
  border-radius: var(--radius-m);
  font-family: var(--font-body);
  font-weight: 700;
  box-shadow: none;
  min-height: 50px;
}
.v3-theme .checkout-btn:hover,
.v3-theme .auth-submit:hover,
.v3-theme #pickLocationBtnTop:hover,
.v3-theme .btn-primary:hover { filter: brightness(1.07); }
.v3-theme #pickLocationBtnTop svg { color: currentColor; }

/* 🔴 modals.ejs:244 bu butona SABİT yeşil gradyanı ÖZNİTELİK olarak yazıyor
   (değişken değil) → inline stili yenmek için tek yer burada !important şart.
   Ortak partial'a dokunmuyoruz ki klasik/v2 temalar aynen kalsın. */
.v3-theme #pickLocationBtnTop {
  background: var(--gold) !important;
  color: var(--bg-0) !important;
  border: 1px solid var(--gold) !important;
  box-shadow: none !important;
}

/* İkincil butonlar — dolgu değil, çerçeveli cam (hiyerarşi korunsun) */
.v3-theme .btn.btn-secondary:not(#pickLocationBtnTop),
.v3-theme .coupon-apply-btn,
.v3-theme #savedAddrNewBtn {
  background-image: none;
  background-color: var(--glass);
  color: var(--ink-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  box-shadow: none;
  font-weight: 600;
}
.v3-theme .btn.btn-secondary:not(#pickLocationBtnTop):hover,
.v3-theme .coupon-apply-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Telefon +90 kutusu — temel temada BEYAZ hap, koyu formda göze batıyordu */
.v3-theme .phone-prefix {
  background: var(--bg-2);
  color: var(--ink-1);
  border: 1px solid var(--border);
  border-inline-end: none;
  font-family: var(--font-body);
}

/* Yardımcı metin/bağlantılar — temel temada slate gri (koyu zeminde soluk) */
.v3-theme #manualToggleRow,
.v3-theme #manualToggleRow label,
.v3-theme #manualToggleRow span,
.v3-theme .checkout-hint,
.v3-theme .form-hint { color: var(--ink-2); }
.v3-theme #manualToggleRow label:hover span { color: var(--gold); }

/* Adım göstergesi — aktif adım SİYAH kutuydu */
.v3-theme .checkout-steps .step {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.v3-theme .checkout-steps .step.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-0);
}

/* Onay kutuları accent'e bağlansın (tarayıcı varsayılanı mavi) */
.v3-theme input[type="checkbox"],
.v3-theme input[type="radio"] { accent-color: var(--gold); }

/* Sepet başlığı ve kapatma düğmesi */
.v3-theme .cart-header h2 { font-family: var(--font-display); font-weight: 600; }
.v3-theme .close-btn,
.v3-theme .modal-close {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--ink-0);
}
.v3-theme .close-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ==========================================================================
   HIZLI ÜYELİK / ŞİFRE PANELİ (#checkoutAuthPanel)
   checkout.js:363 bu paneli SABİT renklerle (background:#fff, color:#555,
   background:#111) DOM'a enjekte ediyor — değişken kullanmıyor. Koyu temada
   bembeyaz bir kutu olarak çıkıyordu. Ortak JS'e dokunmadan burada eziyoruz.
   ========================================================================== */
.v3-theme #checkoutAuthPanel > div {
  background: var(--bg-1) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-l) !important;
  color: var(--ink-0);
  box-shadow: var(--shadow-2);
}
.v3-theme #checkoutAuthPanel h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-0);
}
.v3-theme #checkoutAuthPanel p,
.v3-theme #checkoutAuthPanel label,
.v3-theme #checkoutAuthPanel label span { color: var(--ink-1) !important; }
.v3-theme #checkoutAuthPanel strong { color: var(--ink-0); }
.v3-theme #checkoutAuthPanel a { color: var(--gold) !important; }
.v3-theme #caPass {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink-0) !important;
  border-radius: var(--radius-s) !important;
}
.v3-theme #caPass::placeholder { color: var(--ink-2); }
.v3-theme #caBtn {
  background: var(--gold) !important;
  color: var(--bg-0) !important;
  border-radius: var(--radius-m) !important;
  font-family: var(--font-body);
}
.v3-theme #caForgot { color: var(--gold) !important; }
.v3-theme #caCancel { color: var(--ink-2) !important; }
.v3-theme #caErr { color: var(--danger) !important; }

/* toast */
.v3-theme .toast {
  background: var(--surface);
  color: var(--ink-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  font-family: var(--font-body);
}
