/* ==========================================================================
   CART PAGE STYLES
   ========================================================================== */

/* ─── Global Cart Elements ──────────────────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 24px 48px rgba(18, 20, 24, 0.06),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

/* ─── Layout Grid ───────────────────────────────────────────────────────── */
.cart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: start;
}

/* ─── Cart Items (Left Column) ──────────────────────────────────────────── */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border-radius: 20px;
  position: relative;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 40px rgba(18, 20, 24, 0.08),
    0 0 0 1px rgba(18, 20, 24, 0.05);
}

.cart-item-img-wrap {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(18, 20, 24, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-img-wrap img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-ink-deep);
  margin: 0;
}

.cart-item-variant,
.cart-item-sku {
  font-size: 13px;
  color: var(--color-ink-light);
  margin: 0;
}

.cart-item-remove {
  font-size: 13px;
  color: #ff4b4b;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  width: fit-content;
  transition: opacity 0.2s;
}

.cart-item-remove:hover {
  opacity: 0.7;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.cart-item-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-ink-deep);
}

/* Quantity Selector Override for Cart */
.cart-qty-selector {
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(18, 20, 24, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.cart-qty-selector .qty-btn {
  width: 32px;
  height: 100%;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-ink-deep);
}

.cart-qty-selector .qty-input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  -moz-appearance: textfield;
}

.cart-qty-selector .qty-input::-webkit-inner-spin-button,
.cart-qty-selector .qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-actions-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.cart-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--color-ink-deep);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(18, 20, 24, 0.04);
  transition: all 0.3s ease;
}

.cart-back-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 20, 24, 0.08);
}

/* ─── Order Summary (Right Column) ──────────────────────────────────────── */
.cart-summary-wrapper {
  position: sticky;
  top: 120px; /* offset for header */
}

.cart-summary {
  padding: 32px;
  border-radius: 24px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.summary-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-ink-deep);
  margin: 0 0 24px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--color-ink-light);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-row span:last-child {
  font-weight: 500;
  color: var(--color-ink-deep);
}

.summary-divider {
  height: 1px;
  background: rgba(18, 20, 24, 0.08);
  margin: 24px 0;
}

.total-row {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-ink-deep);
  margin-bottom: 32px;
}

.total-row span:last-child {
  font-size: 24px;
}

.promo-code-box {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.promo-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(18, 20, 24, 0.1);
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}

.promo-input:focus {
  border-color: var(--color-ink-light);
  background: #fff;
}

.promo-btn {
  padding: 0 20px;
  border-radius: 12px;
  height: 48px;
}

.checkout-btn {
  height: 54px;
  border-radius: 14px;
  font-size: 16px;
}

.secure-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--color-ink-light);
}

/* ─── Responsive Adjustments ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cart-grid {
    grid-template-columns: 1fr;
  }

  .cart-summary-wrapper {
    position: static;
  }
}

@media (max-width: 660px) {
  .cart-grid {
    gap: 24px;
  }

  .cart-item {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 16px;
  }

  .cart-summary {
    padding: 20px;
  }

  .cart-item-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    width: 100%;
  }

  .cart-item-remove {
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0;
  }
  .cart-item-remove span {
    display: none; /* Only show icon on mobile if we had text, but we have text now */
  }

  .cart-hero .shop-header-card {
    margin-top: 100px !important;
    margin-bottom: 24px !important;
    padding: 24px 16px !important;
  }

  .cart-back-btn {
    width: 100%;
    justify-content: center;
  }

  .summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-row.total-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .promo-code-box {
    flex-direction: column;
  }
}

/* Strip WooCommerce shortcode wrapper margins so our layout controls spacing */
.cart-content-section .woocommerce {
  margin: 0;
  padding: 0;
}

/* Two-button actions row: back link left, update button right */
.cart-actions-row {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Cart-specific layout tweaks ── */
.cart-hero-card {
  margin-bottom: 40px;
  padding-top: 40px;
  padding-bottom: 40px;
}
.cart-page-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}
.cart-content-section {
  padding-bottom: 80px;
}
.cart-empty-block {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  max-width: 400px;
  margin: auto;
}
.cart-empty-msg {
  margin-bottom: 24px;
}
.summary-row--discount {
  color: var(--color-primary);
}
.promo-form {
  display: flex;
  gap: 8px;
  width: 100%;
}
.checkout-btn--full {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
  text-decoration: none;
  display: flex;
}
.secure-checkout {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.6;
}
.payment-methods-img {
  width: 100%;
  max-width: 250px;
  margin: 30px auto 0;
}

/* ─── WooCommerce Notices (cart-content-section) ─────────────────────────── */
.cart-content-section .woocommerce-notices-wrapper {
  margin-bottom: 28px;
}

.cart-content-section .woocommerce-notices-wrapper:empty {
  margin: 0;
}

/* ── Success / message notice ── */
.cart-content-section .woocommerce-message {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(36, 204, 99, 0.07);
  border: 1px solid rgba(36, 204, 99, 0.22);
  border-top: 1px solid rgba(36, 204, 99, 0.22) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 4px 0 0 #24cc63,
    0 4px 20px rgba(36, 204, 99, 0.06);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink-deep);
  font-family: var(--font-body);
  margin: 0;
  list-style: none;
}

/* Green checkmark icon */
.cart-content-section .woocommerce-message::before {
  content: '';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #24cc63;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
  background-size: 11px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Action button (e.g. "Continue shopping") — pulled to the far right */
.cart-content-section .woocommerce-message .button {
  order: 2;
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(36, 204, 99, 0.12);
  border: 1px solid rgba(36, 204, 99, 0.28);
  color: #146b32;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.cart-content-section .woocommerce-message .button:hover {
  background: rgba(36, 204, 99, 0.22);
  transform: translateY(-1px);
}

/* ── Error notice (.woocommerce-error) — WC renders this as <ul> ── */
.cart-content-section .woocommerce-error {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 16px;
  background: rgba(228, 30, 63, 0.05);
  border: 1px solid rgba(228, 30, 63, 0.2);
  border-top: 1px solid rgba(228, 30, 63, 0.2) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 4px 0 0 var(--color-critical-strong),
    0 4px 20px rgba(228, 30, 63, 0.05);
  overflow: hidden;
}

.cart-content-section .woocommerce-error li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-critical-strong);
  border-bottom: 1px solid rgba(228, 30, 63, 0.08);
}

.cart-content-section .woocommerce-error li:last-child {
  border-bottom: none;
}

/* Red ! icon per error item */
.cart-content-section .woocommerce-error li::before {
  content: '!';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background: var(--color-critical-strong);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-body);
}

/* ── Info notice ── */
.cart-content-section .woocommerce-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(71, 112, 194, 0.07);
  border: 1px solid rgba(71, 112, 194, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 4px 0 0 var(--color-primary),
    0 4px 20px rgba(71, 112, 194, 0.05);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink-deep);
  font-family: var(--font-body);
  margin: 0;
  list-style: none;
}

/* Blue i icon */
.cart-content-section .woocommerce-info::before {
  content: 'i';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
}

.cart-content-section .woocommerce-info .button {
  order: 2;
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(71, 112, 194, 0.1);
  border: 1px solid rgba(71, 112, 194, 0.25);
  color: var(--color-primary-deep);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.cart-content-section .woocommerce-info .button:hover {
  background: rgba(71, 112, 194, 0.18);
  transform: translateY(-1px);
}

/* Mobile: stack button below text */
@media (max-width: 520px) {
  .cart-content-section .woocommerce-message,
  .cart-content-section .woocommerce-info {
    flex-wrap: wrap;
  }

  .cart-content-section .woocommerce-message .button,
  .cart-content-section .woocommerce-info .button {
    order: 3;
    margin-left: 36px; /* visually aligns with text after icon + gap */
    height: 38px;
    font-size: 12px;
  }
}
