/* ==========================================================
   Design tokens
   ========================================================== */
:root {
  --color-primary: #1557a6;
  --color-primary-dark: #0b2342;
  --color-primary-light: #eaf3fc;
  --color-soft-blue: #f5f9fd;
  --color-bg: #f7f8fa;
  --color-warm-white: #fcfcfa;
  --color-white: #ffffff;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #667085;
  --color-border: #e4e7ec;
  --color-danger: #b3261e;
  --color-warning: #9a6b13;
  --color-warning-bg: #fbf1de;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(11, 35, 66, 0.06);
  --shadow-md: 0 12px 28px rgba(11, 35, 66, 0.1);

  --container-width: 1200px;
  --transition: 200ms ease;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================
   Reset & base
   ========================================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-warm-white);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* ==========================================================
   Header / navigation
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background:transparent;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.site-header.is-scrolled {
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* .brand is the link/layout container so a future logo swap only ever
   touches what's inside it (see .brand-wordmark below) — the header
   markup itself never needs to change. */
.brand {
  color: var(--color-primary-dark);
}

/* Temporary text wordmark. When the real Sasulos logo asset is ready,
   this span's content becomes an <img class="brand-logo"> instead —
   .brand's positioning/link behavior is untouched either way. */
.brand-wordmark {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.main-nav a:hover {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn,
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  transition: background var(--transition);
}

.icon-btn:hover,
.cart-link:hover {
  background: var(--color-primary-light);
}

.icon-btn svg,
.cart-link svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-text);
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    padding: 0.9rem 1.5rem;
  }
}

/* ==========================================================
   Eyebrow
   ========================================================== */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

/* ==========================================================
   Section heading
   (shared across home/cart/checkout — anywhere a section needs a
   title + optional description + optional "view all" link)
   ========================================================== */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.section-heading h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-heading p {
  color: var(--color-text-muted);
  margin: 0.35rem 0 0;
}

.section-heading-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  transition: color var(--transition);
}

.section-heading-link:hover {
  color: var(--color-primary-dark);
}

.section-heading-center {
  width: 100%;
  text-align: center;
}

.section-heading-center .eyebrow {
  display: block;
}

.section-heading-center p {
  margin-left: auto;
  margin-right: auto;
  max-width: 46ch;
}

/* ==========================================================
   Product grid & cards
   (shared: homepage catalog/featured/new-arrivals grids AND the
   product-detail page's related-products grid)
   ========================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  justify-content: start;
  gap: 1.75rem 1.5rem;
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 1.25rem 0.85rem;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .product-card.is-visible {
    animation: fadeInUp 500ms ease both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card {
    opacity: 1;
  }
}

.product-card-media {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--color-primary-light);
  margin-bottom: 0.9rem;
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

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

.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  opacity: 0.55;
}

.img-placeholder svg {
  width: 30%;
  height: 30%;
}

.stock-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.stock-badge.in-stock {
  color: var(--color-primary);
}

.stock-badge.low-stock {
  color: var(--color-warning);
}

.stock-badge.out-of-stock {
  color: var(--color-danger);
}

.preorder-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--color-warning-bg);
  color: var(--color-warning);
  box-shadow: var(--shadow-sm);
}

.preorder-badge-inline {
  position: static;
  display: inline-block;
  box-shadow: none;
  vertical-align: middle;
}

.preorder-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.preorder-note,
.cart-line-preorder-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0.2rem 0 0;
}

.product-card-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.product-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-name a {
  color: var(--color-text);
}

.product-card-name a:hover {
  color: var(--color-primary);
}

.product-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
}

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

/* ==========================================================
   Skeleton loading state
   ========================================================== */
.skeleton {
  background: linear-gradient(100deg, var(--color-border) 30%, #f0eee7 50%, var(--color-border) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -150% 0;
  }
}

.skeleton-card .product-card-media {
  background: none;
}

.skeleton-line {
  height: 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: linear-gradient(100deg, var(--color-border) 30%, #f0eee7 50%, var(--color-border) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.short {
  width: 55%;
}

/* ==========================================================
   Empty / error states
   (shared: homepage catalog grid, product-detail "not found",
   cart page's empty state, checkout page's empty-cart state)
   ========================================================== */
.state-panel {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--color-text-muted);
}

.state-panel svg {
  width: 48px;
  height: 48px;
  stroke: var(--color-text-muted);
  margin-bottom: 1rem;
}

.state-panel h3 {
  color: var(--color-text);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.state-panel p {
  margin: 0 0 1.25rem;
}

.empty-cart {
  text-align: center;
  padding: 5rem 1.5rem;
  grid-column: 1 / -1;
}

.empty-cart svg {
  width: 56px;
  height: 56px;
  stroke: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.empty-cart h2 {
  margin: 0 0 0.5rem;
}

.empty-cart p {
  color: var(--color-text-muted);
  margin: 0 0 1.75rem;
}

/* ==========================================================
   Quantity stepper
   (shared: product-detail page and cart line items)
   ========================================================== */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-stepper button {
  width: 40px;
  height: 44px;
  border: none;
  background: var(--color-surface);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text);
}

.qty-stepper button:hover:not(:disabled) {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.qty-stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-stepper input {
  width: 46px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.95rem;
  font-family: inherit;
}

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

/* ==========================================================
   Summary panel
   (shared: cart page sidebar, checkout page sidebar, and the
   itemized rows reused on the order-success receipt)
   ========================================================== */
.cart-summary {
  position: sticky;
  top: 6.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.cart-summary h2 {
  font-size: 1.2rem;
  margin: 0 0 1.25rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 0.7rem;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.9rem;
  margin-top: 0.4rem;
  border-top: 1px solid var(--color-border);
}

.cart-summary .btn {
  margin-top: 1.5rem;
}

.cart-summary .btn-secondary {
  margin-top: 0.75rem;
}

.order-summary-items {
  margin-bottom: 1.25rem;
}

.order-summary-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.order-summary-item-media {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-primary-light);
}

.order-summary-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-summary-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.order-summary-item-qty {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Variant sub-label ("M / Red") on a cart / summary / receipt line. */
.cart-line-variant,
.order-summary-item-variant {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0.1rem 0 0.2rem;
}

.order-summary-item-subtotal {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 3.5rem 0 2rem;
  background: var(--color-white);
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.site-footer > .container {
  text-align: center;
}

/* Link back to the main Sasulos corporate site (sasulosimports.com) —
   this shop is a separate subdomain application, not a replacement for it. */
.back-to-corporate {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  transition: color var(--transition);
}

.back-to-corporate:hover {
  color: var(--color-primary);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2.5rem;
  text-align: left;
  margin-bottom: 2.5rem;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .brand {
  display: inline-block;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.footer-col a {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }
  .footer-links {
    gap: 2rem;
  }
}

/* ==========================================================
   Keyframes
   ========================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
