/* ═══════════════════════════════════════════
   CART — Kahraman Yönetim ve Danışmanlık
   ═══════════════════════════════════════════ */

body.cart-open,
body.checkout-open { overflow: hidden; }

/* ─────────────────────────────────────────────
   SERVICE CARD FOOTER
───────────────────────────────────────────── */
.service-card-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.service-price {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 5.5rem;
}

.svc-qty-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-mid);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--navy); color: #fff; }

.svc-qty-val,
.cart-qty-val {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
  user-select: none;
}

.btn-add-cart {
  flex: 1;
  min-width: 110px;
  padding: .5rem 1rem;
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform .15s;
  white-space: nowrap;
  text-align: center;
}
.btn-add-cart:hover { background: var(--teal); border-color: var(--teal); }
.btn-add-cart.added {
  background: #27ae60;
  border-color: #27ae60;
  transform: scale(.97);
}

/* ─────────────────────────────────────────────
   FLOATING CART BUTTON
───────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 58px;
  height: 58px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(27, 45, 94, .38);
  z-index: 1100;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.cart-fab:hover {
  background: var(--teal);
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(26, 86, 104, .45);
}
.cart-fab svg { width: 24px; height: 24px; }

.cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body);
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
  border: 2px solid #fff;
}
.cart-badge.visible { display: flex; }

/* ─────────────────────────────────────────────
   CART OVERLAY
───────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, .52);
  backdrop-filter: blur(2px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

/* ─────────────────────────────────────────────
   CART DRAWER
───────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 48px rgba(27, 45, 94, .18);
}
.cart-drawer.open { transform: translateX(0); }

/* Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
}
.cart-drawer-header h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
}
.cart-drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}
.cart-drawer-close:hover { background: rgba(255, 255, 255, .3); }

/* Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  text-align: center;
  gap: .75rem;
}
.cart-empty p {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--text-mid);
}
.cart-empty span { font-size: .85rem; color: var(--text-light); }

/* Cart Item */
.cart-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 0;
  border-bottom: 1px solid var(--bg-alt);
}
.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-item-price { font-size: .78rem; color: var(--text-light); margin-top: .15rem; }

.cart-item-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cart-item-subtotal {
  font-weight: 700;
  font-size: .875rem;
  color: var(--navy);
  min-width: 4.5rem;
  text-align: right;
  white-space: nowrap;
}

.cart-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.cart-item-remove:hover { color: #e53e3e; background: #fff5f5; }

/* Drawer Footer */
.cart-drawer-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  flex-shrink: 0;
}

.cart-totals { margin-bottom: 1rem; }
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--text-mid);
  padding: .2rem 0;
}
.cart-grand-total {
  font-size: 1rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: .4rem;
  padding-top: .6rem;
}
.cart-grand-total strong { color: var(--navy); font-size: 1.1rem; }

/* ─────────────────────────────────────────────
   CHECKOUT MODAL
───────────────────────────────────────────── */
.checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, .55);
  backdrop-filter: blur(3px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.checkout-overlay.open { opacity: 1; visibility: visible; }

.checkout-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.checkout-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-mid);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.checkout-close:hover { background: var(--border); color: var(--text); }

.checkout-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}

/* Order Summary */
.checkout-summary {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.checkout-summary h4 {
  font-family: var(--font-head);
  font-size: .95rem;
  color: var(--navy);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.co-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--text-mid);
  padding: .28rem 0;
}
.co-vat {
  border-top: 1px solid var(--border);
  margin-top: .3rem;
  padding-top: .5rem;
}
.co-total {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  border-top: 2px solid var(--navy);
  margin-top: .4rem;
  padding-top: .6rem;
}
.co-total strong { color: var(--navy); }

#checkoutSuccess {
  display: none;
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #276749;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-weight: 500;
  text-align: center;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 640px) {
  .cart-fab { bottom: 1.25rem; right: 1.25rem; width: 52px; height: 52px; }
  .cart-fab svg { width: 20px; height: 20px; }
  .cart-drawer { width: 100vw; }

  .service-card-footer { gap: .5rem; }
  .btn-add-cart { width: 100%; }

  .checkout-box { padding: 1.5rem; }

  .cart-item-subtotal { min-width: 3.5rem; }
}

/* ─────────────────────────────────────────────
   SERVICE CARD (kartın tamamı tıklanabilir)
───────────────────────────────────────────── */
.service-card[data-service-id] { cursor: pointer; }
.service-card-footer { cursor: default; }

/* ─────────────────────────────────────────────
   SERVICE DETAIL MODAL
───────────────────────────────────────────── */
body.svc-modal-open { overflow: hidden; }

.svc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, .55);
  backdrop-filter: blur(3px);
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.svc-modal-overlay.open { opacity: 1; visibility: visible; }

.svc-modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.svc-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 1.75rem 2rem 1.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.svc-modal-header .tag {
  background: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: .7rem;
  letter-spacing: .12em;
  padding: .25rem .75rem;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: .75rem;
}
.svc-modal-title {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  padding-right: 2.5rem;
  line-height: 1.25;
}
.svc-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .18);
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}
.svc-modal-close:hover { background: rgba(255, 255, 255, .32); }

.svc-modal-body { padding: 1.75rem 2rem; }
.svc-modal-detail {
  font-size: .9375rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.svc-modal-scope h4 {
  font-family: var(--font-head);
  font-size: .95rem;
  color: var(--navy);
  margin-bottom: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.svc-modal-scope h4::before {
  content: '';
  display: block;
  width: 3px;
  height: 1rem;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}
.svc-modal-scope ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.svc-modal-scope li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .875rem;
  color: var(--text-mid);
  line-height: 1.55;
}
.svc-modal-scope li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.svc-modal-footer {
  padding: 1.5rem 2rem 2rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.svc-modal-price-row,
.svc-modal-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.svc-modal-label {
  font-size: .78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 500;
}
.svc-modal-price {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}
.svc-modal-actions { display: flex; gap: .75rem; }
.svc-modal-btn-cart,
.svc-modal-btn-buy {
  flex: 1;
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.svc-modal-btn-cart { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.svc-modal-btn-cart:hover { background: var(--navy); color: #fff; }
.svc-modal-btn-buy { background: var(--navy); border: 2px solid var(--navy); color: #fff; }
.svc-modal-btn-buy:hover { background: var(--teal); border-color: var(--teal); }

@media (max-width: 640px) {
  .svc-modal-header { padding: 1.5rem 1.5rem 1.25rem; }
  .svc-modal-title { font-size: 1.35rem; }
  .svc-modal-body { padding: 1.25rem 1.5rem; }
  .svc-modal-footer { padding: 1.25rem 1.5rem 1.5rem; }
  .svc-modal-actions { flex-direction: column; }
}
