﻿/* ---- Shop ---- */
.shop-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shop-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.shop-bg-gradient {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
}

.shop-bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shop-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 168, 83, 0.08);
}

.shop-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.shop-logo img {
  transition: transform var(--transition);
}

.shop-logo:hover img {
  transform: scale(1.05);
}

.shop-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shop-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.shop-nav-link:hover {
  color: var(--gold);
}

.shop-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.shop-cart-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.shop-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: var(--bg);
  background: var(--gradient-gold);
  border-radius: 100px;
}

.shop-main {
  position: relative;
  z-index: 1;
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.shop-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.shop-hero--compact {
  margin-bottom: 2rem;
}

.shop-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0.5rem 0 0.75rem;
}

.shop-subtitle {
  color: var(--text-muted);
  max-width: 480px;
  margin-inline: auto;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 168, 83, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.product-art {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
}

.product-art.product-image--logo,
.product-image--logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0a0a0c 0%, #1a1a22 100%);
}

.product-art.product-image--logo .product-image,
.product-image--logo img {
  width: 45%;
  height: auto;
  object-fit: contain;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem;
}

.product-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.product-badge--sold {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.product-desc {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
}

.product-add {
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
}

.product-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.shop-footer {
  position: relative;
  z-index: 1;
}

/* Cart drawer */
.shop-overlay,
.shop-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.shop-overlay.is-open,
.shop-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.shop-overlay[hidden],
.shop-modal-overlay[hidden],
.shop-drawer[hidden],
.shop-modal[hidden] {
  display: none !important;
}

.shop-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 201;
  width: min(420px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.shop-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.shop-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-drawer-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.04em;
}

.shop-drawer-close,
.shop-modal-close {
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.shop-drawer-close:hover,
.shop-modal-close:hover {
  color: var(--text);
}

.shop-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.shop-cart-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.shop-cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-cart-item-art {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.shop-cart-item-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-cart-item-art.product-image--logo img {
  object-fit: contain;
  padding: 0.75rem;
}

.shop-cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.shop-cart-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.shop-cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shop-qty-btn {
  width: 28px;
  height: 28px;
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.shop-qty-btn:hover {
  border-color: var(--gold);
}

.shop-qty {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.shop-remove-btn {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.shop-remove-btn:hover {
  color: #e07a6a;
}

.shop-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-drawer-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 1rem;
}

.shop-drawer-checkout {
  width: 100%;
  justify-content: center;
}

/* Size modal */
.shop-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 202;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(400px, calc(100% - 2rem));
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.shop-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.shop-modal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.03em;
  padding-right: 2rem;
  margin-bottom: 0.35rem;
}

.shop-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.shop-modal-price {
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.shop-modal-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.shop-size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.shop-size-btn {
  min-width: 48px;
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.shop-size-btn:hover {
  border-color: var(--gold);
}

.shop-size-btn.is-selected {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.12);
  color: var(--gold);
}

.shop-modal-add {
  width: 100%;
  justify-content: center;
}

.shop-modal-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.checkout-form {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.checkout-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 2rem;
}

.checkout-fieldset:last-of-type {
  margin-bottom: 1.5rem;
}

.checkout-legend {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  padding: 0;
}

.checkout-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.checkout-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.checkout-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkout-submit {
  width: 100%;
  justify-content: center;
}

.checkout-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.checkout-status {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}

.checkout-status.is-success {
  color: var(--gold-light);
}

.checkout-status.is-error {
  color: #e07a6a;
}

.checkout-summary {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.checkout-summary-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout-item-art {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.checkout-item-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-item-art.product-image--logo img {
  object-fit: contain;
  padding: 0.5rem;
}

.checkout-item-details {
  flex: 1;
  min-width: 0;
}

.checkout-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.checkout-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.checkout-item-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}

.checkout-totals {
  margin-top: 1rem;
  padding-top: 1rem;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.checkout-total-row--grand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout-empty,
.checkout-success {
  text-align: center;
  padding: 3rem 0;
}

.checkout-success-logo {
  margin: 0 auto 1.5rem;
  opacity: 0.85;
}

.checkout-success .btn {
  margin: 0.5rem;
}

.checkout-success-home {
  display: inline-flex;
}

@media (max-width: 900px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
    order: -1;
  }
}

@media (max-width: 768px) {
  .checkout-row {
    grid-template-columns: 1fr;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-add {
    width: 100%;
    justify-content: center;
  }
}
