/* ================================================================
 * İVA SUSHI — SEPET STİLLERİ
 * Sitenin mevcut palet ve tipografisini kullanır.
 * ================================================================ */

/* ----------------------------------------------------------------
 * SEPETE EKLE BUTONU (ürün kartı / detay sayfası)
 * ---------------------------------------------------------------- */
.cart-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red, #c0392b);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  border-radius: 0;
}
.cart-add-btn:hover {
  background: #a32d22;
  transform: translateY(-1px);
}
.cart-add-btn:active { transform: translateY(0); }
.cart-add-btn.in-cart {
  background: #2a6e3d;
}
.cart-add-btn.in-cart:hover { background: #1e5530; }
.cart-add-btn svg { flex-shrink: 0; }

/* Ürün kartı içindeki sepete ekle - daha küçük */
.product-card .cart-add-btn-mini {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red, #c0392b);
  color: #fff;
  border: none;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.product-card { position: relative; }
.product-card .cart-add-btn-mini:hover {
  background: #a32d22;
  transform: scale(1.1);
}
.product-card .cart-add-btn-mini.in-cart {
  background: #2a6e3d;
}
.product-card .cart-add-btn-mini.in-cart::after {
  content: attr(data-qty);
  position: absolute;
  top: -6px;
  right: -6px;
  background: #fff;
  color: #2a6e3d;
  font-size: 11px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------------------------------------------------------
 * MASAÜSTÜ — SAĞ ALT YUVARLAK BUTON (FAB)
 * ---------------------------------------------------------------- */
#iva-cart-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--red, #c0392b);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 998;
  transition: all 0.2s ease;
}
#iva-cart-fab.has-items {
  display: flex;
}
#iva-cart-fab:hover {
  transform: scale(1.05);
  background: #a32d22;
}
#iva-cart-fab svg {
  width: 24px;
  height: 24px;
}
.cart-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fff;
  color: var(--red, #c0392b);
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--red, #c0392b);
}

/* WhatsApp yüzen butonunu sepet varsa biraz yukarı kaydır */
body.iva-cart-has-items .wa-fixed {
  bottom: 92px;
}

/* ----------------------------------------------------------------
 * MOBİL — SABİT ALT BANT
 * ----------------------------------------------------------------
 * Mobilde: display:flex (her zaman flex), transform ile gizle/göster
 * Masaüstünde: display:none (media query ile)
 * ---------------------------------------------------------------- */
#iva-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--red, #c0392b);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 997;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
  transform: translateY(110%);
  transition: transform 0.3s ease;
  font-family: 'DM Sans', sans-serif;
  /* iOS safe-area desteği */
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
#iva-cart-bar.active {
  transform: translateY(0);
}
.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.cart-bar-count {
  background: #fff;
  color: var(--red, #c0392b);
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-bar-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.cart-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-bar-total {
  font-size: 15px;
  font-weight: 600;
}
.cart-bar-arrow {
  font-size: 18px;
  opacity: 0.8;
}

/* Mobilde sepet bandı varken WhatsApp yüzen butonu gizle */
@media (max-width: 768px) {
  #iva-cart-fab { display: none !important; }
  body.iva-cart-active .wa-fixed {
    bottom: 76px;
  }
}

/* Masaüstünde alt bant tamamen gizli */
@media (min-width: 769px) {
  #iva-cart-bar {
    display: none !important;
  }
}

/* ----------------------------------------------------------------
 * SEPET PANELİ (overlay + drawer)
 * ---------------------------------------------------------------- */
#iva-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1000;
}
#iva-cart-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

#iva-cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #0f0f0d;
  color: var(--cream, #f4ecd8);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}
#iva-cart-panel.open {
  transform: translateX(0);
}

.cart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 0.5px solid rgba(244, 236, 216, 0.15);
  flex-shrink: 0;
}
.cart-panel-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
}
.cart-panel-close {
  background: none;
  border: none;
  color: var(--cream, #f4ecd8);
  font-size: 26px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.cart-panel-close:hover { opacity: 1; }

#iva-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Boş sepet durumu */
.cart-empty {
  text-align: center;
  padding: 60px 24px;
  opacity: 0.7;
}
.cart-empty-icon { font-size: 48px; margin-bottom: 16px; }
.cart-empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  margin-bottom: 8px;
}
.cart-empty-hint { font-size: 13px; color: rgba(244, 236, 216, 0.6); }

/* Sepet ürünleri */
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 0.5px solid rgba(244, 236, 216, 0.08);
  align-items: center;
}
.cart-item-img {
  width: 64px;
  height: 64px;
  background: rgba(244, 236, 216, 0.05) center/cover;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-img.no-img {
  font-size: 24px;
  color: rgba(244, 236, 216, 0.3);
}
.cart-item-info {
  min-width: 0;
}
.cart-item-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price {
  font-size: 12px;
  color: rgba(244, 236, 216, 0.6);
  margin-bottom: 10px;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border: 0.5px solid rgba(244, 236, 216, 0.25);
  background: transparent;
  color: var(--cream, #f4ecd8);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}
.qty-btn:hover {
  background: rgba(244, 236, 216, 0.1);
  border-color: rgba(244, 236, 216, 0.5);
}
.qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
}
.cart-item-remove {
  background: none;
  border: none;
  color: rgba(244, 236, 216, 0.4);
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
  padding: 4px 8px;
  transition: color 0.2s;
}
.cart-item-remove:hover { color: var(--red, #c0392b); }
.cart-item-total {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--red, #c0392b);
  text-align: right;
  white-space: nowrap;
}

/* Footer (toplam + butonlar) */
#iva-cart-footer {
  padding: 20px 24px 24px;
  border-top: 0.5px solid rgba(244, 236, 216, 0.15);
  flex-shrink: 0;
  background: #0f0f0d;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 0.5px solid rgba(244, 236, 216, 0.1);
}
.cart-total-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244, 236, 216, 0.6);
  font-family: 'DM Sans', sans-serif;
}
.cart-total-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--cream, #f4ecd8);
}
.cart-send-btn {
  width: 100%;
  background: #25D366;
  color: #fff;
  border: none;
  padding: 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.cart-send-btn:hover { background: #1ea952; }
.cart-clear-btn {
  width: 100%;
  background: transparent;
  color: rgba(244, 236, 216, 0.5);
  border: 0.5px solid rgba(244, 236, 216, 0.15);
  padding: 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.cart-clear-btn:hover {
  color: var(--cream, #f4ecd8);
  border-color: rgba(244, 236, 216, 0.4);
}

/* ----------------------------------------------------------------
 * "EKLENDİ" FLASH MESAJI
 * ---------------------------------------------------------------- */
.cart-flash {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #2a6e3d;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.05em;
  z-index: 1002;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.cart-flash.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ----------------------------------------------------------------
 * KÜÇÜK EKRAN AYARLAMALARI
 * ---------------------------------------------------------------- */
@media (max-width: 480px) {
  #iva-cart-panel { max-width: 100%; }
  .cart-panel-title { font-size: 24px; }
  .cart-item {
    grid-template-columns: 56px 1fr auto;
    padding: 14px 18px;
    gap: 12px;
  }
  .cart-item-img { width: 56px; height: 56px; }
  .cart-total-value { font-size: 28px; }
}
