/* ===== SİPARİŞ SAYFASI ===== */
.siparis-nav { position: sticky; top: 0; z-index: 200; }

/* 3-column nav when back button is present */
.nav-has-back {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.nav-has-back .nav-logo   { text-align: center; font-size: 1.15rem; }
.nav-has-back .siparis-nav-info { justify-self: end; }
.nav-back-placeholder     { display: block; }

.siparis-back-btn {
  display: flex; align-items: center; gap: .3rem;
  background: none; border: 1.5px solid var(--border);
  border-radius: 100px; padding: .35rem .85rem;
  font-size: .83rem; font-weight: 600; color: var(--text-mid);
  cursor: pointer; white-space: nowrap; transition: all .15s;
  justify-self: start;
}
.siparis-back-btn:hover { background: var(--green-100); border-color: var(--green-400); color: var(--green-600); }

.siparis-nav-info { display: flex; align-items: center; gap: .75rem; }
.siparis-masa-tag {
  background: var(--green-100); color: var(--green-600);
  font-size: .8rem; font-weight: 700; padding: .3rem .75rem;
  border-radius: 100px; letter-spacing: .03em;
}
.cart-toggle-btn {
  position: relative; background: var(--green-500); border: none;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e05c5c; color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.siparis-page { min-height: 80vh; }

/* ===== MASA SEÇİMİ ===== */
.siparis-center-wrap {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem;
}
.masa-secim-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem;
  max-width: 540px; width: 100%;
  box-shadow: 0 8px 40px var(--shadow);
  text-align: center;
}
.masa-secim-card h1 { font-family: var(--font-serif); font-size: 1.75rem; margin-bottom: .5rem; }
.masa-secim-card p  { color: var(--text-light); margin-bottom: 2rem; }
.masa-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .75rem;
}
.masa-btn {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: 1rem .75rem; border-radius: 12px;
  border: 2px solid var(--border); background: #fff;
  cursor: pointer; transition: all .2s;
}
.masa-btn:hover { border-color: var(--green-400); background: var(--green-50); }
.masa-btn:active { transform: scale(.97); }
.masa-name { font-weight: 700; font-size: .95rem; color: var(--text-dark); }
.masa-cap  { font-size: .75rem; color: var(--text-light); }

/* ===== SIPARIS CONFIRM ===== */
.siparis-confirm-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem;
  max-width: 560px; width: 100%; text-align: center;
  box-shadow: 0 8px 40px var(--shadow);
}
.confirm-icon {
  width: 64px; height: 64px; background: var(--green-500); color: #fff;
  border-radius: 50%; font-size: 1.75rem; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 1.25rem;
}
.siparis-confirm-card h1 { font-family: var(--font-serif); font-size: 1.5rem; margin-bottom: .5rem; }
.siparis-confirm-card > p { color: var(--text-mid); margin-bottom: 1.5rem; }

.current-order-box {
  background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: 12px; padding: 1.25rem; text-align: left; margin-bottom: 1.5rem;
}
.order-batch-summary { margin-bottom: 1rem; }
.order-batch-summary.is-extra {
  background: rgba(74,145,105,.07); border-radius: 8px; padding: .75rem;
  margin-top: .75rem;
}
.batch-label-sm { font-weight: 700; font-size: .85rem; color: var(--green-600); margin-bottom: .4rem; }
.order-item-row { display: flex; justify-content: space-between; font-size: .9rem; padding: .2rem 0; }
.batch-subtotal { font-size: .8rem; color: var(--text-light); text-align: right; margin-top: .3rem; }
.grand-total { font-weight: 700; font-size: 1.05rem; text-align: right; padding-top: .75rem; border-top: 1px solid var(--green-200); margin-top: .5rem; }
.confirm-status {
  display: flex; align-items: center; gap: .5rem;
  font-size: .875rem; color: var(--text-mid); margin-top: 1rem; justify-content: center;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.pending   { background: #f97316; }
.status-dot.preparing { background: #3b82f6; }
.status-dot.ready     { background: #22c55e; }
.confirm-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.confirm-note { font-size: .8rem; color: var(--text-light); margin-top: 1rem; }

/* ADD MORE BANNER */
.add-more-banner {
  background: var(--green-500); color: #fff;
  padding: .6rem 1.5rem; text-align: center; font-size: .875rem;
}

/* ===== MENÜ + SEPET LAYOUT ===== */
.siparis-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 0;
  max-width: 1200px; margin: 0 auto; min-height: 80vh;
  position: relative;
}

/* Sticky category tabs */
.sticky-tabs {
  position: sticky; top: 68px; z-index: 50;
  background: var(--cream); padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; gap: .5rem; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none;
}
.sticky-tabs::-webkit-scrollbar { display: none; }

/* Menu col */
.menu-col { padding-bottom: 2rem; }
.siparis-cat-section { padding: 1.5rem 1.5rem 0; }
.siparis-cat-title {
  font-family: var(--font-serif); font-size: 1.3rem;
  color: var(--text-dark); margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--green-200);
}
.siparis-product-list { display: flex; flex-direction: column; gap: .6rem; }
.siparis-product-card {
  display: flex; align-items: center; gap: .9rem;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; padding: .7rem 1rem;
  transition: border-color .2s;
}
.siparis-product-card.in-cart { border-color: var(--green-400); }
.siparis-product-img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.siparis-product-img-placeholder {
  width: 60px; height: 60px; background: var(--green-100); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.siparis-product-info { flex: 1; min-width: 0; }
.siparis-product-name  { font-weight: 600; font-size: .95rem; }
.siparis-product-desc  { font-size: .8rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.siparis-product-price { font-weight: 700; color: var(--green-600); font-size: .95rem; margin-top: .2rem; }
.siparis-product-controls { flex-shrink: 0; }
.qty-control { display: flex; align-items: center; gap: .4rem; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--green-400);
  background: #fff; color: var(--green-600); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; line-height: 1;
}
.qty-btn:hover  { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.qty-btn:active { transform: scale(.9); }
.qty-num { font-weight: 700; min-width: 20px; text-align: center; font-size: .95rem; }

/* ===== CART SIDEBAR (desktop) ===== */
.cart-sidebar {
  background: #fff; border-left: 1px solid var(--border);
  position: sticky; top: 68px; height: calc(100vh - 68px);
  overflow-y: auto; display: flex; flex-direction: column;
}
.cart-sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 1.25rem; }
.cart-title { font-family: var(--font-serif); font-size: 1.1rem; margin-bottom: 1rem; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-empty { color: var(--text-light); font-size: .9rem; text-align: center; padding: 2rem 0; }
.cart-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.cart-item-name  { flex: 1; font-weight: 500; }
.cart-item-price { font-weight: 700; color: var(--green-600); font-size: .875rem; flex-shrink: 0; }
.cart-item-controls { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.cart-item-controls .qty-btn { width: 24px; height: 24px; font-size: .9rem; }
.cart-footer { padding-top: .9rem; border-top: 1px solid var(--border); margin-top: .5rem; }
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .95rem; margin-bottom: .75rem;
}
.cart-total-row strong { font-size: 1.1rem; color: var(--green-600); }
.btn-block { width: 100%; justify-content: center; }

/* ===== MOBILE CART ===== */
.mobile-cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--green-500);
  padding: .75rem 1.25rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}
.mobile-cart-btn {
  width: 100%; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: .75rem;
  color: #fff; font-family: inherit; font-size: .95rem; font-weight: 600;
}
.mobile-cart-count { flex: 1; text-align: left; opacity: .85; }
.mobile-cart-total { font-size: 1.05rem; font-weight: 700; }

.mobile-cart-panel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: #fff; border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.15);
  transform: translateY(100%); transition: transform .3s ease;
  max-height: 80vh; display: flex; flex-direction: column;
}
.mobile-cart-panel.open { transform: translateY(0); }
.mobile-cart-panel-inner { display: flex; flex-direction: column; max-height: 80vh; overflow: hidden; }
.mobile-cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem .5rem; border-bottom: 1px solid var(--border);
}
.mobile-cart-header h3 { font-family: var(--font-serif); font-size: 1.1rem; }
.mobile-cart-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-mid); }
.mobile-cart-panel .cart-items { padding: .5rem 1.25rem; overflow-y: auto; flex: 1; }
.mobile-cart-panel .cart-footer { padding: .75rem 1.25rem 1.25rem; border-top: 1px solid var(--border); }

.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 250;
  display: none; opacity: 0; transition: opacity .3s;
}
.cart-overlay.open { display: block; opacity: 1; }

/* CONFIRM MODAL */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.confirm-overlay.visible { display: flex; }
.confirm-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: confirmPop .22s cubic-bezier(.34,1.56,.64,1);
}
@keyframes confirmPop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.confirm-modal-head {
  padding: 1.4rem 1.25rem .85rem;
  text-align: center;
  border-bottom: 1px solid var(--green-200);
}
.confirm-modal-icon  { font-size: 2.2rem; margin-bottom: .4rem; }
.confirm-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }
.confirm-items-box {
  margin: .85rem 1.25rem;
  background: #f8fbf9;
  border: 1.5px solid var(--green-200);
  border-radius: 12px;
  padding: .65rem .85rem;
  max-height: 190px;
  overflow-y: auto;
  font-size: .85rem;
}
.confirm-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .18rem 0;
  gap: .5rem;
}
.confirm-item-qty  { font-weight: 700; color: var(--green-600); min-width: 1.8rem; flex-shrink: 0; }
.confirm-item-name { flex: 1; color: var(--text-dark); }
.confirm-item-price{ color: var(--text-mid); flex-shrink: 0; }
.confirm-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: .92rem;
  margin-top: .45rem;
  padding-top: .45rem;
  border-top: 1.5px solid var(--green-200);
  color: var(--green-600);
}
.confirm-modal-actions {
  padding: .15rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.btn-cancel-order {
  background: none;
  border: 1.5px solid #fca5a5;
  color: #dc2626;
  padding: .65rem 1rem;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
}
.btn-cancel-order:hover { background: #fef2f2; }

/* RATE LIMIT ERROR */
.rate-error-bar {
  background: #fef2f2; border-bottom: 2px solid #fca5a5;
  color: #991b1b; padding: .75rem 1.5rem;
  font-size: .9rem; font-weight: 600; text-align: center;
}

/* IP CONFIRM */
.ip-confirm-box { text-align: center; padding: 1rem 0; }
.ip-confirm-icon { font-size: 3rem; margin-bottom: .75rem; }
.ip-confirm-box h2 { font-family: var(--font-serif); font-size: 1.35rem; margin-bottom: .75rem; }
.ip-confirm-box p  { color: var(--text-mid); margin-bottom: 1rem; }
.ip-confirm-info {
  background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: 8px; padding: .75rem 1rem; font-size: .9rem; margin-bottom: 1.25rem;
}
.ip-confirm-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .siparis-layout { grid-template-columns: 1fr; }
  .cart-sidebar { display: none; } /* hidden on mobile, use bottom panel */
  .siparis-cat-section { padding: 1rem 1rem 0; }
  .siparis-product-card { padding: .6rem .75rem; }
}
