/* ========================================================
   İLİM KİTABEVİ - MODERN & LÜKS ALIŞVERİŞ SEPETİ (CART DRAWER)
   ======================================================== */

/* Karartma Katmanı (Backdrop) */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Sepet Çekmecesi */
#cart-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: min(94vw, 448px);
  height: 100vh;
  height: 100dvh;
  background: #FFFFFF;
  color: #18222F;
  box-shadow: -12px 0 40px rgba(24, 34, 47, 0.18);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.01em;
  /* Tek kaydırma alanı: hediye kutusu + ürünler birlikte kayar,
     başlık ve alt özet yapışkan kalır; kısa ekranlarda liste sıkışmaz. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#cart-drawer > * {
  flex-shrink: 0;
}

#cart-drawer.open {
  right: 0;
}

/* Başlık Alanı */
.cart-header {
  padding: 20px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5DFD5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 3;
}

.cart-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-header-icon {
  font-size: 20px;
  color: #18222F;
}

.cart-header h3 {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #18222F;
  margin: 0;
}

.cart-count-badge {
  font-size: 12px;
  font-weight: 600;
  background: #FAF8F5;
  color: #64748B;
  border: 1px solid #E5DFD5;
  padding: 2px 9px;
  border-radius: 9999px;
}

.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #94A3B8;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cart-close-btn:hover {
  background: #FAF8F5;
  border-color: #E5DFD5;
  color: #18222F;
}

/* Kargo & Promosyon İlerleme Çubuğu */
.cart-promo-banner {
  padding: 14px 24px;
  background: #FAF8F5;
  border-bottom: 1px solid #E5DFD5;
  flex-shrink: 0;
}

.cart-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-progress-text strong {
  color: #18222F;
  font-weight: 800;
}

.cart-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #E5DFD5;
  border-radius: 9999px;
  overflow: hidden;
}

.cart-progress-bar-fill {
  height: 100%;
  background: #18222F;
  border-radius: 9999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hediye Kitap Seçim Alanı */
.cart-gift-box {
  margin: 16px 24px 0;
  padding: 16px;
  background: #FAF8F5;
  border: 1px solid #E5DFD5;
  border-radius: 16px;
}

.cart-gift-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cart-gift-header-title {
  color: #18222F;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.06em;
}

.cart-gift-badge {
  white-space: nowrap;
  flex-shrink: 0;
  background: #18222F;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cart-gift-desc {
  font-size: 12px;
  color: #475569;
  margin: 0 0 12px;
  line-height: 1.5;
}

.cart-gift-select-wrap {
  position: relative;
  margin-bottom: 10px;
}

.cart-gift-select {
  width: 100%;
  padding: 10px 34px 10px 12px;
  background: #FFFFFF;
  color: #18222F;
  border: 1px solid #E5DFD5;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cart-gift-select:focus {
  border-color: #18222F;
  box-shadow: 0 0 0 3px rgba(24, 34, 47, 0.08);
}

.cart-gift-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #64748B;
  font-size: 11px;
}

.btn-add-gift {
  width: 100%;
  padding: 10px 14px;
  background: #18222F;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-add-gift:hover {
  background: #000000;
}

.btn-add-gift:active {
  transform: scale(0.99);
}

/* Hediye kitap seçimi: kapaklı kartlar */
.cart-gift-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-gift-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: #FFFFFF;
  border: 1px solid #E5DFD5;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: #18222F;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cart-gift-option:hover,
.cart-gift-option:focus-visible {
  border-color: #18222F;
  box-shadow: 0 0 0 3px rgba(24, 34, 47, 0.08);
  outline: none;
}

.cart-gift-option-thumb {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #FAF8F5;
  border: 1px solid #E5DFD5;
}

.cart-gift-option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-gift-option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-gift-option-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-gift-option-author {
  font-size: 11px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-gift-option-cta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 9999px;
  background: #18222F;
  color: #FFFFFF;
}

/* Hediye seçilmeden ödemeye geçilmek istenirse dikkat çek */
.cart-gift-box-attention {
  animation: cartGiftPulse 0.9s ease 2;
}

@keyframes cartGiftPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); border-color: #E5DFD5; }
  50% { box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.25); border-color: #059669; }
}

/* Seçili Hediye Kartı */
.cart-gift-active-card {
  margin: 16px 24px 0;
  padding: 12px 16px;
  background: #FAF8F5;
  border: 1px solid #E5DFD5;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-gift-active-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-gift-active-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.cart-gift-active-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #18222F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.cart-gift-active-sub {
  font-size: 11px;
  color: #059669;
  font-weight: 600;
}

.btn-remove-gift {
  background: #FFFFFF;
  border: 1px solid #E5DFD5;
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-remove-gift:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

/* Ürün Listesi */
.cart-items {
  flex: 1 0 auto;
  overflow: visible;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #FFFFFF;
}

/* Ürün Kartı */
.cart-item {
  flex-shrink: 0;
  display: flex;
  gap: 14px;
  padding: 12px;
  background: #FAF8F5;
  border: 1px solid #E5DFD5;
  border-radius: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cart-item:hover {
  border-color: #D5CCC0;
  box-shadow: 0 4px 14px rgba(24, 34, 47, 0.05);
}

/* Ürün Görseli */
.cart-item-thumb {
  width: 42px;
  height: 58px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #FFFFFF;
  border: 1px solid #E5DFD5;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ürün Detayları */
.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cart-item-title {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #18222F;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-meta {
  font-size: 11px;
  color: #64748B;
  margin: 3px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-remove-btn {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.cart-item-remove-btn:hover {
  color: #E11D48;
  background: rgba(225, 29, 72, 0.08);
}

/* Alt Satır: Adet Stepper & Fiyat */
.cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

/* Miktar Kontrolü Stepper */
.cart-qty-stepper {
  display: inline-flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #E5DFD5;
  border-radius: 8px;
  padding: 2px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #64748B;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.qty-btn:hover:not(:disabled) {
  background: #18222F;
  color: #FFFFFF;
}

.qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-val {
  min-width: 26px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #18222F;
  font-variant-numeric: tabular-nums;
}

/* Fiyat Bölümü */
.cart-item-pricing {
  text-align: right;
}

.cart-item-total-price {
  font-size: 14px;
  font-weight: 800;
  color: #18222F;
  font-variant-numeric: tabular-nums;
}

.cart-item-unit-price {
  display: block;
  font-size: 10.5px;
  color: #94A3B8;
}

/* Hediye Kartı Farkı */
.cart-item-gift {
  background: #FAF8F5;
  border: 1px dashed #CBD5E1;
}

.gift-item-tag {
  background: #059669;
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cart-gift-free-price {
  color: #059669;
  font-weight: 800;
  font-size: 13px;
}

.cart-gift-free-price small {
  color: #64748B;
  font-weight: 500;
  font-size: 10.5px;
  margin-left: 4px;
}

/* Boş Sepet Tasarımı */
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  margin: auto 0;
}

.cart-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background: #FAF8F5;
  border: 1px solid #E5DFD5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  color: #94A3B8;
}

.cart-empty-title {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #18222F;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.cart-empty-sub {
  font-size: 12.5px;
  color: #64748B;
  max-width: 260px;
  margin: 0 0 20px;
  line-height: 1.55;
}

.btn-explore-books {
  padding: 11px 24px;
  background: #18222F;
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-explore-books:hover {
  background: #000000;
  transform: translateY(-1px);
}

/* Alt Özet & Sipariş Alanı */
.cart-footer {
  padding: 20px 24px;
  background: #FAF8F5;
  border-top: 1px solid #E5DFD5;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 3;
  box-shadow: 0 -8px 20px rgba(24, 34, 47, 0.06);
}

.cart-summary-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.cart-free-badge {
  color: #059669;
  font-weight: 700;
}

.cart-summary-row.cart-total-row {
  font-size: 14px;
  font-weight: 700;
  color: #18222F;
  border-top: 1px solid #E5DFD5;
  padding-top: 10px;
  margin-top: 4px;
}

.cart-summary-row.cart-total-row #cart-total-price {
  color: #18222F;
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Sipariş Butonu */
.checkout-btn {
  width: 100%;
  height: 52px;
  background: #18222F;
  color: #FFFFFF;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 10px 24px rgba(24, 34, 47, 0.18);
}

.checkout-btn:hover {
  background: #000000;
  box-shadow: 0 14px 28px rgba(24, 34, 47, 0.26);
}

.checkout-btn:active {
  transform: scale(0.98);
}

.checkout-btn-arrow {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.checkout-btn:hover .checkout-btn-arrow {
  transform: translateX(4px);
}

/* Güven Rozetleri */
.cart-trust-badges {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #E5DFD5;
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
}

/* Mobil Uyum */
@media (max-width: 480px) {
  #cart-drawer {
    width: 100% !important;
    max-width: 100% !important;
    right: -100%;
  }
  .cart-header {
    padding: 16px 18px;
  }
  .cart-promo-banner {
    padding: 12px 18px;
  }
  .cart-items {
    padding: 14px 16px;
    gap: 12px;
  }
  .cart-gift-box,
  .cart-gift-active-card {
    margin: 12px 16px 0;
    padding: 12px 14px;
  }
  .cart-footer {
    padding: 16px 18px;
  }
  .checkout-btn {
    height: 48px;
    font-size: 11.5px;
  }
}

/* Kısa ekranlar: alt özet alanını sıkılaştır, ürünlere yer aç */
@media (max-height: 760px) {
  .cart-header { padding-top: 14px; padding-bottom: 14px; }
  .cart-promo-banner { padding-top: 10px; padding-bottom: 10px; }
  .cart-footer { padding-top: 14px; padding-bottom: 14px; }
  .cart-summary-card { gap: 4px; margin-bottom: 12px; }
  .cart-summary-row.cart-total-row { padding-top: 8px; }
  .checkout-btn { height: 46px; }
  .cart-trust-badges { display: none; }
}
