/* ==========================================================================
   GiftNet Modern Cart Redesign Styles
   Matches user mockup design exactly
   ========================================================================== */

/* ── Container & Global Scoping ── */
.gn-cart-page {
  padding: 32px 0 80px;
  background-color: #fcfdfd;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: #0f172a;
}

/* ── Breadcrumb ── */
.gn-cart-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.gn-cart-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}

.gn-cart-breadcrumb a:hover {
  color: #065f46;
}

.gn-cart-breadcrumb-sep {
  color: #94a3b8;
  font-size: 11px;
}

.gn-cart-breadcrumb-curr {
  color: #1e293b;
  font-weight: 500;
}

/* ── Header Area ── */
.gn-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.gn-cart-title {
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.gn-cart-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.gn-cart-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  color: #047857;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Cart Table Card ── */
.gn-cart-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Table Header */
.gn-cart-th-row {
  display: grid;
  grid-template-columns: 44px 1fr 120px 140px 120px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

/* Custom Checkbox */
.gn-cart-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
  user-select: none;
}

.gn-cart-checkbox.checked {
  background: #065f46;
  border-color: #065f46;
  color: #ffffff;
}

.gn-cart-checkbox svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

/* Item Row */
.gn-cart-item-row {
  display: grid;
  grid-template-columns: 44px 1fr 120px 140px 120px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.gn-cart-item-row:last-child {
  border-bottom: none;
}

.gn-cart-item-row:hover {
  background: #fafcfb;
}

/* Product Info */
.gn-cart-item-product {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.gn-cart-item-img {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
  overflow: hidden;
  background: #fafafa;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gn-cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gn-cart-item-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gn-cart-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

.gn-cart-item-title:hover {
  color: #065f46;
}

.gn-cart-item-meta {
  font-size: 12.5px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.gn-cart-item-stock {
  font-size: 11.5px;
  font-weight: 500;
  color: #ea580c;
  margin-top: 1px;
}

/* Price Column */
.gn-cart-item-price-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gn-cart-curr-price {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.gn-cart-old-price {
  font-size: 11.5px;
  color: #94a3b8;
  text-decoration: line-through;
}

.gn-cart-discount-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 7px;
  background: #ecfdf5;
  color: #047857;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.2px;
}

/* Quantity Stepper */
.gn-cart-stepper {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  height: 36px;
  width: fit-content;
}

.gn-cart-stepper-btn {
  width: 32px;
  height: 100%;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.gn-cart-stepper-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #065f46;
}

.gn-cart-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gn-cart-stepper-val {
  width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  border: none;
  background: transparent;
  outline: none;
  padding: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}

.gn-cart-stepper-val::-webkit-outer-spin-button,
.gn-cart-stepper-val::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Total & Trash Column */
.gn-cart-item-total-col {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 8px;
}

.gn-cart-item-total-price {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.gn-cart-trash-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gn-cart-trash-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* Action Bar inside card */
.gn-cart-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #f0fdf4;
  border-top: 1px solid #d1fae5;
}

.gn-cart-bar-action {
  background: transparent;
  border: none;
  color: #065f46;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.15s, color 0.15s;
}

.gn-cart-bar-action:hover {
  color: #044330;
  text-decoration: underline;
}

.gn-cart-bar-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

.gn-cart-bar-action i {
  font-size: 16px;
}

/* ── Continue Shopping Button ── */
.gn-cart-continue-wrapper {
  margin-top: 24px;
}

.gn-cart-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #ffffff;
  border: 1.5px solid #065f46;
  border-radius: 9999px;
  color: #065f46;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.gn-cart-continue-btn:hover {
  background: #f0fdf4;
  color: #044330;
  border-color: #044330;
  transform: translateX(-2px);
}

/* ── "You May Also Like" Section ── */
.gn-cart-recommend-section {
  margin-top: 48px;
}

.gn-cart-recommend-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.gn-cart-recommend-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.gn-cart-recommend-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}

.gn-cart-view-all {
  color: #065f46;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s;
}

.gn-cart-view-all:hover {
  color: #044330;
  transform: translateX(3px);
}

.gn-cart-recommend-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.gn-cart-rec-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.gn-cart-rec-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.gn-cart-rec-img-wrap {
  height: 125px;
  background: #fafafa;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
  text-decoration: none;
}

.gn-cart-rec-img-wrap img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  transition: transform 0.2s;
}

.gn-cart-rec-card:hover .gn-cart-rec-img-wrap img {
  transform: scale(1.05);
}

.gn-cart-rec-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}

.gn-cart-rec-info {
  min-width: 0;
  flex: 1;
}

.gn-cart-rec-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.gn-cart-rec-price {
  font-size: 14px;
  font-weight: 700;
  color: #047857;
  margin: 0;
}

.gn-cart-rec-wish-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #fecdd3;
  background: #ffffff;
  color: #f43f5e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-left: 8px;
}

.gn-cart-rec-wish-btn:hover {
  background: #fff1f2;
  transform: scale(1.08);
}

.gn-cart-rec-wish-btn.active {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fda4af;
}

/* ── Order Summary Card (Sidebar) ── */
.gn-cart-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  position: sticky;
  top: 90px;
}

.gn-cart-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.gn-cart-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #065f46;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.gn-cart-summary-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.gn-cart-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.gn-cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.gn-cart-summary-label {
  color: #64748b;
  font-weight: 500;
}

.gn-cart-summary-val {
  color: #0f172a;
  font-weight: 600;
}

.gn-cart-summary-val.free {
  color: #047857;
  font-weight: 600;
}

.gn-cart-summary-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 18px 0;
}

.gn-cart-summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.gn-cart-summary-total-left {
  display: flex;
  flex-direction: column;
}

.gn-cart-summary-total-label {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.gn-cart-summary-taxes {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.gn-cart-summary-total-price {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

/* Proceed to Checkout CTA */
.gn-cart-checkout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #065f46;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.2);
}

.gn-cart-checkout-btn:hover {
  background: #044330;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 95, 70, 0.28);
}

.gn-cart-checkout-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* "OR" Divider */
.gn-cart-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.gn-cart-or-line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.gn-cart-or-text {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

/* Payment Badges */
.gn-cart-payment-methods {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 24px;
}

.gn-cart-pay-badge {
  flex: 1;
  height: 30px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  transition: border-color 0.15s;
}

.gn-cart-pay-badge:hover {
  border-color: #cbd5e1;
}

.gn-cart-pay-badge svg {
  max-height: 18px;
  max-width: 100%;
}

/* Trust Value Props (3 Columns) */
.gn-cart-trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
}

.gn-cart-trust-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gn-cart-trust-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 6px;
}

.gn-cart-trust-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
}

/* ── Empty Cart State ── */
.gn-cart-empty-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 60px 24px;
  text-align: center;
}

.gn-cart-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.gn-cart-empty-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.gn-cart-empty-desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 20px 0;
}

/* ── Responsive Adaptations ── */
@media (max-width: 1024px) {
  .gn-cart-recommend-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gn-cart-th-row {
    display: none; /* Hide header on mobile for clean card layout */
  }

  .gn-cart-item-row {
    grid-template-columns: 32px 1fr;
    grid-template-areas:
      "check product"
      "check price"
      "check actions";
    row-gap: 12px;
    padding: 16px;
  }

  .gn-cart-checkbox-col {
    grid-area: check;
    align-self: flex-start;
    padding-top: 4px;
  }

  .gn-cart-item-product {
    grid-area: product;
  }

  .gn-cart-item-price-col {
    grid-area: price;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .gn-cart-item-actions-col {
    grid-area: actions;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .gn-cart-recommend-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gn-cart-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .gn-cart-title {
    font-size: 24px;
  }

  .gn-cart-recommend-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .gn-cart-card-footer {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .gn-cart-payment-methods {
    flex-wrap: wrap;
  }

  .gn-cart-pay-badge {
    flex-basis: 30%;
  }
}

/* Mobile cart rows use the actual quantity and total columns in the markup. */
@media (max-width: 768px) {
  .gn-cart-page,
  .gn-cart-page .container { min-width: 0; }
  .gn-cart-item-row {
    grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "check product product"
      "check price price"
      "check quantity total";
    align-items: center;
    column-gap: 8px;
  }
  .gn-cart-item-qty-col { grid-area: quantity; min-width: 0; }
  .gn-cart-item-total-col { grid-area: total; min-width: 0; gap: 4px; padding-right: 0; }
  .gn-cart-item-price-col { min-width: 0; flex-wrap: wrap; }
  .gn-cart-item-product,
  .gn-cart-item-details { min-width: 0; }
  .gn-cart-item-title { overflow-wrap: anywhere; }
}

@media (max-width: 480px) {
  .gn-cart-page { padding: 22px 0 48px; }
  .gn-cart-page > .container { padding-left: 12px; padding-right: 12px; }
  .gn-cart-item-row { padding: 12px 10px; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); column-gap: 6px; }
  .gn-cart-item-img { width: 58px; height: 58px; }
  .gn-cart-item-product { gap: 10px; }
  .gn-cart-item-title { font-size: 13px; }
  .gn-cart-item-total-price,
  .gn-cart-curr-price { font-size: 13px; }
  .gn-cart-stepper { max-width: 100%; }
  .gn-cart-card-footer { padding: 12px; }
  .gn-cart-bar-action { font-size: 12px; }
  .gn-cart-summary-card { padding: 18px !important; }
}