/* Sipariş talebi (misafir): satır ve kart "Ekle" denetimi, alt dok (durum + sepet çubuğu), sepet sayfası.
   Değişkenler menu.css'ten gelir. Yalnız QR'lı oturumda (html.sepet-var) görünür. Hareket yalnız transform/opacity;
   azaltılmış harekette durur. Satır içi stil yok (CSP); dok yüksekliği JS'ten --dok-y değişkeniyle gelir. */

/* --- Ürün satırı: fiyat satırı 44 px'e çıkar, denetim fotoğrafın soluna, fiyatın hizasına oturur --- */
html.sepet-var { --sepet-foto: 4.75rem; }
html.sepet-var .urun { position: relative; }
html.sepet-var .urun-metin { align-self: stretch; display: flex; flex-direction: column; gap: 0.2rem; }
html.sepet-var .urun-fiyat { display: flex; align-items: center; min-height: 2.75rem; margin-top: auto; }
.sepet-adet--satir { position: absolute; z-index: 1; right: calc(var(--sepet-foto) + 1rem); bottom: 0.7rem; }
.urun--fotosuz .sepet-adet--satir { right: 0; }

/* --- Adet denetimi: "Ekle" hapı ya da [− n +] --- */
.sepet-adet { display: inline-flex; align-items: center; }
.sepet-adet-ekle {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 1.05rem 0 0.85rem; border-radius: 99px;
  background: var(--kagit-ak); color: var(--orman); box-shadow: inset 0 0 0 1.5px var(--orman);
  font: 700 0.9375rem/1 var(--govde); letter-spacing: 0.02em; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, transform 0.15s var(--yay);
}
.sepet-adet-ekle::before { content: ""; width: 0.75rem; height: 0.75rem; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat; }
.sepet-adet-ekle:hover { background: var(--orman); color: var(--altin-acik); }
.sepet-adet-ekle:active { transform: scale(0.95); }
.sepet-adet:not([data-adet="0"]) { border-radius: 99px; background: var(--orman); color: var(--altin-acik); box-shadow: 0 0.6rem 1.1rem -0.8rem rgb(0 34 15 / 0.7); }
.sepet-adet--yeni { animation: sepet-adet-gir 0.3s var(--yay); }
.sepet-adet-dugme { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; font: 600 1.375rem/1 var(--govde); transition: background-color 0.15s, transform 0.15s var(--yay); }
.sepet-adet-dugme:hover { background: rgb(236 217 164 / 0.16); }
.sepet-adet-dugme:active { transform: scale(0.88); }
.sepet-adet-dugme:disabled { opacity: 0.35; cursor: not-allowed; }
.sepet-adet-sayi { min-width: 1.75rem; text-align: center; font: 700 1.0625rem/1 var(--govde); font-variant-numeric: tabular-nums lining-nums; }
.sepet-adet button:focus-visible { outline-offset: 2px; }

/* Ürün kartında tam genişlik */
html.sepet-var .kart-alt { flex-wrap: wrap; row-gap: 0.9rem; }
.sepet-adet--kart { flex-basis: 100%; justify-content: space-between; }
.sepet-adet--kart .sepet-adet-ekle { justify-content: center; width: 100%; min-height: 3.25rem; background: var(--orman); color: var(--altin-acik); box-shadow: inset 0 0 0 1px var(--cizgi-altin); font-size: 1.0625rem; }
.sepet-adet--kart .sepet-adet-ekle:hover { background: var(--orman-koyu); }
.sepet-adet--kart .sepet-adet-dugme { width: 3.25rem; height: 3.25rem; }
.sepet-adet--kart .sepet-adet-sayi { font-size: 1.25rem; }

/* --- Alt dok: talep durumu ve sepet çubuğu; garson çağır düğmesi bunun üstüne kayar --- */
.sepet-dok {
  position: fixed; z-index: 29; display: grid; gap: 0.5rem; max-width: 34rem; margin-inline: auto;
  left: max(0.75rem, env(safe-area-inset-left)); right: max(0.75rem, env(safe-area-inset-right)); bottom: max(0.75rem, env(safe-area-inset-bottom));
  pointer-events: none; transition: transform 0.45s var(--yay), opacity 0.3s ease, visibility 0s linear 0s;
}
.sepet-dok > * { pointer-events: auto; }
.sepet-dok--gizli { opacity: 0; transform: translateY(1.5rem); visibility: hidden; transition: transform 0.45s var(--yay), opacity 0.3s ease, visibility 0s linear 0.45s; }
html.dok-var .cagri:not(.cagri--gizli) { transform: translateY(calc(-1 * (var(--dok-y, 0px) + 0.5rem))); }
html.dok-var .alt { padding-bottom: calc(var(--dok-y, 0px) + 7.5rem + env(safe-area-inset-bottom)); }

.sepet-cubuk {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 0.75rem; width: 100%;
  min-height: 3.5rem; padding: 0.45rem 1.2rem 0.45rem 0.5rem; border-radius: 99px; text-align: left;
  background: var(--orman); color: var(--altin-acik);
  box-shadow: inset 0 0 0 1px var(--cizgi-altin), 0 1rem 1.75rem -0.9rem rgb(0 34 15 / 0.75), 0 0.2rem 0.5rem rgb(0 34 15 / 0.2);
  animation: sepet-gir 0.45s var(--yay); transition: transform 0.25s var(--yay);
}
.sepet-cubuk::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--doku); opacity: 0.16; }
.sepet-cubuk:hover { transform: translateY(-2px); }
.sepet-cubuk:active { transform: scale(0.98); }
.sepet-cubuk:focus-visible { outline: 2px solid var(--altin-koyu); outline-offset: 3px; border-radius: 99px; }
.sepet-cubuk-sayi { flex: none; display: grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.6rem; border-radius: 99px; background: var(--altin-acik); color: var(--orman-koyu); font: 700 1.0625rem/1 var(--govde); font-variant-numeric: tabular-nums; }
.sepet-cubuk-sayi--atla { animation: sepet-atla 0.4s var(--yay); }
.sepet-cubuk-ozet { flex: 1; min-width: 0; font: 600 0.875rem/1.25 var(--govde); color: rgb(236 217 164 / 0.9); text-wrap: balance; }
.sepet-cubuk-git { flex: none; display: inline-flex; align-items: center; gap: 0.5rem; font: 700 1.0625rem/1 var(--baslik); white-space: nowrap; }
.sepet-cubuk-git::after { content: ""; width: 0.5rem; height: 0.5rem; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.25s var(--yay); }
.sepet-cubuk:hover .sepet-cubuk-git::after { transform: translateX(3px) rotate(45deg); }

/* Durum kartı: iletildi (altın nabız) → onaylandı (yeşil nabız) → hazır (yeşil kart) → afiyet olsun; red bordo. */
.sepet-durum {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem;
  min-height: 3.5rem; padding: 0.6rem 0.6rem 0.6rem 1.05rem; border-radius: 1.25rem;
  background: var(--kagit-ak); color: var(--murekkep);
  box-shadow: inset 0 0 0 1px var(--cizgi-altin), 0 1rem 1.75rem -0.9rem rgb(0 34 15 / 0.55);
  animation: sepet-gir 0.45s var(--yay);
}
.sepet-durum:focus { outline: none; }
.sepet-durum:focus-visible { outline: 2px solid var(--altin-koyu); outline-offset: 3px; }
.sepet-durum-nokta { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--altin); animation: sepet-nabiz 1.8s ease-in-out infinite; }
.sepet-durum-metin { display: grid; gap: 0.1rem; min-width: 0; }
.sepet-durum-bas { font: 700 1.0625rem/1.2 var(--baslik); color: var(--orman); }
.sepet-durum-alt { font-size: 0.875rem; line-height: 1.35; color: var(--soluk); overflow-wrap: anywhere; }
.sepet-durum-alt:empty { display: none; }
.sepet-durum-dugme { min-height: 2.75rem; padding: 0 1rem; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--orman); color: var(--orman); font: 700 0.875rem/1 var(--govde); white-space: nowrap; transition: background-color 0.2s, color 0.2s; }
.sepet-durum-dugme:hover { background: var(--orman); color: var(--altin-acik); }
.sepet-durum-dugme:disabled { opacity: 0.5; cursor: progress; }
.sepet-durum[data-durum="onaylandi"] .sepet-durum-nokta { background: var(--orman); animation-duration: 1s; }
.sepet-durum[data-durum="hazir"] { background: var(--orman); box-shadow: inset 0 0 0 1px var(--cizgi-altin), 0 1rem 1.75rem -0.9rem rgb(0 34 15 / 0.75); }
.sepet-durum[data-durum="hazir"] .sepet-durum-bas { color: var(--altin-acik); }
.sepet-durum[data-durum="hazir"] .sepet-durum-alt { color: rgb(236 217 164 / 0.85); }
.sepet-durum[data-durum="hazir"] .sepet-durum-nokta { background: var(--altin-acik); animation-duration: 0.8s; }
.sepet-durum[data-durum="teslim"] .sepet-durum-nokta, .sepet-durum[data-durum="iptal"] .sepet-durum-nokta { background: var(--orman); animation: none; }
.sepet-durum[data-durum="reddedildi"] .sepet-durum-nokta, .sepet-durum[data-durum="hata"] .sepet-durum-nokta { background: var(--bordo); animation: none; }
.sepet-durum[data-durum="reddedildi"] .sepet-durum-bas { color: var(--bordo); }
.sepet-durum[data-durum="reddedildi"] .sepet-durum-alt { color: var(--murekkep); font-weight: 600; }

/* --- Sepet sayfası --- */
.sepet-sayfa {
  width: 100%; max-width: 34rem; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 1.75rem 1.75rem 0 0; background: var(--kagit-ak); color: var(--murekkep); overflow: hidden;
  box-shadow: 0 -1.5rem 3rem -1rem rgb(0 34 15 / 0.45);
}
.sepet-sayfa::backdrop { background: rgb(0 34 15 / 0.74); }
.sepet-sayfa[open] { animation: sepet-sayfa-gir 0.42s var(--yay); }
.sepet-sayfa[open]::backdrop { animation: sepet-perde 0.3s ease-out; }
.sepet-ic { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0.75rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); }
.sepet-ic::before { content: ""; display: block; width: 2.5rem; height: 0.25rem; margin: 0 auto 1.1rem; border-radius: 99px; background: rgb(0 76 36 / 0.22); }
.sepet-masa { display: inline-flex; align-items: center; gap: 0.5rem; font: 700 0.75rem/1 var(--govde); letter-spacing: 0.16em; text-transform: uppercase; color: var(--soluk); }
.sepet-masa::before { content: ""; width: 0.4rem; height: 0.4rem; background: var(--altin); transform: rotate(45deg); }
.sepet-baslik { margin: 0.55rem 0 0; font: 700 1.75rem/1.1 var(--baslik); color: var(--orman); text-wrap: balance; }
.sepet-baslik:focus { outline: none; }
.sepet-bilgi { margin-top: 0.45rem; font-size: 0.9375rem; line-height: 1.45; color: var(--soluk); }
.sepet-liste { margin-top: 1rem; border-bottom: 1px solid var(--cizgi); }
.sepet-kalem { padding: 0.95rem 0 0.85rem; border-top: 1px solid var(--cizgi); }
.sepet-kalem-ust { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.sepet-kalem-ad { font: 600 1.125rem/1.25 var(--baslik); color: var(--murekkep); }
.sepet-kalem-tutar { flex: none; font-weight: 700; color: var(--orman); font-variant-numeric: tabular-nums lining-nums; }
.sepet-kalem-alt { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.55rem; }
.sepet-not-ac { min-height: 2.75rem; padding: 0 0.25rem; font-weight: 700; color: var(--orman); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 0.25em; }
.sepet-not, .sepet-genel-not {
  display: block; width: 100%; min-height: 2.75rem; padding: 0.6rem 0.95rem; border: 1px solid rgb(0 76 36 / 0.3); border-radius: 0.9rem;
  background: var(--kagit); color: var(--murekkep); font: 500 1rem/1.4 var(--govde); resize: none;
}
.sepet-not { margin-top: 0.6rem; }
.sepet-not::placeholder, .sepet-genel-not::placeholder { color: var(--soluk); }
.sepet-not:focus-visible, .sepet-genel-not:focus-visible { outline-offset: 1px; border-color: var(--orman); }
.sepet-bos { padding: 1.5rem 0 0.5rem; text-align: center; font: 600 1.125rem/1.3 var(--baslik); color: var(--soluk); }
.sepet-genel { display: grid; gap: 0.45rem; margin-top: 1.1rem; }
.sepet-etiket { font: 700 0.75rem/1 var(--govde); letter-spacing: 0.14em; text-transform: uppercase; color: var(--soluk); }
.sepet-toplam { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; padding: 0.95rem 1.1rem; border-radius: 1.1rem; background: var(--kagit); box-shadow: inset 0 0 0 1px var(--cizgi-altin); }
.sepet-toplam-sol { display: grid; gap: 0.15rem; }
.sepet-toplam-ad { font: 700 0.9375rem/1.2 var(--govde); color: var(--murekkep); }
.sepet-toplam-alt { font-size: 0.8125rem; color: var(--soluk); }
.sepet-toplam-deger { font: 700 1.5rem/1 var(--govde); color: var(--orman); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.sepet-uyari, .sepet-hata { margin-top: 0.9rem; padding: 0.75rem 1rem; border-radius: 0.9rem; font-weight: 700; line-height: 1.4; }
.sepet-uyari { background: rgb(200 165 90 / 0.18); color: var(--murekkep); }
.sepet-hata { background: rgb(122 31 43 / 0.08); color: var(--bordo); }
.sepet-hata:empty { display: none; }
.sepet-gonder {
  position: relative; isolation: isolate; display: block; width: 100%; min-height: 3.5rem; margin-top: 1rem; border-radius: 99px;
  background: var(--orman); color: var(--altin-acik); font: 700 1.125rem/1 var(--govde); letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px var(--cizgi-altin), 0 1rem 1.5rem -1rem rgb(0 34 15 / 0.7); transition: transform 0.15s var(--yay), background-color 0.2s;
}
.sepet-gonder:hover { background: var(--orman-koyu); }
.sepet-gonder:active { transform: scale(0.98); }
.sepet-gonder:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.sepet-sayfa[aria-busy="true"] .sepet-gonder { cursor: progress; }
.sepet-gonder:focus-visible, .sepet-kapat:focus-visible { border-radius: 99px; }
.sepet-kapat { display: block; width: 100%; min-height: 3rem; margin-top: 0.5rem; border-radius: 99px; font-weight: 700; color: var(--orman); transition: background-color 0.2s; }
.sepet-kapat:hover { background: rgb(0 76 36 / 0.06); }

@keyframes sepet-gir { from { transform: translateY(1rem) scale(0.97); opacity: 0; } }
@keyframes sepet-adet-gir { from { transform: scale(0.85); opacity: 0.4; } }
@keyframes sepet-atla { 40% { transform: scale(1.22); } }
@keyframes sepet-nabiz { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.55); opacity: 0.45; } }
@keyframes sepet-sayfa-gir { from { transform: translateY(2.5rem); opacity: 0; } }
@keyframes sepet-perde { from { opacity: 0; } }

/* Çok dar ekran (320 px): fotoğraf biraz küçülür ki fiyat ile [− n +] aynı satıra sığsın. */
@media (max-width: 22.5rem) {
  html.sepet-var { --sepet-foto: 4.25rem; }
  html.sepet-var .urun-foto { width: var(--sepet-foto); height: var(--sepet-foto); }
  .sepet-cubuk { gap: 0.55rem; padding-right: 1rem; }
  .sepet-cubuk-git { font-size: 1rem; }
}
@media (min-width: 48rem) {
  html.sepet-var { --sepet-foto: 5.5rem; }
  .sepet-sayfa { margin: auto; border-radius: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sepet-dok, .sepet-dok *, .sepet-sayfa, .sepet-sayfa *, .sepet-adet, .sepet-adet * { animation: none !important; transition: none !important; }
  .sepet-sayfa::backdrop { animation: none !important; }
}
@media print {
  .sepet-dok, .sepet-sayfa, .sepet-adet { display: none !important; }
}
