/* ── Shop Product Page ─────────────────────────────────────────────── */

.shop-product {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.shop-product .breadcrumb {
  display: flex !important;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  margin: 0 0 var(--space-2);
  padding: 0;
}

/* ── Product Detail Layout ────────────────────────────────────────── */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  margin-top: var(--space-6);
}

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ── Gallery ──────────────────────────────────────────────────────── */

.product-gallery {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  align-self: start;
}

.product-gallery-main {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-gray-100);
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery-thumbs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  overflow-x: auto;
}

.product-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--color-gray-200);
  cursor: pointer;
  background: var(--color-gray-100);
  padding: 0;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-thumb.active,
.product-thumb:hover {
  border-color: var(--color-primary-500);
}

/* ── Product Info ─────────────────────────────────────────────────── */

.product-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Sticky Buy Bar (compact: price + qty + button inline) ────────── */

.product-buy-box {
  position: sticky;
  top: var(--header-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-bg-primary);
  z-index: 10;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-top: calc(-1 * var(--space-4));
  border-bottom: 1px solid transparent;
  transition: max-height .3s ease, opacity .2s ease, padding .3s ease, margin .3s ease, border-color .2s ease;
  pointer-events: none;
}

.product-buy-box.visible {
  max-height: 70px;
  opacity: 1;
  padding: var(--space-3) 0;
  margin-top: 0;
  border-bottom-color: var(--color-gray-200);
  pointer-events: auto;
}

/* Prices: RRP above, sale below */
.product-buy-box-prices {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  min-width: 0;
}

.product-buy-box-rrp {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  line-height: 1.2;
}

.product-buy-box-sale {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-error);
  line-height: 1.1;
}

.product-buy-box-regular {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-gray-900);
  line-height: 1.1;
}

/* Qty picker */
.product-buy-box-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.product-buy-box-qty .btn {
  border: none;
  border-radius: 0;
  min-width: 30px;
  height: 36px;
  padding: 0;
  font-size: var(--text-sm);
}

.product-buy-box-qty .input {
  width: 38px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--color-gray-200);
  border-right: 1px solid var(--color-gray-200);
  border-radius: 0;
  font-size: var(--text-sm);
  font-family: var(--font-family);
  background: var(--color-bg-primary);
  color: var(--color-gray-800);
  padding: 0;
  -moz-appearance: textfield;
}

.product-buy-box-qty .input::-webkit-outer-spin-button,
.product-buy-box-qty .input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to cart fills remaining space */
.product-buy-box .btn-primary {
  flex: 1;
  white-space: nowrap;
  height: 36px;
}

html.dark .product-buy-box {
  border-bottom-color: var(--color-gray-300);
}

html.dark .product-buy-box-qty {
  border-color: var(--color-gray-300);
}

html.dark .product-buy-box-qty .input {
  border-color: var(--color-gray-300);
}

html.dark .product-buy-box-qty {
  border-color: var(--color-gray-300);
}

html.dark .product-buy-box-qty .input {
  border-color: var(--color-gray-300);
}

.product-title {
  font-family: var(--font-family-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: 0;
}

/* ── Pricing ──────────────────────────────────────────────────────── */

.product-price-block {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.price-lg {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: var(--font-bold);
}

.price-regular {
  color: var(--color-gray-900);
}

.price-sale {
  color: var(--color-error);
  font-weight: var(--font-bold);
}

.price-compare {
  color: var(--color-gray-400);
  font-size: var(--text-base);
}

.product-short-desc {
  color: var(--color-gray-600);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

/* ── Variants ─────────────────────────────────────────────────────── */

.product-variants {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-variants label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-gray-700);
}

.product-variants .input {
  width: 100%;
  max-width: 320px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-family);
  background: var(--color-bg-elevated);
  color: var(--color-gray-800);
}

/* ── Add to Cart ──────────────────────────────────────────────────── */

.product-add-to-cart {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.quantity-picker {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.quantity-picker .btn {
  border: none;
  border-radius: 0;
  min-width: 40px;
  height: 44px;
  font-size: var(--text-lg);
}

.quantity-picker .input {
  width: 56px;
  height: 44px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--color-gray-200);
  border-right: 1px solid var(--color-gray-200);
  border-radius: 0;
  font-size: var(--text-base);
  font-family: var(--font-family);
  background: var(--color-bg-elevated);
  color: var(--color-gray-800);
  -moz-appearance: textfield;
}

.quantity-picker .input::-webkit-outer-spin-button,
.quantity-picker .input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-atc-btn {
  flex: 1;
  min-width: 180px;
}

/* ── Stock Notice ─────────────────────────────────────────────────── */

.product-stock-notice {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin-bottom: 0;
}

.stock-out {
  color: var(--color-error);
}

.stock-low {
  color: #f59e0b;
}

/* ── Description ──────────────────────────────────────────────────── */

.product-description {
  border-top: 1px solid var(--color-gray-200);
  padding-top: var(--space-6);
  margin-top: var(--space-2);
  line-height: var(--leading-relaxed);
  color: var(--color-gray-700);
}

.product-description h2,
.product-description h3 {
  margin-top: var(--space-6);
}

.product-description ul,
.product-description ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.product-description li {
  margin-bottom: var(--space-1);
}

.product-description img {
  border-radius: var(--radius-lg);
  margin: var(--space-4) 0;
}

/* ── Brand Block ──────────────────────────────────────────────────── */

.product-brand-block {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.product-brand-block:hover {
  border-color: var(--color-primary-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-brand-logo {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  padding: var(--space-1);
}

.product-brand-info {
  flex: 1;
  min-width: 0;
}

.product-brand-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin: 0 0 var(--space-1);
  color: var(--color-gray-900);
}

.product-brand-desc {
  font-size: var(--text-xs);
  color: var(--color-gray-600);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-brand-link {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-primary-600);
}

.product-brand-block:hover .product-brand-link {
  text-decoration: underline;
}

html.dark .product-brand-block {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
}

html.dark .product-brand-logo {
  background: var(--color-gray-100);
}

@media (max-width: 480px) {
  .product-brand-block {
    flex-direction: column;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   BRAND LANDING PAGE
   ══════════════════════════════════════════════════════════════════════ */

.shop-brand {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6);
}

/* ── Brand Hero ───────────────────────────────────────────────────── */

.brand-hero {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-bg-primary) 100%);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-2xl);
}

.brand-hero-logo {
  flex: 0 0 100px;
  width: 100px !important;
  height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
  object-fit: contain;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  border: 1px solid var(--color-gray-200);
}

.brand-hero-content {
  flex: 1;
  min-width: 0;
}

.brand-hero .breadcrumb {
  display: flex !important;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  margin: 0 0 var(--space-2);
  padding: 0;
  font-size: var(--text-xs);
}

.brand-hero-title {
  font-family: var(--font-family-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-2);
  color: var(--color-gray-900);
}

.brand-hero-desc {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-3);
}

.brand-hero-website {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  text-decoration: none;
}

.brand-hero-website:hover {
  color: var(--color-primary-600);
}

@media (max-width: 640px) {
  .brand-hero {
    flex-direction: column;
    text-align: center;
    padding: var(--space-6) var(--space-4);
  }
  .brand-hero .breadcrumb {
    justify-content: center;
  }
  .brand-hero-desc {
    max-width: none;
  }
}

/* ── Toolbar / Filters ────────────────────────────────────────────── */

.brand-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.brand-product-count {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  font-weight: var(--font-medium);
}

.brand-filters {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.brand-filter-chip {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-gray-200);
  color: var(--color-gray-600);
  text-decoration: none;
  transition: all 0.15s;
}

.brand-filter-chip:hover {
  border-color: var(--color-primary-300);
  color: var(--color-primary-600);
}

.brand-filter-chip.active {
  background: var(--color-primary-600);
  border-color: var(--color-primary-600);
  color: #fff;
}

/* ── Empty ────────────────────────────────────────────────────────── */

.brand-empty {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-gray-500);
}

.brand-empty p {
  margin-bottom: var(--space-4);
}

/* ── Pagination ───────────────────────────────────────────────────── */

.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.shop-pagination-info {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

/* ── Dark mode ────────────────────────────────────────────────────── */

html.dark .brand-hero {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-bg-primary) 100%);
  border-color: var(--color-gray-300);
}

html.dark .brand-hero-logo {
  border-color: var(--color-gray-300);
}

html.dark .brand-filter-chip {
  border-color: var(--color-gray-300);
}

html.dark .product-brand-block {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
}

html.dark .product-brand-block:hover {
  border-color: var(--color-primary-400);
}

/* ── Related Products ─────────────────────────────────────────────── */

.shop-related {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-gray-200);
}

.shop-related .section-title {
  margin-bottom: var(--space-6);
}

/* ── Product Grid (cards) ─────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

/* ── Product Card ─────────────────────────────────────────────────── */

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-gray-200);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  border-color: var(--color-primary-200);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-gray-100);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.04);
}

.product-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-400);
}

.product-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.product-card-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.product-card-atc {
  margin: 0 var(--space-4) var(--space-4);
}

/* ── Dark mode overrides ──────────────────────────────────────────── */

html.dark .product-gallery-main {
  background: var(--color-gray-100);
}

html.dark .product-thumb {
  border-color: var(--color-gray-300);
}

html.dark .product-card {
  border-color: var(--color-gray-300);
}

html.dark .product-card:hover {
  border-color: var(--color-primary-400);
}

html.dark .product-description {
  border-top-color: var(--color-gray-300);
}

html.dark .shop-related {
  border-top-color: var(--color-gray-300);
}

html.dark .quantity-picker {
  border-color: var(--color-gray-300);
}

html.dark .quantity-picker .input {
  border-color: var(--color-gray-300);
}

/* ══════════════════════════════════════════════════════════════════════
   CART PAGE
   ══════════════════════════════════════════════════════════════════════ */

.shop-cart h1 {
  margin-bottom: var(--space-6);
}

.cart-loading {
  text-align: center;
  padding: var(--space-8) 0;
  color: var(--color-gray-500);
}

/* ── Empty State ──────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
}

.empty-state-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--color-gray-500);
  margin-bottom: var(--space-6);
}

/* ── Cart Layout (items + summary sidebar) ────────────────────────── */

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ── Cart Items ───────────────────────────────────────────────────── */

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.cart-item:first-child {
  padding-top: 0;
}

.cart-item-image {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name a {
  color: inherit;
  text-decoration: none;
}

.cart-item-name a:hover {
  color: var(--color-primary-600);
}

.cart-item-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  margin: 0 0 var(--space-1);
  line-height: var(--leading-snug);
}

.cart-item-variant {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  margin-bottom: var(--space-1);
}

.cart-item-price {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  font-weight: var(--font-semibold);
  text-align: center;
}

.cart-item-remove {
  color: var(--color-gray-500);
  font-size: var(--text-sm);
}

/* ── Cart / Checkout Summary Sidebar ──────────────────────────────── */

.cart-summary {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}

.cart-summary h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

.cart-summary-total {
  border-top: 1px solid var(--color-gray-200);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  font-size: var(--text-base);
  color: var(--color-gray-900);
}

.cart-checkout-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: var(--space-4);
}

/* ══════════════════════════════════════════════════════════════════════
   CHECKOUT PAGE (v14 redesign)
   ══════════════════════════════════════════════════════════════════════ */

.checkout-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ── Progress Bar ──────────────────────────────────────────────────── */

.checkout-progress {
  padding: 0;
}

.checkout-progress ol {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
  position: relative;
}

.checkout-progress li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  transition: color .25s;
}

.checkout-progress li.is-active {
  color: var(--color-gray-700);
}

.checkout-progress li.is-complete {
  color: var(--color-primary-600);
}

.checkout-step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-gray-100);
  color: var(--color-gray-400);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  transition: all .25s;
  flex-shrink: 0;
}

.checkout-progress li.is-active .checkout-step-dot {
  background: color-mix(in srgb, var(--color-primary-100) 60%, white);
  color: var(--color-primary-600);
}

.checkout-progress li.is-complete .checkout-step-dot {
  background: var(--color-primary-600);
  color: #fff;
}

.checkout-step-check {
  display: none;
}

.checkout-progress li.is-complete .checkout-step-check {
  display: block;
}

.checkout-progress li.is-complete .checkout-step-num {
  display: none;
}

.checkout-step-label {
  font-weight: var(--font-medium);
}

.checkout-progress-track {
  height: 3px;
  border-radius: 3px;
  background: var(--color-gray-100);
  overflow: hidden;
}

.checkout-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--gradient-primary);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

/* ── Loading & Empty States ───────────────────────────────────────── */

.checkout-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 260px;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--color-gray-200);
  color: var(--color-gray-500);
  font-size: var(--text-sm);
}

.checkout-loading-state p {
  margin: 0;
}

.checkout-loading-pulse {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--color-primary-100);
  animation: co-pulse 1.2s ease-in-out infinite;
}

@keyframes co-pulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.25); opacity: .3; }
}

.checkout-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--color-gray-500);
}

.checkout-empty-state h2 {
  margin: 0;
  color: var(--color-gray-700);
  font-size: var(--text-lg);
}

.checkout-empty-state p {
  margin: 0;
  font-size: var(--text-sm);
}

/* ── Layout ───────────────────────────────────────────────────────── */

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(1.5rem, 2.5vw, 2.25rem);
  align-items: start;
}

.checkout-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ── Panel (contact, address, shipping, notes) ────────────────────── */

.co-panel {
  display: flex;
  gap: var(--space-4);
  padding: clamp(1.15rem, 2vw, 1.5rem);
  border: 1px solid var(--color-gray-200);
  border-radius: 16px;
  background: var(--color-bg-elevated);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color .2s, box-shadow .2s;
}

.co-panel:focus-within {
  border-color: color-mix(in srgb, var(--color-primary-400) 35%, var(--color-gray-200));
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.co-panel-muted {
  background: color-mix(in srgb, var(--color-bg-primary) 30%, white);
}

.co-panel-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-primary-100) 50%, white);
  color: var(--color-primary-600);
}

.co-panel-body {
  flex: 1;
  min-width: 0;
}

.co-panel-body h2 {
  margin: 0 0 var(--space-1);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.co-panel-hint {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  line-height: 1.5;
}

/* ── Form Fields ──────────────────────────────────────────────────── */

.co-field {
  margin-bottom: var(--space-3);
}

.co-field:last-child {
  margin-bottom: 0;
}

.co-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-gray-700);
  margin-bottom: 0.35rem;
}

.co-optional {
  font-weight: normal;
  color: var(--color-gray-400);
  font-size: var(--text-xs);
}

.co-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.co-input {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font-family);
  background: color-mix(in srgb, var(--color-bg-primary) 14%, white);
  color: var(--color-gray-800);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.co-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary-400) 12%, transparent);
  background: #fff;
}

.co-input-error {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-error) 10%, transparent) !important;
}

.co-field-error {
  display: none;
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: 4px;
}

.co-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.co-textarea {
  resize: vertical;
  min-height: 80px;
}

.co-input-sm {
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  font-size: var(--text-sm);
}

/* ── Shipping Options ─────────────────────────────────────────────── */

.co-shipping-loading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  color: var(--color-gray-500);
  font-size: var(--text-sm);
}

.co-shipping-loading .checkout-loading-pulse {
  width: 22px;
  height: 22px;
}

.co-shipping-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.co-ship-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  cursor: pointer;
  background: color-mix(in srgb, var(--color-bg-primary) 20%, white);
  transition: all .15s;
}

.co-ship-option:hover {
  border-color: var(--color-primary-300);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.co-ship-option:has(input:checked) {
  border-color: var(--color-primary-500);
  background: color-mix(in srgb, var(--color-primary-25) 50%, white);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary-200) 18%, transparent);
}

.co-ship-option input[type="radio"] {
  flex-shrink: 0;
  accent-color: var(--color-primary-600);
  width: 18px;
  height: 18px;
}

.co-ship-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.co-ship-name {
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  color: var(--color-gray-900);
}

.co-ship-eta {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.co-ship-reason {
  font-size: var(--text-xs);
  color: var(--color-error);
}

.co-ship-price {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  white-space: nowrap;
  color: var(--color-gray-900);
}

.co-ship-free {
  color: var(--color-success);
}

.co-ship-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.co-shipping-empty {
  color: var(--color-gray-500);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
}

/* ── Alert ────────────────────────────────────────────────────────── */

.co-alert {
  font-size: var(--text-sm);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  line-height: 1.5;
}

.co-alert-error {
  color: var(--color-error);
  background: color-mix(in srgb, var(--color-error) 8%, white);
  border: 1px solid color-mix(in srgb, var(--color-error) 18%, white);
}

/* ── Sidebar (order summary) ─────────────────────────────────────── */

.co-sidebar-shell {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.co-sidebar {
  border: 1px solid var(--color-gray-200);
  border-radius: 16px;
  background: var(--color-bg-elevated);
  padding: clamp(1.15rem, 2vw, 1.5rem);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.co-sidebar-title {
  margin: 0 0 var(--space-4);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

/* ── Cart Items in Sidebar ────────────────────────────────────────── */

.co-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
  margin-bottom: var(--space-3);
}

.co-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.co-item-img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-100);
}

.co-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.co-item-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.co-item-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-item-meta {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.co-item-price {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-gray-900);
}

/* ── Coupon ───────────────────────────────────────────────────────── */

.co-coupon {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-gray-100);
  margin-bottom: var(--space-3);
}

.co-coupon-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  border: none;
  background: none;
  font-size: var(--text-sm);
  color: var(--color-primary-600);
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: var(--font-medium);
}

.co-coupon-toggle:hover {
  text-decoration: underline;
}

.co-coupon-form {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.co-coupon-form .co-input {
  flex: 1;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: var(--text-sm);
  border-radius: 8px;
  min-height: 38px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-gray-200);
  color: var(--color-gray-700);
  font-weight: var(--font-medium);
  cursor: pointer;
  font-family: var(--font-family);
  transition: all .15s;
}

.btn-outline:hover {
  border-color: var(--color-primary-400);
  color: var(--color-primary-600);
  background: color-mix(in srgb, var(--color-primary-25) 30%, white);
}

.co-coupon-applied {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 0.45rem 0.75rem;
  background: color-mix(in srgb, var(--color-success) 8%, white);
  border: 1px solid color-mix(in srgb, var(--color-success) 20%, white);
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-success);
}

.co-coupon-remove {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--color-gray-400);
  cursor: pointer;
  padding: 0 2px;
}

.co-coupon-remove:hover {
  color: var(--color-error);
}

/* ── Totals ───────────────────────────────────────────────────────── */

.co-totals {
  display: flex;
  flex-direction: column;
}

.co-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

.co-discount-value {
  color: var(--color-success);
  font-weight: var(--font-medium);
}

.co-totals-grand {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-gray-200);
  font-size: var(--text-base);
  color: var(--color-gray-900);
}

/* ── Pay Button ───────────────────────────────────────────────────── */

.co-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: var(--space-4);
  padding: 0 var(--space-5);
  border: none;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: var(--color-primary-contrast);
  font-size: 15px;
  font-weight: var(--font-semibold);
  font-family: var(--font-family);
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary-500) 25%, transparent);
}

.co-pay-btn:hover {
  opacity: .92;
}

.co-pay-btn:active {
  transform: scale(.99);
}

.co-pay-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.co-pay-btn-text,
.co-pay-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

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

.co-spinner {
  animation: spin 1s linear infinite;
}

.co-pay-note {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  text-align: center;
  line-height: 1.5;
}

/* ── Trust Signals ────────────────────────────────────────────────── */

.co-trust {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-gray-100);
}

.co-trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.co-trust-item svg {
  flex-shrink: 0;
  color: var(--color-gray-400);
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .co-sidebar-shell {
    position: static;
  }
}

@media (max-width: 640px) {
  .co-panel {
    flex-direction: column;
    gap: var(--space-3);
  }

  .co-field-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .checkout-progress li .checkout-step-label {
    font-size: var(--text-xs);
  }

  .checkout-progress li {
    gap: var(--space-1);
  }

  .checkout-step-dot {
    width: 24px;
    height: 24px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   ORDER CONFIRMATION PAGE (v14)
   ══════════════════════════════════════════════════════════════════════ */

.shop-order-confirmation {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.oc-hero {
  text-align: center;
  margin-bottom: var(--space-8);
}

.oc-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-success) 12%, white);
  color: var(--color-success);
  margin-bottom: var(--space-4);
}

.oc-hero h1 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.oc-order-num {
  font-size: var(--text-lg);
  color: var(--color-gray-700);
  margin: 0 0 var(--space-1);
}

.oc-email-note {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  margin: 0;
}

/* ── Grid ─────────────────────────────────────────────────────────── */

.oc-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 768px) {
  .oc-grid {
    grid-template-columns: 1fr;
  }
}

.oc-card {
  border: 1px solid var(--color-gray-200);
  border-radius: 16px;
  background: var(--color-bg-elevated);
  padding: clamp(1.15rem, 2vw, 1.5rem);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.oc-card h2 {
  margin: 0 0 var(--space-4);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

/* ── Items ────────────────────────────────────────────────────────── */

.oc-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
}

.oc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.oc-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.oc-item-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-gray-900);
}

.oc-item-name small {
  font-weight: normal;
  color: var(--color-gray-500);
}

.oc-item-qty {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.oc-item-price {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-gray-900);
}

/* ── Totals ───────────────────────────────────────────────────────── */

.oc-totals {
  display: flex;
  flex-direction: column;
}

.oc-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  font-size: var(--text-sm);
  color: var(--color-gray-600);
}

.oc-discount-row {
  color: var(--color-success);
}

.oc-totals-grand {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-gray-200);
  font-size: var(--text-base);
  color: var(--color-gray-900);
}

/* ── Timeline ─────────────────────────────────────────────────────── */

.oc-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.oc-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 8px;
  width: 2px;
  background: var(--color-gray-100);
}

.oc-timeline li {
  display: flex;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  position: relative;
  margin: 0;
}

.oc-timeline li:last-child {
  padding-bottom: 0;
}

.oc-timeline-dot {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--color-gray-200);
  background: var(--color-bg-elevated);
  margin-top: 2px;
  z-index: 1;
}

.oc-timeline-done .oc-timeline-dot {
  border-color: var(--color-success);
  background: var(--color-success);
}

.oc-timeline li strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.oc-timeline li span {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  line-height: 1.5;
}

/* ── Actions ──────────────────────────────────────────────────────── */

.oc-actions {
  text-align: center;
  margin-top: var(--space-8);
}

/* ── Dark Mode (checkout + order) ─────────────────────────────────── */

html.dark .cart-item {
  border-bottom-color: var(--color-gray-300);
}

html.dark .cart-summary {
  border-color: var(--color-gray-300);
}

html.dark .cart-summary-total {
  border-top-color: var(--color-gray-300);
}

html.dark .co-panel {
  border-color: var(--color-gray-300);
}

html.dark .co-sidebar {
  border-color: var(--color-gray-300);
}

html.dark .co-ship-option {
  border-color: var(--color-gray-300);
}

html.dark .co-input {
  background: color-mix(in srgb, var(--color-bg-primary) 40%, black);
  border-color: var(--color-gray-300);
}

html.dark .co-input:focus {
  background: var(--color-bg-elevated);
}

html.dark .co-select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html.dark .checkout-progress-track {
  background: var(--color-gray-300);
}

html.dark .checkout-step-dot {
  background: var(--color-gray-300);
}

html.dark .oc-card {
  border-color: var(--color-gray-300);
}

html.dark .oc-check {
  background: color-mix(in srgb, var(--color-success) 15%, var(--color-bg-primary));
}

html.dark .oc-timeline::before {
  background: var(--color-gray-300);
}

html.dark .oc-timeline-dot {
  border-color: var(--color-gray-300);
  background: var(--color-bg-primary);
}

/* ── Shop Catalog ─────────────────────────────────────────────────── */

.shop-catalog h1 {
  margin-bottom: var(--space-2);
}

.shop-catalog-header {
  margin-bottom: var(--space-6);
}
