/* ====================================================
   CART PAGE — cart-page.css
   Matches karaca.com cart design, mobile-first, SVG icons
   ==================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f7;
  color: #1a1a1a;
  font-size: 14px;
  padding-bottom: 90px;
}

/* ===== HEADER ===== */
.cp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.cp-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}
.cp-back-btn:hover { background: #f5f5f5; }

.cp-tabs {
  flex: 1;
  display: flex;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 3px;
}

.cp-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.cp-tab.active {
  background: #fff;
  color: #1a1a1a;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.cp-tab svg { flex-shrink: 0; }

.cp-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s;
}
.cp-clear-btn:hover { color: #e74c3c; background: #fff5f5; }

/* ===== MAIN ===== */
.cp-main { padding: 12px 0 0; }

/* ===== EMPTY STATE ===== */
.cp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  text-align: center;
}
.cp-empty h2 { font-size: 20px; font-weight: 700; color: #333; }
.cp-empty p { font-size: 14px; color: #aaa; }
.cp-browse-btn {
  display: inline-block;
  background: #27ae60;
  color: #fff;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  transition: background 0.2s;
}
.cp-browse-btn:hover { background: #219653; }

/* ===== LOVE BANNER ===== */
.cp-love-banner {
  margin: 0 12px 6px;
  background: #fff;
  border: 1.5px solid #ffd6d6;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cp-love-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.cp-love-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #fff0f0, #ffe0e0);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cp-love-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cp-love-text strong { font-size: 13px; font-weight: 700; color: #1a1a1a; }
.cp-love-text span { font-size: 12px; color: #666; }
.cp-love-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.2s;
}
.cp-love-btn:hover { background: #c0392b; }
.cp-love-sub {
  font-size: 11px;
  color: #aaa;
  padding: 0 12px 12px 16px;
}

/* ===== SECTION ===== */
.cp-section { background: #fff; margin-bottom: 10px; }
.cp-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  padding: 14px 16px 10px;
}

/* ===== DISCOUNT STRIP ===== */
.cp-discount-strip {
  display: flex;
  gap: 10px;
  padding: 0 16px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cp-discount-strip::-webkit-scrollbar { display: none; }

.cp-disc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 200px;
  flex-shrink: 0;
}
.cp-disc-img {
  width: 52px; height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #fafafa;
  flex-shrink: 0;
}
.cp-disc-info { flex: 1; min-width: 0; }
.cp-disc-name {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.cp-disc-prices { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cp-disc-old { font-size: 11px; color: #bbb; text-decoration: line-through; }
.cp-disc-new { font-size: 13px; font-weight: 700; color: #e74c3c; }
.cp-disc-add {
  background: none;
  border: 1.5px solid #e74c3c;
  color: #e74c3c;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: all 0.2s;
}
.cp-disc-add:hover { background: #e74c3c; color: #fff; }

/* ===== CART ITEMS ===== */
.cp-items-wrapper { display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }

.cp-brand-group {
  background: #fff;
}

.cp-brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f5f5f5;
}
.cp-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
}
.cp-brand-info {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  display: flex; align-items: center;
  padding: 0;
}

.cp-cart-item {
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
}
.cp-cart-item:last-child { border-bottom: none; }

.cp-item-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cp-item-img {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 10px;
  background: #fafafa;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
}

.cp-item-details { flex: 1; min-width: 0; }

.cp-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cp-item-delivery {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}
.cp-item-delivery svg { flex-shrink: 0; color: #aaa; }

.cp-item-free {
  font-size: 12px;
  font-weight: 600;
  color: #27ae60;
  margin-bottom: 10px;
}

/* Quantity & Remove row */
.cp-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.cp-qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}
.cp-qty-btn {
  background: none;
  border: none;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  transition: background 0.15s;
  font-family: inherit;
}
.cp-qty-btn:hover { background: #f5f5f5; }
.cp-qty-btn:active { background: #eee; }
.cp-qty-num {
  min-width: 36px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
}

.cp-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  display: flex; align-items: center;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}
.cp-remove-btn:hover { color: #e74c3c; background: #fff5f5; }

/* Warranty row */
.cp-warranty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cp-warranty-row:hover { border-color: #27ae60; }
.cp-warranty-row svg { color: #555; flex-shrink: 0; }
.cp-warranty-text {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  flex: 1;
}
.cp-warranty-arrow { color: #aaa; }

/* Item price row */
.cp-item-price-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.cp-item-savings {
  font-size: 12px;
  color: #27ae60;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cp-item-savings svg { color: #27ae60; }
.cp-item-final-price {
  font-size: 17px;
  font-weight: 800;
  color: #1a1a1a;
}

/* ===== BOTTOM ORDER BAR ===== */
.cp-order-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-order-left { flex: 1; min-width: 0; }

.cp-total-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.cp-total-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}
.cp-total-price {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.2;
}
.cp-savings {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #27ae60;
  margin-top: 2px;
}
.cp-savings svg { transform: rotate(180deg); }

.cp-checkout-btn {
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}
.cp-checkout-btn:hover { background: #219653; }
.cp-checkout-btn:active { transform: scale(0.98); }

/* ===== SUMMARY PANEL ===== */
.cp-summary-panel {
  position: fixed;
  bottom: 72px; left: 0; right: 0;
  z-index: 190;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 16px 20px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.cp-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #555;
}
.cp-summary-row.green { color: #27ae60; }
.cp-summary-row.bold { font-size: 16px; font-weight: 800; color: #1a1a1a; }
.cp-summary-row .green { color: #27ae60; }
.cp-summary-divider {
  border-top: 1px dashed #eee;
  margin: 6px 0;
}

/* ===== TOAST ===== */
#cartToast {
  position: fixed;
  bottom: -80px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}
#cartToast.show { bottom: 90px; }
.cart-toast-inner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #27ae60, #219653);
  color: #fff; padding: 14px 22px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(39,174,96,0.4);
  min-width: 240px;
}
.cart-toast-icon {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cart-toast-text { display: flex; flex-direction: column; gap: 2px; }
.cart-toast-text strong { font-size: 13px; }
.cart-toast-text span { font-size: 12px; opacity: 0.85; }

/* ===== DESKTOP ===== */
@media (min-width: 900px) {
  body { max-width: 560px; margin: 0 auto; }
}

@media (max-width: 380px) {
  .cp-tab { font-size: 12px; padding: 8px 8px; }
  .cp-item-img { width: 68px; height: 68px; }
  .cp-checkout-btn { font-size: 14px; padding: 13px 16px; }
}
