/* Appily Twentysix — cart page */

.sv-cart-page {
  padding: 32px 0 64px;
  background: #F5F5F5;
}

.sv-cart-page .container {
  max-width: 1200px;
}

.sv-cart-title {
  margin: 0 0 28px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sv-ink);
}

.sv-cart-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ── Sidebar ── */
.sv-cart-sidebar {
  background: var(--sv-white);
  border: 1px solid var(--sv-border);
  border-radius: 16px;
  padding: 24px;
  position: sticky;
  top: 96px;
}

.sv-cart-ship-progress {
  margin-bottom: 24px;
}

.sv-cart-ship-text {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--sv-muted);
}

.sv-cart-ship-text strong {
  color: var(--sv-ink);
  font-weight: 700;
}

.sv-cart-ship-text.is-unlocked {
  color: var(--sv-primary);
  font-weight: 600;
}

.sv-cart-progress-track {
  height: 4px;
  background: #E8E8E8;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.sv-cart-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sv-secondary), #E8A317);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.sv-cart-sidebar h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--sv-ink);
}

.sv-cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--sv-muted);
}

.sv-cart-total-row strong {
  color: var(--sv-ink);
  font-weight: 700;
}

.sv-cart-shipping-est {
  margin: 20px 0;
  padding-top: 20px;
  border-top: 1px solid var(--sv-border);
}

.sv-cart-shipping-est h3 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sv-ink);
}

.sv-cart-field {
  margin-bottom: 10px;
}

.sv-cart-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sv-muted);
}

.sv-cart-field select,
.sv-cart-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sv-border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  outline: none;
}

.sv-cart-field select:focus,
.sv-cart-field input:focus {
  border-color: var(--sv-primary);
}

.sv-cart-calc-btn {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--sv-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sv-cart-calc-btn:hover {
  background: var(--sv-primary-dark);
}

.sv-cart-est-result {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--sv-primary);
  font-weight: 600;
  min-height: 1.2em;
}

.sv-cart-coupon {
  margin: 20px 0;
  padding-top: 20px;
  border-top: 1px solid var(--sv-border);
}

.sv-cart-coupon h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

.sv-cart-coupon-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--sv-muted);
}

.sv-cart-summary-bottom {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--sv-border);
}

.sv-cart-save-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--sv-muted);
  margin-bottom: 8px;
}

.sv-cart-order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.sv-cart-order-total span:first-child {
  font-size: 1rem;
  font-weight: 800;
  color: var(--sv-ink);
}

.sv-cart-order-total strong {
  font-size: 1.65rem;
  font-weight: 800;
  color: #2ECC71;
  letter-spacing: -0.02em;
}

.sv-cart-tax-note {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: var(--sv-muted);
}

.sv-cart-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.45;
  cursor: pointer;
}

.sv-cart-terms input {
  margin-top: 3px;
  accent-color: var(--sv-primary);
  flex-shrink: 0;
}

.sv-cart-terms a {
  color: var(--sv-primary);
  font-weight: 600;
}

.sv-cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--sv-ink);
  border-radius: 999px;
  background: #F5F5F5;
  color: var(--sv-ink);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  transition: 0.15s ease;
  cursor: pointer;
}

.sv-cart-checkout-btn:hover:not(.is-disabled) {
  background: var(--sv-ink);
  color: #fff;
}

.sv-cart-checkout-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Main table ── */
.sv-cart-main {
  background: var(--sv-white);
  border: 1px solid var(--sv-border);
  border-radius: 16px;
  padding: 24px;
}

.sv-cart-table {
  width: 100%;
  border-collapse: collapse;
}

.sv-cart-table thead th {
  padding: 0 12px 16px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sv-ink);
  border-bottom: 1px solid var(--sv-border);
}

.sv-cart-table thead th:nth-child(2),
.sv-cart-table thead th:nth-child(3),
.sv-cart-table thead th:nth-child(4) {
  text-align: center;
}

.sv-cart-table tbody tr {
  border-bottom: 1px solid var(--sv-border);
}

.sv-cart-table tbody td {
  padding: 20px 12px;
  vertical-align: middle;
}

.sv-cart-product {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.sv-cart-product-img {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 1px solid var(--sv-border);
  border-radius: 8px;
  overflow: hidden;
  background: #F8F8F8;
  display: grid;
  place-items: center;
}

.sv-cart-product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.sv-cart-product-info h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.sv-cart-product-info h3 a {
  color: inherit;
  text-decoration: none;
}

.sv-cart-product-info h3 a:hover {
  color: var(--sv-primary);
}

.sv-cart-product-meta {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--sv-muted);
  line-height: 1.4;
}

.sv-cart-product-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sv-ink);
}

.sv-cart-product-price .was {
  margin-left: 6px;
  color: #999;
  text-decoration: line-through;
  font-weight: 500;
}

.sv-cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0 auto;
}

.sv-cart-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--sv-ink);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.15s ease;
}

.sv-cart-qty-btn:hover {
  opacity: 0.85;
}

.sv-cart-qty input {
  width: 40px;
  height: 32px;
  border: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
}

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

.sv-cart-line-total {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--sv-ink);
}

.sv-cart-remove {
  text-align: center;
}

.sv-cart-remove-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--sv-ink);
  color: #fff;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: opacity 0.15s ease;
}

.sv-cart-remove-btn:hover {
  opacity: 0.85;
}

.sv-cart-remove-btn svg {
  display: block;
}

.sv-cart-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 8px;
}

.sv-cart-continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: 2px solid var(--sv-ink);
  border-radius: 999px;
  background: #fff;
  color: var(--sv-ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: 0.15s ease;
}

.sv-cart-continue-btn:hover {
  background: var(--sv-ink);
  color: #fff;
}

.sv-cart-update-btn {
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--sv-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.sv-cart-update-btn:hover {
  background: var(--sv-primary-dark);
}

.sv-cart-note {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--sv-border);
}

.sv-cart-note h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}

.sv-cart-note textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--sv-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  resize: vertical;
  outline: none;
}

.sv-cart-note textarea:focus {
  border-color: var(--sv-primary);
}

.sv-cart-note textarea::placeholder {
  color: #AAA;
}

/* ── Empty state ── */
.sv-cart-empty {
  background: var(--sv-white);
  border: 1px solid var(--sv-border);
  border-radius: 16px;
  padding: 64px 32px;
  text-align: center;
}

.sv-cart-empty h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

.sv-cart-empty p {
  margin: 0 0 24px;
  color: var(--sv-muted);
}

.sv-cart-empty .sv-cart-continue-btn {
  display: inline-flex;
}

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

  .sv-cart-sidebar {
    position: static;
    order: 2;
  }

  .sv-cart-main {
    order: 1;
  }

  .sv-cart-table thead {
    display: none;
  }

  .sv-cart-table tbody tr {
    display: block;
    padding: 16px 0;
  }

  .sv-cart-table tbody td {
    display: block;
    padding: 8px 0;
    text-align: left !important;
  }

  .sv-cart-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--sv-muted);
    margin-bottom: 6px;
  }

  .sv-cart-qty {
    margin: 0;
  }
}

@media (max-width: 520px) {
  .sv-cart-main,
  .sv-cart-sidebar {
    padding: 16px;
  }

  .sv-cart-product {
    flex-direction: column;
  }
}
