/* ──────────────────────────────────────────
   Custom Cart – Design Tokens
   ────────────────────────────────────────── */
:root {
  /* Colors */
  --cc-primary: #5555F6;
  --cc-primary-hover: #467FF7;
  --cc-secondary: #131347;
  --cc-text: #000000;
  --cc-text-muted: #7A7A9D;
  --cc-text-price-old: #9AA0B4;
  --cc-border: #dcdcdc;
  --cc-bg-page: transparent;
  --cc-bg-card: #FFFFFF;
  --cc-bg-badge: #EEF2FF;
  --cc-bg-thumb: #F3F4FA;
  --cc-danger: #FF3B30;

  /* Typography */
  --cc-font: 'Poppins', sans-serif;

  /* Spacing */
  --cc-gap: 24px;
  --cc-radius-card: 20px;
  --cc-radius-md: 14px;
  --cc-radius-sm: 12px;
  --cc-radius-xs: 8px;
}

/* ──────────────────────────────────────────
   Reset & Page Wrapper
   ────────────────────────────────────────── */
.cc-page,
.cc-page *,
.cc-page *::before,
.cc-page *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.cc-page {
  font-family: var(--cc-font);
  color: var(--cc-text);
  padding: 32px 0;
  min-height: 60vh;
  -webkit-font-smoothing: antialiased;
}

/* ──────────────────────────────────────────
   Container & Grid
   ────────────────────────────────────────── */
.cc-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.cc-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--cc-gap);
  align-items: start;
}

/* ──────────────────────────────────────────
   Shared Card
   ────────────────────────────────────────── */
.cc-card {
  background: var(--cc-bg-card);
  border-radius: var(--cc-radius-card);
  border: 0px solid var(--cc-border);
}

.cc-cart-card {
  padding: 32px;
}

.cc-summary-card {
  padding: 24px;
}

/* ──────────────────────────────────────────
   Title
   ────────────────────────────────────────── */
.cc-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--cc-secondary);
  margin-bottom: 24px;
  line-height: 1.2;
}

/* ──────────────────────────────────────────
   Table Header
   ────────────────────────────────────────── */
.cc-table-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--cc-text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cc-border);
  margin-bottom: 4px;
}

/* ──────────────────────────────────────────
   Cart Item
   ────────────────────────────────────────── */
.cc-item {
  border-bottom: 1px solid var(--cc-border);
  padding: 24px 0;
}

.cc-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cc-item-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Thumbnail */
.cc-item-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--cc-radius-sm);
  background: var(--cc-bg-thumb);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--cc-radius-sm);
}

/* Details */
.cc-item-details {
  flex: 1;
  min-width: 0;
}

.cc-item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cc-secondary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.cc-item-title a {
  color: inherit;
  text-decoration: none;
}

.cc-item-title a:hover {
  color: var(--cc-primary);
}

/* Prices */
.cc-item-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cc-old-price {
  font-size: 14px;
  color: var(--cc-text-price-old);
  text-decoration: line-through;
}

.cc-new-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--cc-secondary);
}

/* Badge */
.cc-badge {
  display: inline-block;
  background: var(--cc-bg-badge);
  color: var(--cc-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--cc-radius-xs);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cc-badge-outline {
  background: transparent;
  border: 1px solid var(--cc-border);
  color: var(--cc-secondary);
}

/* Description */
.cc-item-desc {
  font-size: 14px;
  color: var(--cc-text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions Row */
.cc-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* ──────────────────────────────────────────
   Quantity Selector
   ────────────────────────────────────────── */
.cc-qty {
  display: inline-flex;
  align-items: center;
  width: 120px;
  height: 44px;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--cc-bg-card);
}

.cc-qty-btn {
  width: 70px;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 500;
  color: var(--cc-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: var(--cc-font);
  user-select: none;
}

.cc-qty-btn:hover {
  background: #5555f6;
  color: #ffffff;
}

.cc-qty-btn:active {
  background: #4444d4;
  color: #ffffff;
}

.cc-qty-input {
  width: 36px;
  height: 100%;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--cc-font);
  color: var(--cc-secondary);
  background: transparent;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.cc-qty-input::-webkit-inner-spin-button,
.cc-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove Button */
.cc-remove-btn {
  background: none;
  border: none;
  color: var(--cc-danger);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--cc-font);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.cc-remove-btn:hover {
  background: none;
  border: none;
  color: var(--cc-danger);
}

/* Line Total */
.cc-item-total {
  flex-shrink: 0;
  text-align: right;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 2px;
}

.cc-line-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--cc-secondary);
}

/* ──────────────────────────────────────────
   Sidebar / Summary
   ────────────────────────────────────────── */
.cc-sidebar {
  position: sticky;
  top: 24px;
}

/* Coupon */
.cc-coupon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin-bottom: 16px;
}

.cc-coupon-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cc-secondary);
}

.cc-coupon-arrow {
  transition: transform 0.25s ease;
  display: flex;
}

.cc-coupon-header.is-collapsed .cc-coupon-arrow {
  transform: rotate(-180deg);
}

.cc-coupon-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 200px;
  opacity: 1;
}

.cc-coupon-body.is-hidden {
  max-height: 0;
  opacity: 0;
}

.cc-coupon-row {
  display: flex;
  gap: 8px;
}

/* Input */
.cc-input {
  flex: 1;
  height: 48px;
  border: 1px solid var(--cc-border) !important;
  border-radius: 10px !important;
  padding: 0 18px;
  font-size: 14px;
  font-family: var(--cc-font);
  color: var(--cc-secondary);
  outline: none;
  transition: border-color 0.2s;
}

.cc-input::placeholder {
  color: var(--cc-text-muted);
}

.cc-input:focus {
  border-color: var(--cc-primary);
}

/* Message */
.cc-coupon-msg {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.cc-coupon-msg.is-success {
  color: #22c55e;
}

.cc-coupon-msg.is-error {
  color: var(--cc-danger);
}

/* Applied Coupons */
.cc-applied-coupons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cc-coupon-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cc-bg-badge);
  color: var(--cc-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--cc-radius-xs);
}

.cc-coupon-remove {
  background: none;
  border: none;
  color: var(--cc-primary);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.cc-coupon-remove:hover {
  opacity: 1;
}

/* ──────────────────────────────────────────
   Totals
   ────────────────────────────────────────── */
.cc-totals {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--cc-border);
}

.cc-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cc-totals-row:last-child {
  margin-bottom: 0;
}

.cc-totals-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--cc-secondary);
}

.cc-totals-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-secondary);
}

.cc-discount-value {
  color: #22c55e;
  font-size: 16px;
  font-weight: 600;
}

/* ──────────────────────────────────────────
   Buttons (shared)
   ────────────────────────────────────────── */
.cc-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cc-font);
  font-weight: 600;
  color: #FFFFFF !important;
  background: #5555f6;
  border: 1px solid #5555f6;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.cc-btn-primary:hover {
  color: #5555f6 !important;
  background: #FFFFFF;
  border: 1px solid #5555f6;
}

.cc-btn-primary:active {
  color: #5555f6 !important;
  background: #FFFFFF;
  border: 1px solid #5555f6;
}

/* Apply Button */
.cc-btn-apply {
  height: 48px;
  padding: 0 20px;
  border-radius: var(--cc-radius-sm);
  font-size: 14px;
  white-space: nowrap;
}

/* Checkout Button */
.cc-btn-checkout {
  width: 100%;
  height: 56px;
  border-radius: var(--cc-radius-md);
  font-size: 18px;
  margin-top: 16px;
}

/* Return to Shop */
.cc-btn-shop {
  height: 48px;
  padding: 0 28px;
  border-radius: var(--cc-radius-sm);
  font-size: 15px;
  margin-top: 16px;
}

/* ──────────────────────────────────────────
   Empty Cart
   ────────────────────────────────────────── */
.cc-empty {
  display: flex;
  justify-content: center;
}

.cc-empty-card {
  max-width: 520px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
}

.cc-empty-msg {
  font-size: 16px;
  color: var(--cc-text-muted);
  margin-top: -8px;
}

/* ──────────────────────────────────────────
   Loading Overlay
   ────────────────────────────────────────── */
.cc-loading {
  position: relative;
  pointer-events: none;
}

.cc-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--cc-radius-card);
  z-index: 2;
}

/* ──────────────────────────────────────────
   Responsive — Tablet
   ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cc-grid {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }

  .cc-cart-card {
    padding: 24px;
  }

  .cc-title {
    font-size: 30px;
  }
}

/* ──────────────────────────────────────────
   Responsive — Mobile
   ────────────────────────────────────────── */
@media (max-width: 768px) {
  .cc-container {
    padding: 0 16px;
  }

  .cc-page {
    padding: 16px 0 100px;
  }

  .cc-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cc-sidebar {
    position: static;
  }

  .cc-title {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .cc-cart-card,
  .cc-summary-card {
    padding: 20px;
    border-radius: 16px;
  }

  .cc-item-inner {
    flex-wrap: wrap;
  }

  .cc-item-thumb {
    width: 64px;
    height: 64px;
  }

  .cc-item-details {
    flex: 1;
    min-width: calc(100% - 84px);
  }

  .cc-item-total {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding-top: 8px;
  }

  .cc-item-title {
    font-size: 16px;
  }

  .cc-line-price {
    font-size: 16px;
  }

  .cc-btn-checkout {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0;
    z-index: 100;
    height: 56px;
    margin-top: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
  }
}

/* ──────────────────────────────────────────
   Small Mobile
   ────────────────────────────────────────── */
@media (max-width: 480px) {
  .cc-item-thumb {
    width: 56px;
    height: 56px;
  }

  .cc-qty {
    width: 110px;
    height: 40px;
  }

  .cc-qty-btn {
    width: 36px;
    font-size: 16px;
  }

  .cc-qty-input {
    width: 38px;
    font-size: 14px;
  }

  .cc-item-title {
    font-size: 15px;
  }

  .cc-new-price {
    font-size: 14px;
  }
}