/* ══════════════════════════════════════════════
   Cart V2 — GFP 2027 Premium Design
   ══════════════════════════════════════════════ */

/* ── Header override: sticky + glass on cart ── */
.page-cart .site-header {
  position: sticky !important;
  top: 0;
  background: rgba(18, 20, 24, 0.85) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
  border-bottom: 1px solid rgba(var(--blue-rgb), 0.12) !important;
  box-shadow: 0 1px 24px rgba(0,0,0,0.3) !important;
}
html:not(.dark) .page-cart .site-header {
  background: rgba(248, 250, 252, 0.92) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 1px 12px rgba(0,0,0,0.06) !important;
}
.page-cart .site-header .nav-link-c { color: var(--text-secondary); }
.page-cart .site-header .nav-link-c:hover { color: var(--text); }

/* ═══ LAYOUT ═══ */
.cart-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.cart-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ═══ PROGRESS STEPS ═══ */
.cart-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 32px 0 28px;
}
.cart-step {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-step__circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
}
.cart-step--active .cart-step__circle {
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: 0 4px 16px rgba(var(--btn-rgb), 0.35);
}
.cart-step--active .cart-step__circle .step-check {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-step--inactive .cart-step__circle {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.cart-step__label {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.cart-step--active .cart-step__label {
  color: var(--btn-bg);
}
.cart-step--inactive .cart-step__label {
  color: var(--text-muted);
}
.cart-step__connector {
  width: 48px;
  height: 2px;
  margin: 0 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.cart-step__connector--done {
  background: linear-gradient(90deg, var(--btn-bg), var(--text-muted));
}
.cart-step__connector--pending {
  background: var(--border);
}

@media (max-width: 640px) {
  .cart-progress { gap: 0; padding: 20px 0 16px; }
  .cart-step__circle { width: 28px; height: 28px; font-size: 11px; }
  .cart-step--active .cart-step__circle .step-check { width: 12px; height: 12px; top: -2px; right: -2px; }
  .cart-step__label { font-size: 11px; }
  .cart-step__connector { width: 20px; margin: 0 6px; }
}

/* ═══ CART HEADER ═══ */
.cart-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.cart-header__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(var(--btn-rgb), 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-header__icon svg {
  color: var(--btn-bg);
}
.cart-header__title {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.cart-header__count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══ TWO-COLUMN LAYOUT ═══ */
.cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1024px) {
  .cart-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══ ALERTS ═══ */
.cart-alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cart-alert--error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
}
.cart-alert--warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  color: var(--gold);
}
.cart-alert--info {
  background: rgba(var(--blue-rgb),0.08);
  border: 1px solid rgba(var(--blue-rgb),0.2);
  color: var(--blue);
}

/* ═══ CART ITEM CARD ═══ */
.cart-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.cart-item:hover {
  border-color: rgba(var(--blue-rgb), 0.3);
  box-shadow: var(--shadow-md);
}
.cart-item__inner {
  display: flex;
  gap: 16px;
  min-width: 0;
}

/* Image */
.cart-item__img-wrap {
  width: 80px;
  height: 106px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--surface-2);
}
.cart-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.cart-item:hover .cart-item__img {
  transform: scale(1.05);
}

/* Discount badge on image */
.cart-item__badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 0 10px 0 8px;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Info section */
.cart-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cart-item__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.cart-item__name:hover {
  color: var(--blue);
}
.cart-item__publisher {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.cart-item__publisher svg {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.6;
}
.cart-item__meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Price column */
.cart-item__price-col {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 100px;
}
.cart-item__price-old {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.cart-item__price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.cart-item__saving {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Action buttons */
.cart-item__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}
.cart-item__btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cart-item__btn:hover {
  border-color: rgba(var(--blue-rgb), 0.4);
  color: var(--blue);
  background: rgba(var(--blue-rgb), 0.06);
}
.cart-item__btn--remove:hover {
  border-color: rgba(239,68,68,0.4);
  color: var(--red);
  background: rgba(239,68,68,0.06);
}

@media (max-width: 640px) {
  .cart-item { padding: 14px; }
  .cart-item__img-wrap { width: 64px; height: 85px; border-radius: 8px; }
  .cart-item__name { font-size: 13px; }
  .cart-item__price { font-size: 17px; }
  .cart-item__price-col { min-width: 80px; }
  .cart-item__btn { width: 28px; height: 28px; border-radius: 6px; }
}

/* ═══ VOUCHER CARD ═══ */
.cart-voucher {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cart-voucher__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-voucher__info { flex: 1; min-width: 0; }
.cart-voucher__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cart-voucher__tag {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.cart-voucher__price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}

/* ═══ CART LIMIT INFO ═══ */
.cart-limit-info {
  margin-top: 16px;
}

/* ═══ SIDEBAR ═══ */
.cart-sidebar {
  position: sticky;
  top: 84px;
}

/* ── Coupon Box ── */
.cart-coupon {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.cart-coupon__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cart-coupon__head svg { color: var(--btn-bg); flex-shrink: 0; }
.cart-coupon__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cart-coupon__row {
  display: flex;
  gap: 8px;
}
.cart-coupon__input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.cart-coupon__input::placeholder { color: var(--text-muted); }
.cart-coupon__input:focus {
  border-color: var(--btn-bg);
  box-shadow: 0 0 0 3px rgba(var(--btn-rgb), 0.12);
}
.cart-coupon__submit {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.cart-coupon__submit:hover {
  background: var(--btn-bg-hover, var(--btn-bg));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--btn-rgb), 0.3);
}
.cart-coupon__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.cart-coupon__messages { margin-top: 10px; }

/* ── Summary Box ── */
.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.cart-summary__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.cart-summary__head svg { color: var(--btn-bg); flex-shrink: 0; }
.cart-summary__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Summary rows */
.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.cart-summary__label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-summary__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Coupon applied row */
.cart-summary__row--coupon {
  background: rgba(16,185,129,0.06);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 4px -4px;
}
.cart-summary__row--coupon .cart-summary__label { color: var(--green); }
.cart-summary__row--coupon .cart-summary__value { color: var(--green); font-weight: 700; }

/* Savings row */
.cart-summary__row--savings .cart-summary__label { color: var(--green); }
.cart-summary__row--savings .cart-summary__value { color: var(--green); font-weight: 700; }

/* Remove coupon btn */
.cart-summary__remove-coupon {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.cart-summary__remove-coupon:hover { opacity: 1; }

/* Divider */
.cart-summary__divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* Total row */
.cart-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(var(--btn-rgb), 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 4px;
}
.cart-summary__total-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-summary__total-label svg { color: var(--btn-bg); }
.cart-summary__total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Checkout button */
.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  margin-top: 18px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  font-family: inherit;
}
.cart-checkout-btn:hover {
  background: var(--btn-bg-hover, var(--btn-bg));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--btn-rgb), 0.35);
  color: var(--btn-text);
  text-decoration: none;
}

/* Trust badges */
.cart-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cart-trust__item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

/* ═══ EMPTY CART ═══ */
.cart-empty {
  text-align: center;
  padding: 80px 24px;
}
.cart-empty__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.cart-empty__icon svg { color: var(--text-muted); }
.cart-empty__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.cart-empty__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.cart-empty__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s;
}
.cart-empty__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--btn-rgb), 0.35);
  color: var(--btn-text);
  text-decoration: none;
}

/* ═══ DELETE MODAL ═══ */
.cart-modal .modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
.cart-modal__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.cart-modal__icon svg { color: var(--red); }
.cart-modal__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.cart-modal__desc {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
}
.cart-modal__sub {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}
.cart-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.cart-modal__btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.cart-modal__btn--cancel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.cart-modal__btn--cancel:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.cart-modal__btn--delete {
  background: var(--red);
  color: #fff;
}
.cart-modal__btn--delete:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.cart-modal__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Close button */
.cart-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.cart-modal__close:hover { color: var(--text); }

/* ═══ COUPON MESSAGE ALERTS ═══ */
.coupon-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.coupon-msg--success {
  background: rgba(16,185,129,0.1);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.2);
}
.coupon-msg--error {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

/* ═══ SPINNER ═══ */
@keyframes cart-spin {
  to { transform: rotate(360deg); }
}
.cart-spinner {
  animation: cart-spin 0.7s linear infinite;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .cart-wrap { padding: 0 12px 60px; }
  .cart-sidebar { position: static; }
  .cart-coupon, .cart-summary { border-radius: 14px; padding: 16px; }
  .cart-item__inner { gap: 12px; }
  .cart-modal__actions { flex-direction: column; }
}
