/* Crownstore cart — cream / sage / gold theme tokens */

.t1-cart-page {
  --cart-radius: 0;
  --cart-shadow: none;
  --cart-border: 1px solid var(--theme-border, #c4b8a0);
  --cart-max: 1160px;
  --cart-primary: var(--theme-primary, #4a5c47);
  --cart-primary-hover: var(--theme-accent-dark, #5b7057);
  --cart-accent: var(--theme-cream, #e8ddd0);
  --cart-muted: var(--theme-muted, #9b8e7a);
  --cart-surface: var(--theme-surface-card, #f2ede3);
  --cart-bg: var(--theme-bg, #f8f4ee);
  --cart-danger: var(--theme-danger, #b91c1c);
  --cart-success: var(--theme-primary, #4a5c47);
  --cart-text: var(--theme-text, #2a2118);
  --cart-font: var(--theme-font-family, Jost, system-ui, sans-serif);
  --cart-display: var(--theme-font-display, "Playfair Display", Georgia, serif);

  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.75rem, 4vw, 3rem)
           max(1rem, calc((100% - var(--cart-max)) / 2))
           4rem;
  background: var(--cart-bg);
  color: var(--cart-text);
  font-family: var(--cart-font);
  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;
}

.t1-cart-page a {
  color: inherit;
}

.t1-cart-title {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--cart-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 500;
  font-style: italic;
  color: var(--cart-text);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.t1-cart-subtitle {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: var(--cart-muted);
  font-size: 0.95rem;
  font-weight: 400;
  font-family: var(--cart-font);
}

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

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

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

.t1-cart-item:hover {
  border-color: var(--theme-accent, #b8945a);
  background: color-mix(in srgb, var(--cart-surface) 88%, #fff);
}

.t1-cart-img {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 0;
  background: var(--cart-accent);
  overflow: hidden;
  border: 1px solid var(--theme-border, #c4b8a0);
}

.t1-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.t1-cart-img img.t1-cart-img--placeholder,
.t1-cart-img img[data-cart-img-placeholder] {
  object-fit: contain;
  opacity: 0.75;
  background: var(--cart-bg);
  padding: 10px;
}

.t1-cart-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

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

.t1-cart-name {
  font-family: var(--cart-font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cart-text);
  line-height: 1.35;
}

.t1-cart-line-total {
  font-family: var(--cart-font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cart-text);
  white-space: nowrap;
}

.t1-cart-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--cart-muted);
}

.t1-cart-price {
  font-family: var(--cart-font);
  font-size: 0.85rem;
  color: var(--cart-muted);
  font-weight: 500;
}

.t1-cart-description {
  color: var(--cart-muted);
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0.15rem 0 0;
}

.t1-cart-variant {
  color: var(--cart-muted);
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
  margin: 0.2rem 0 0;
}

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

.t1-cart-addons {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

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

.t1-cart-addon {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  font-size: 0.85rem;
  color: var(--cart-muted);
}

.t1-cart-addon-name {
  font-weight: 600;
  color: var(--theme-text-secondary, #6b5f54);
}

.t1-cart-addon-name::before {
  content: "+ ";
  color: var(--theme-accent, #b8945a);
  font-weight: 700;
}

.t1-cart-addon-qty {
  color: var(--cart-muted);
}

.t1-cart-addon-price {
  margin-left: auto;
  font-weight: 600;
  color: var(--cart-text);
}

.t1-cart-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.t1-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--theme-border, #c4b8a0);
  border-radius: 0;
  overflow: hidden;
  background: var(--cart-bg);
  transition: border-color 0.2s;
}

.t1-cart-qty:hover,
.t1-cart-qty:focus-within {
  border-color: var(--theme-accent, #b8945a);
}

.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: 600;
  color: var(--cart-text);
  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);
}

.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 color-mix(in srgb, var(--cart-primary) 25%, transparent);
  border-top-color: var(--cart-primary);
  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: 1px solid var(--theme-border, #c4b8a0);
  border-right: 1px solid var(--theme-border, #c4b8a0);
  padding: 0;
  font-family: var(--cart-font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cart-text);
  background: var(--cart-surface);
  -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; }

.t1-cart-remove {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-border, #c4b8a0);
  border-radius: 0;
  background: var(--cart-bg);
  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: color-mix(in srgb, var(--cart-danger) 45%, var(--theme-border));
  background: color-mix(in srgb, var(--cart-danger) 8%, var(--cart-bg));
}

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

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

.t1-cart-summary {
  grid-column: 2;
  grid-row: 3;
  background: var(--cart-surface);
  border: var(--cart-border);
  border-radius: var(--cart-radius);
  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: var(--cart-display);
  font-size: 1.45rem;
  font-weight: 500;
  font-style: italic;
  color: var(--cart-text);
  letter-spacing: -0.01em;
}

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

.t1-cart-subtotal span {
  font-family: var(--cart-font);
  font-size: 0.9375rem;
  color: var(--cart-muted);
  font-weight: 500;
}

.t1-cart-subtotal strong {
  font-family: var(--cart-font);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cart-text);
}

.t1-cart-checkout {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-family: var(--cart-font);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #f8f4ee;
  background: var(--cart-primary);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-transform: uppercase;
}

.t1-cart-checkout:hover:not(:disabled) {
  background: var(--cart-primary-hover);
  transform: translateY(-1px);
}

.t1-cart-checkout:active:not(:disabled) {
  transform: translateY(0);
}

.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;
  justify-content: 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;
}

.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: var(--cart-font);
  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: var(--theme-accent, #b8945a);
  -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;
}

.t1-cart-empty {
  grid-column: 1;
  grid-row: 3;
  min-height: clamp(260px, 38vh, 380px);
  background: var(--cart-surface);
  border: 1px dashed var(--theme-border, #c4b8a0);
  border-radius: var(--cart-radius);
  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.45;
}

.t1-cart-empty-title {
  margin: 0;
  font-family: var(--cart-display);
  font-size: 1.5rem;
  font-weight: 500;
  font-style: italic;
  color: var(--cart-text);
}

.t1-cart-empty-sub {
  margin: 0;
  font-family: var(--cart-font);
  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.85rem 1.75rem;
  border-radius: 0;
  background: var(--cart-primary);
  color: #f8f4ee !important;
  text-decoration: none;
  font-family: var(--cart-font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.15s;
}

.t1-cart-empty-cta:hover {
  background: var(--cart-primary-hover);
  transform: translateY(-1px);
  color: #f8f4ee !important;
}

.t1-cart-page > [data-slot] {
  grid-column: 1 / -1;
}

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

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

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

@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;
  }
}