/* ── Cart page — professional redesign ───────────────────────────────────── */

/* Override theme accent */
.t1-cart-page .t1-cart-title { font-family: "Montserrat", "Inter", sans-serif; }
.t1-cart-page a { color: #fff; }

/* ── Page shell ──────────────────────────────────────────────────────────── */
.t1-cart-page {
  --cart-radius: 16px;
  --cart-shadow: 0 4px 24px rgba(10, 31, 94, 0.08);
  --cart-border: 1px solid #e4e8f0;
  --cart-max: 1160px;
  --cart-primary: #1a3a6b;
  --cart-primary-hover: #122952;
  --cart-accent: #e8f0fb;
  --cart-muted: #64748b;
  --cart-surface: #ffffff;
  --cart-bg: #f5f7fb;
  --cart-danger: #dc2626;
  --cart-success: #16a34a;

  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.5rem, 4vw, 2.5rem)
           max(1rem, calc((100% - var(--cart-max)) / 2))
           4rem;
  background: var(--cart-bg);
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(min(260px, 100%), min(360px, 100%));
  grid-template-rows: repeat(4, min-content);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-content: start;
  overflow-x: clip;
}

/* ── Headings ────────────────────────────────────────────────────────────── */
.t1-cart-title {
  grid-column: 1;
  grid-row: 1;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #0f1f3d;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.t1-cart-subtitle {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: var(--cart-muted);
  font-size: 0.975rem;
  font-weight: 400;
  font-family: "Inter", system-ui, sans-serif;
}

/* ── Items column ────────────────────────────────────────────────────────── */
.t1-cart-items {
  grid-column: 1;
  grid-row: 3 / span 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-self: start;
}

.t1-cart-items[hidden] { display: none !important; }

/* ── Single item card ────────────────────────────────────────────────────── */
.t1-cart-item {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem 1.25rem;
  background: var(--cart-surface);
  border: var(--cart-border);
  border-radius: var(--cart-radius);
  box-shadow: var(--cart-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.t1-cart-item:hover {
  box-shadow: 0 6px 32px rgba(10, 31, 94, 0.13);
  border-color: #c9d5ea;
}

/* ── Product image ───────────────────────────────────────────────────────── */
.t1-cart-img {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--cart-accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dce5f5;
}

.t1-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.t1-cart-item:hover .t1-cart-img img {
  transform: scale(1.04);
}

.t1-cart-img-initial {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cart-primary);
  font-family: "Montserrat", "Inter", sans-serif;
  text-transform: uppercase;
  line-height: 1;
  user-select: none;
}

.t1-cart-img img[hidden],
.t1-cart-img-initial[hidden] {
  display: none !important;
}

/* ── Item info block ─────────────────────────────────────────────────────── */
.t1-cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.t1-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.t1-cart-name {
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: 0.9875rem;
  font-weight: 600;
  color: #0f1f3d;
  line-height: 1.35;
}

.t1-cart-line-total {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f1f3d;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.t1-cart-price {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--cart-muted);
  font-weight: 500;
}

/* ── Actions row ─────────────────────────────────────────────────────────── */
.t1-cart-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

/* ── Quantity control ────────────────────────────────────────────────────── */
.t1-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #d0d9ea;
  border-radius: 6px;
  overflow: hidden;
  background: #f8faff;
  transition: border-color 0.2s;
}

.t1-cart-qty:hover,
.t1-cart-qty:focus-within {
  border-color: var(--cart-primary);
}

.t1-cart-qty button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cart-primary);
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.t1-cart-qty button:hover:not(:disabled) {
  background: var(--cart-accent);
  color: var(--cart-primary-hover);
}

.t1-cart-qty button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.t1-cart-qty button.is-loading {
  opacity: 1;
  position: relative;
  color: transparent !important;
}

.t1-cart-qty button.is-loading .t1-qty-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
}

@keyframes t1-qty-spin {
  to { transform: rotate(360deg); }
}

.t1-qty-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(220, 38, 38, 0.22);
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: t1-qty-spin 0.65s linear infinite;
  display: inline-block;
  box-sizing: border-box;
  vertical-align: middle;
}

.t1-cart-qty-input {
  width: 44px;
  height: 34px;
  text-align: center;
  border: none;
  border-left: 1.5px solid #d0d9ea;
  border-right: 1.5px solid #d0d9ea;
  padding: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f1f3d;
  background: #ffffff;
  -moz-appearance: textfield;
  appearance: textfield;
}

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

/* ── Remove button ───────────────────────────────────────────────────────── */
.t1-cart-remove {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #dce3ee;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: 0;
  transition: border-color 0.15s, background 0.15s;
}

.t1-cart-remove::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background: var(--cart-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3Cpath d='M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3Cpath d='M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background 0.15s;
}

.t1-cart-remove:hover {
  border-color: #e5b4b4;
  background: #fef2f2;
}

.t1-cart-remove:hover::before {
  background: var(--cart-danger);
}

.t1-cart-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Summary column ──────────────────────────────────────────────────────── */
.t1-cart-summary {
  grid-column: 2;
  grid-row: 3;
  background: var(--cart-surface);
  border: var(--cart-border);
  border-radius: var(--cart-radius);
  box-shadow: var(--cart-shadow);
  padding: clamp(1.35rem, 3vw, 1.85rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-self: start;
  position: sticky;
  top: 1.25rem;
}

.t1-cart-summary[hidden] { display: none !important; }

.t1-cart-summary-title {
  margin: 0;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f1f3d;
  letter-spacing: -0.02em;
}

.t1-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eaeff8;
  margin: 0;
}

.t1-cart-subtotal span {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.9375rem;
  color: var(--cart-muted);
  font-weight: 500;
}

.t1-cart-subtotal strong {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f1f3d;
  letter-spacing: -0.01em;
}

/* ── Checkout button ─────────────────────────────────────────────────────── */
.t1-cart-checkout {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: 0.9875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: #1e3a8a;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26, 58, 107, 0.35);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  text-transform: uppercase;
}

.t1-cart-checkout:hover:not(:disabled) {
  background: #1e3a8af2;
  box-shadow: 0 6px 22px rgba(26, 58, 107, 0.45);
  transform: translateY(-1px);
}

.t1-cart-checkout:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 58, 107, 0.3);
}

.t1-cart-checkout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.t1-cart-checkout-default,
.t1-cart-checkout-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.t1-cart-checkout-loading[hidden],
.t1-cart-checkout-default[hidden] { display: none !important; }

@keyframes t1-spin { to { transform: rotate(360deg); } }

.t1-cart-spinner {
  width: 1.1em;
  height: 1.1em;
  animation: t1-spin 0.75s linear infinite;
  flex-shrink: 0;
}

/* ── Trust indicators ────────────────────────────────────────────────────── */
.t1-cart-trust {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.t1-cart-trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--cart-muted);
  font-weight: 500;
}

.t1-cart-trust-item::before {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: block;
  content: "";
}

.t1-cart-trust-secure::before {
  background: var(--cart-success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.t1-cart-trust-returns::before {
  background: #2556a8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 .49-4.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 .49-4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.t1-cart-empty {
  grid-column: 1;
  grid-row: 3;
  min-height: clamp(260px, 38vh, 380px);
  background: var(--cart-surface);
  border: var(--cart-border);
  border-radius: var(--cart-radius);
  box-shadow: var(--cart-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2.5rem 2rem;
}

.t1-cart-empty[hidden] { display: none !important; }

.t1-cart-empty-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  opacity: 0.55;
}

.t1-cart-empty-title {
  margin: 0;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f1f3d;
  letter-spacing: -0.01em;
}

.t1-cart-empty-sub {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--cart-muted);
}

.t1-cart-empty-cta {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.75rem;
  border-radius: 7px;
  background: #1e3a8a;
  color: #fff;
  text-decoration: none;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(26, 58, 107, 0.3);
  transition: box-shadow 0.2s, transform 0.15s;
}

.t1-cart-empty-cta:hover {
  box-shadow: 0 6px 22px rgba(26, 58, 107, 0.42);
  transform: translateY(-1px);
  color: #fff;
}

/* ── Full-width slot support ──────────────────────────────────────────────── */
.t1-cart-page > [data-slot] { grid-column: 1 / -1; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .t1-cart-page {
    grid-template-columns: 1fr;
    grid-template-rows: min-content;
  }

  .t1-cart-title,
  .t1-cart-subtitle {
    grid-column: 1;
    grid-row: auto;
  }

  .t1-cart-items {
    grid-column: 1;
    grid-row: auto;
  }

  .t1-cart-summary {
    grid-column: 1;
    grid-row: auto;
    order: -1;
    position: static;
  }

  .t1-cart-empty {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  .t1-cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .t1-cart-img {
    width: 72px;
    height: 72px;
  }

  .t1-cart-head {
    flex-direction: column;
    gap: 0.25rem;
  }

  .t1-cart-actions {
    justify-content: flex-start;
  }
}