/* Shop */
.cart-menu {
  position: relative;
}

.cart-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.cart-trigger:hover,
.cart-trigger[aria-expanded="true"] {
  border-color: rgba(61, 214, 198, 0.45);
  background: rgba(61, 214, 198, 0.08);
}

.cart-trigger svg {
  width: 22px;
  height: 22px;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  color: var(--bg);
  background: var(--accent);
  border-radius: 999px;
}

.cart-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(92vw, 360px);
  max-height: 70vh;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 130;
}

.cart-dropdown-items {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-dropdown-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.cart-dropdown-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

.shop-page {
  padding: 2.5rem 0 4rem;
}

.shop-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 1.5rem;
}

.catalog-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.catalog-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg);
}

.catalog-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.35rem;
}

.catalog-card h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0;
}

.catalog-price {
  margin: 0;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.15rem;
}

.catalog-tax {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.catalog-card .btn {
  margin-top: auto;
}

.catalog-card .btn.is-added {
  box-shadow: 0 0 0 2px var(--warm);
}

.shop-line {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.shop-line--compact {
  padding: 0.65rem;
  gap: 0.65rem;
}

.shop-line--compact .shop-line-title {
  font-size: 0.95rem;
}

.shop-line--compact .shop-line-meta,
.shop-line--compact .shop-line-subtotal {
  font-size: 0.8rem;
}

.shop-line img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg);
}

.shop-line-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.shop-line-meta {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.shop-qty input {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.shop-line-subtotal {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shop-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 1.25rem;
}

.shop-totals-total strong {
  color: var(--accent);
}

.shop-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
}

.cart-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.checkout-auth-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(61, 214, 198, 0.1);
  border: 1px solid rgba(61, 214, 198, 0.35);
  border-radius: var(--radius-sm);
}

.checkout-auth-notice[hidden] {
  display: none !important;
}

.checkout-auth-notice p {
  margin: 0;
  flex: 1;
  min-width: 12rem;
}

.checkout-gated .checkout-form {
  pointer-events: none;
  opacity: 0.45;
}

.checkout-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr 1.4fr;
    align-items: start;
  }
}

.checkout-panel {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.checkout-panel h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

.checkout-panel + .checkout-panel {
  margin-top: 0;
}

.checkout-form .auth-field {
  margin-bottom: 0;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkout-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .checkout-row--2 {
    grid-template-columns: 1fr 1fr;
  }
  .checkout-row--expiry {
    grid-template-columns: 1fr 1fr;
  }
}

.checkout-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkout-checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

#shipping-fields[hidden] {
  display: none !important;
}

.payment-card {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 32rem;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.payment-card h2 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
}

.payment-card--success h2 {
  color: var(--accent);
}

.payment-card--failed h2 {
  color: #f87171;
}

.payment-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: shop-spin 0.8s linear infinite;
}

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

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.order-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.order-card--highlight {
  border-color: rgba(61, 214, 198, 0.5);
  box-shadow: 0 0 0 1px rgba(61, 214, 198, 0.25);
}

.order-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.order-card-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0;
}

.order-card-head time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.order-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

.order-status--paid {
  background: rgba(61, 214, 198, 0.15);
  color: var(--accent);
}

.order-status--failed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.order-lines {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-lines li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.order-lines img {
  border-radius: 6px;
  object-fit: cover;
}

.checkout-form .auth-field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.checkout-form .auth-field select:focus {
  outline: none;
  border-color: rgba(61, 214, 198, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.15);
}

@media (max-width: 768px) {
  .cart-dropdown {
    right: -0.5rem;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .cart-menu {
    order: 3;
  }
}
