/* Petshop cart — HTML structure unchanged; layout + colors aligned with auth UI */

/* Shared card shell — left + right same radius + shadow */
.t1-cart-page {
  --petshop-cart-radius: 14px;
  --petshop-cart-shadow: 0 10px 40px rgba(15, 23, 42, 0.1);
  --petshop-cart-border: 1px solid var(--theme-border, #e8e8ea);
  --petshop-cart-content-max: 1120px;

  /*
   * Avoid 100vw + negative margins — that often causes a horizontal scrollbar
   * (vw includes scrollbar gutter; width ends up > visible viewport).
   */
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.5rem, 4vw, 2.5rem) max(1rem, calc((100% - var(--petshop-cart-content-max)) / 2)) 3rem;
  background: var(--theme-bg, #f4f5f7);
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(min(260px, 100%), min(340px, 100%));
  grid-template-rows: repeat(3, min-content);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: stretch;
  align-content: start;
  overflow-x: clip;
}

.t1-cart-title {
  grid-column: 1;
  grid-row: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.95rem, 4.3vw, 2.5rem);
  font-weight: 800;
  font-style: italic;
  color: var(--theme-text, #0f2d20);
  margin: 0;
  letter-spacing: -0.02em;
}

.t1-cart-subtitle {
  grid-column: 1;
  grid-row: 2;
  margin: 0 0 0.15rem;
  color: var(--theme-muted, #5f7f75);
  font-size: 1.05rem;
  font-weight: 500;
}

/* Left column — same card elevation as summary */
.t1-cart-items {
  grid-column: 1;
  grid-row: 3;
  border: 1px solid var(--theme-border, #e8e2d9) !important;
  min-width: 0;
  box-sizing: border-box;
  border-radius: var(--petshop-cart-radius);
  box-shadow: var(--petshop-cart-shadow);
  background: var(--theme-surface, #fff);
  border: var(--petshop-cart-border);
}

.t1-cart-items:empty {
  min-height: clamp(220px, 38vh, 380px);
  border: 2px dashed var(--theme-border, #94a3b8);
  background: var(--theme-promo-bar-bg, #e8eef3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.t1-cart-items:not(:empty) {
  align-self: start;
}

.t1-cart-empty {
  grid-column: 1;
  grid-row: 3;
  min-height: clamp(220px, 34vh, 320px);
  border: 1px dashed var(--theme-border, #b9c8e8);
  border-radius: var(--petshop-cart-radius);
  background: var(--theme-promo-bar-bg, #e9eef8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  text-align: center;
  padding: 2rem 1.25rem;
}

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

.t1-cart-empty-title {
  margin: 0;
  color: var(--theme-header-bg, #2d3f68);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.t1-cart-empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 210px;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: var(--theme-header-bg, #253763);
  color: var(--theme-text-inverse, #fff);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.t1-cart-empty-cta:hover {
  background: var(--theme-header-nav-bg, #1f2f56);
}

/* Line items */
.t1-cart-item {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 0;
  border: 1px solid var(--theme-border, #e8e2d9);
  border-radius: 14px;
  padding: clamp(1rem, 2vw, 1rem);
  margin-bottom: 5px;
}

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

.t1-cart-img {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--theme-bg-muted, #f3f4f6);
}

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

.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-size: 1rem;
  font-family: var(--theme-font-serif, Georgia), "Times New Roman", serif !important;
  font-weight: 600;
  color: var(--theme-text, #111827);
  line-height: 1.3;
}

.t1-cart-line-total {
  color: var(--theme-text, #111827);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
}

.t1-cart-description {
  color: var(--theme-muted, #6b7280);
  font-size: 0.95rem;
  line-height: 1.35;
}

.t1-cart-variant {
  color: var(--theme-muted, #5f6f69);
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
}

.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.88rem;
  color: var(--theme-muted, #5f6f69);
}

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

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

.t1-cart-addon-qty {
  color: var(--theme-muted, #5f6f69);
}

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

.t1-cart-img--placeholder,
.t1-cart-img img.t1-cart-img--placeholder {
  object-fit: contain;
  padding: 12px;
  background: var(--theme-bg-muted, #f2f2ef);
  box-sizing: border-box;
}

.t1-cart-price-row {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.05rem;
}

.t1-cart-price-row > span {
  color: var(--theme-muted, #6b7280);
  font-size: 0.95rem;
}

.t1-cart-price {
  color: var(--theme-muted, #6b7280);
  font-weight: 600;
  font-size: 0.95rem;
}

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

.t1-cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--theme-border, #d1d5db);
  border-radius: 10px;
  overflow: hidden;
}

.t1-cart-qty-input {
  width: 46px;
  text-align: center;
  line-height: 1.2;
  border: none;
  border-left: 1px solid var(--theme-border, #d1d5db);
  border-right: 1px solid var(--theme-border, #d1d5db);
  padding: 0.3rem;
  font-size: 0.9375rem;
  background: var(--theme-surface, #fff);
  -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-qty button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--theme-surface, #fff);
  cursor: pointer;
  font-size: 1rem;
  color: var(--theme-text, #374151);
  transition: background 0.15s, color 0.15s;
}

.t1-cart-qty button:hover {
  background: var(--theme-bg-muted, #f3f4f6);
  color: var(--theme-primary, #2d9d63);
}

.t1-cart-remove {
  width: 32px;
  height: 32px;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-border, #d1d5db);
  border-radius: 8px;
  color: #8a8f98;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.t1-cart-remove::before {
  content: "🗑";
  font-size: 1rem;
  line-height: 1;
}

.t1-cart-remove:hover {
  border-color: var(--theme-border, #b4b8bf);
  color: var(--theme-muted, #6b7280);
  background: var(--theme-bg-muted, #f9fafb);
}

/* Right column — match left box shadow + radius */
.t1-cart-summary {
  grid-column: 2;
  grid-row: 3;
  margin-top: 0;
  border: 1px solid var(--theme-border, #e8e2d9) !important;
  border-radius: var(--petshop-cart-radius);
  padding: clamp(1.35rem, 3vw, 1.85rem);
  background: var(--theme-surface, #fff);
  box-shadow: var(--petshop-cart-shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
  align-self: start;
}

.t1-cart-summary-title {
  margin: 0;
  color: var(--theme-text, #1f2937);
  font-family: var(--theme-font-serif, Georgia), "Times New Roman", serif !important;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.t1-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9375rem;
}

.t1-cart-subtotal span {
  color: var(--theme-muted, #4b5563);
  font-weight: 500;
}

.t1-cart-subtotal strong {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--theme-text, #111827);
}

.t1-cart-checkout {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--theme-text-inverse, #fff);
  background: var(--theme-primary, #2d9d63);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.t1-cart-checkout:hover:not(:disabled) {
  background: var(--theme-accent-dark, #248f58);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

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

.t1-cart-checkout:disabled,
.t1-cart-checkout[data-loading] {
  opacity: 0.75;
  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;
}

.t1-cart-clear {
  width: 100%;
  padding: 0.82rem 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--theme-muted, #6b7280);
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-border, #d1d5db);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.t1-cart-clear:hover:not(:disabled) {
  border-color: var(--theme-border, #9ca3af);
  color: var(--theme-text, #374151);
  background: var(--theme-bg-muted, #f9fafb);
}

.t1-cart-clear:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.t1-cart-trust {
  margin: 0.25rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--theme-border, #e5e7eb);
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.t1-cart-trust-item {
  position: relative;
  padding-left: 1.5rem;
  color: var(--theme-muted, #6b7280);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.t1-cart-trust-item::before {
  position: absolute;
  left: 0;
  top: 0;
}

.t1-cart-trust-secure::before {
  content: "🛡";
}

.t1-cart-trust-returns::before {
  content: "↻";
}

/* Slots full width */
.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 {
    grid-column: 1;
    grid-row: auto;
  }

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

  .t1-cart-summary {
    order: -1;
  }
}

@media (max-width: 600px) {
  .t1-cart-head {
    flex-direction: column;
    gap: 0.4rem;
  }

  .t1-cart-line-total {
    font-size: 1.05rem;
  }

  .t1-cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

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