/* ===== RakuShopBD — Cart Page ===== */

#page-cart {
  background: var(--bg);
  min-height: calc(100vh - 120px);
}

#page-cart.cart-is-empty {
  background: linear-gradient(165deg, #e8f2fc 0%, #f5f7fa 45%, var(--bg) 100%);
}

.cart-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-page-wrap {
    grid-template-columns: 1fr;
  }
}

/* Header */
.cart-page-header {
  margin-bottom: 24px;
}

.cart-page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text);
}

.cart-page-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(12, 68, 124, 0.25);
}

.cart-page-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

#page-cart.cart-is-empty .cart-page-wrap {
  grid-template-columns: 1fr;
  max-width: 720px;
}

#page-cart.cart-is-empty .cart-page-header {
  text-align: center;
  margin-bottom: 28px;
}

#page-cart.cart-is-empty .cart-page-title {
  justify-content: center;
}

/* Cart items */
.c-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.c-item:hover {
  border-color: rgba(32, 96, 32, 0.2);
  box-shadow: 0 8px 24px rgba(12, 68, 124, 0.08);
}

.c-item-thumb {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface2);
}

.c-item-thumb img,
.cart-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.c-item-thumb i {
  font-size: 40px;
}

.c-item-info {
  flex: 1;
  min-width: 0;
}

.c-item-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.c-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.c-item-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.c-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.c-item-remove-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.c-item-remove-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.c-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.c-qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--surface2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: var(--text);
}

.c-qty-btn:hover {
  background: var(--primary-pale);
  color: var(--primary);
}

.c-qty-input {
  width: 42px;
  height: 34px;
  border: none;
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  outline: none;
}

#btn-back-home {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  transition: gap 0.15s;
}

#btn-back-home:hover {
  gap: 10px;
}

/* Order summary */
.c-summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 88px;
  box-shadow: 0 8px 32px rgba(12, 68, 124, 0.08);
}

.c-summary-head {
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
}

.c-summary-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.c-summary-body {
  padding: 8px 22px 22px;
}

.c-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.c-summary-row:last-of-type {
  border: none;
}

.c-summary-label {
  color: var(--text-muted);
}

.c-summary-val {
  font-weight: 600;
  color: var(--text);
}

.c-summary-free {
  color: var(--green);
  font-weight: 600;
}

.c-coupon-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.c-coupon-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: var(--surface2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.c-coupon-input:focus {
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(32, 96, 32, 0.12);
}

.c-coupon-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

.c-coupon-btn:hover {
  background: var(--primary-pale);
  color: var(--primary);
  border-color: var(--primary-light);
}

.c-coupon-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 10px 8px;
  text-decoration: underline;
  white-space: nowrap;
  flex-shrink: 0;
}

.c-coupon-remove:hover {
  color: #c62828;
}

.checkout-coupon-row {
  margin: 12px 0;
}

.c-coupon-input[readonly] {
  background: var(--green-pale, #e8f5e9);
  border-color: var(--green, #2e7d32);
  color: var(--green, #2e7d32);
  font-weight: 600;
}

.c-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 20px;
  border-top: 2px solid var(--border);
  margin-top: 4px;
}

.c-total-label {
  font-size: 16px;
  font-weight: 700;
}

.c-total-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.3px;
}

.c-checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #c93a39 100%);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(212, 134, 150, 0.35);
}

.c-checkout-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(212, 134, 150, 0.4);
}

.c-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

#btn-cart-continue {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

#btn-cart-continue:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.c-pay-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
}

.c-pay-pill {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface2);
}

/* ===== Empty cart ===== */
.cart-empty-state {
  text-align: center;
  padding: 48px 32px 40px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  margin-bottom: 8px;
  box-shadow:
    0 4px 6px rgba(12, 68, 124, 0.04),
    0 24px 48px rgba(12, 68, 124, 0.1);
  position: relative;
  overflow: hidden;
}

.cart-empty-state::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-pale) 0%, transparent 70%);
  top: -100px;
  right: -80px;
  pointer-events: none;
}

.cart-empty-state::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 134, 150, 0.08) 0%, transparent 70%);
  bottom: -60px;
  left: -40px;
  pointer-events: none;
}

.cart-empty-visual {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
}

.cart-empty-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px dashed rgba(32, 96, 32, 0.15);
}

.cart-empty-ring--1 {
  inset: 0;
  animation: cartRingSpin 24s linear infinite;
}

.cart-empty-ring--2 {
  inset: 14px;
  border-color: rgba(212, 134, 150, 0.12);
  animation: cartRingSpin 18s linear infinite reverse;
}

@keyframes cartRingSpin {
  to {
    transform: rotate(360deg);
  }
}

.cart-empty-icon-wrap {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary-pale) 0%, #fff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(12, 68, 124, 0.15);
  z-index: 1;
}

.cart-empty-icon-wrap i {
  font-size: 48px;
  color: var(--primary);
  opacity: 0.85;
}

.cart-empty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(212, 134, 150, 0.4);
}

.cart-empty-state h3 {
  position: relative;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  color: var(--text);
}

.cart-empty-state > p {
  position: relative;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.65;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.cart-empty-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.cart-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s, background 0.15s;
}

.cart-empty-btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(12, 68, 124, 0.35);
}

.cart-empty-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(12, 68, 124, 0.4);
}

.cart-empty-btn--ghost {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.cart-empty-btn--ghost:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
  transform: translateY(-1px);
}

.cart-empty-perks {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.cart-empty-perk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

.cart-empty-perk i {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

@media (max-width: 640px) {
  .cart-summary-box {
    position: static;
    top: auto;
  }
}

@media (max-width: 600px) {
  .cart-empty-perks {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cart-empty-perk {
    flex-direction: row;
    text-align: left;
  }

  .cart-empty-actions {
    flex-direction: column;
  }

  .cart-empty-btn {
    width: 100%;
  }
}
