/* ============================================================
   YS FASHIONS — components.css
   Header, footer, product cards, cart, checkout, page-specific UI.
   ============================================================ */

/* ---------- Preview / sample-data banner ---------- */
.preview-banner {
  background: var(--color-gold);
  color: var(--color-navy-dark);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-100);
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-height);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-navy);
  white-space: nowrap;
}
.brand img { height: 36px; width: 36px; object-fit: contain; }

.main-nav {
  display: none;
  gap: 24px;
}
.main-nav a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-navy);
  padding: 8px 0;
}
.main-nav a.active { color: var(--color-gold); border-bottom: 2px solid var(--color-gold); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-navy);
}
.icon-btn:hover { background: var(--color-gray-50); }
.cart-count {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--color-gold);
  color: var(--color-navy-dark);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.mobile-nav-toggle {
  display: inline-flex;
  background: none; border: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.mobile-nav-toggle span, .mobile-nav-toggle::before, .mobile-nav-toggle::after {
  content: ''; display: block; width: 22px; height: 2px; background: var(--color-navy); position: relative;
}
.mobile-nav-toggle::before { transform: translateY(-6px); }
.mobile-nav-toggle::after { transform: translateY(4px); }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--color-gray-100);
  background: var(--color-white);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-gray-50);
  font-weight: 600;
  color: var(--color-navy);
}

@media (min-width: 900px) {
  .main-nav { display: flex; }
  .mobile-nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
  color: var(--color-white);
  padding: 56px 0;
}
.hero .container { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero-eyebrow {
  color: var(--color-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}
.hero h1 { color: var(--color-white); max-width: 640px; }
.hero p { color: var(--color-gray-300); max-width: 520px; }

/* ---------- Category cards ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-100);
  transition: box-shadow .15s ease, transform .15s ease;
}
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-card .cat-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--color-cream);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
}
.category-card h3 { margin: 0; font-size: 0.95rem; }

/* ---------- Product grid & card ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-gray-100);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-thumb {
  aspect-ratio: 3 / 4;
  background: var(--color-gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-500);
  font-size: 0.78rem;
  text-align: center;
  padding: 8px;
  position: relative;
}
.product-thumb .placeholder-glyph {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-gold-light);
  display: block;
  margin-bottom: 6px;
}
.product-card .product-info { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card .product-category { font-size: 0.72rem; color: var(--color-gray-500); text-transform: uppercase; letter-spacing: 0.04em; }
.product-card h3 { font-size: 0.92rem; margin: 0; }
.product-card .product-price { font-weight: 700; color: var(--color-navy); margin-top: auto; }
.product-card .product-price .strike { color: var(--color-gray-500); font-weight: 400; text-decoration: line-through; margin-left: 6px; font-size: 0.8rem; }

.empty-state {
  text-align: center;
  padding: 56px 16px;
  color: var(--color-gray-500);
  border: 1px dashed var(--color-gray-300);
  border-radius: var(--radius-lg);
  background: var(--color-white);
}
.empty-state h3 { color: var(--color-gray-700); }

/* ---------- Shop toolbar ---------- */
.shop-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: 0 14px;
}
.search-box input { border: none; padding: 12px 0; min-height: 44px; background: transparent; width: 100%; }
.search-box input:focus { outline: none; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row select {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-300);
  background: var(--color-white);
  min-height: 40px;
}
.result-count { font-size: 0.85rem; color: var(--color-gray-500); }

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 860px) { .product-detail { grid-template-columns: 1fr 1fr; } }

.product-gallery-main {
  aspect-ratio: 1 / 1;
  background: var(--color-gray-50);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-gray-500);
  border: 1px solid var(--color-gray-100);
}

.pd-price { font-size: 1.5rem; font-weight: 700; color: var(--color-navy); margin: 8px 0; }

.option-group { margin-bottom: 20px; }
.option-group .option-label { font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; display: flex; justify-content: space-between; }
.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  min-width: 44px; height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-gray-300);
  background: var(--color-white);
  font-weight: 600;
  cursor: pointer;
}
.swatch.selected { border-color: var(--color-navy); background: var(--color-navy); color: var(--color-white); }
.swatch:disabled, .swatch.unavailable { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--color-gray-300); border-radius: var(--radius-md); }
.qty-stepper button { width: 40px; height: 40px; border: none; background: transparent; font-size: 1.1rem; cursor: pointer; }
.qty-stepper input { width: 44px; text-align: center; border: none; min-height: unset; padding: 0; }

.pd-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pd-actions .btn { flex: 1; min-width: 140px; }

.stock-note { font-size: 0.85rem; margin: 10px 0; }
.stock-note.ok { color: var(--color-success); }
.stock-note.low { color: var(--color-warning); }
.stock-note.out { color: var(--color-danger); }

/* ---------- Cart ---------- */
.cart-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-gray-100);
  align-items: center;
}
.cart-item-thumb {
  width: 76px; height: 96px;
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-gray-500);
  font-size: 0.7rem;
  text-align: center;
}
.cart-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.cart-item-variant { font-size: 0.8rem; color: var(--color-gray-500); margin-bottom: 8px; }
.cart-item-remove { font-size: 0.8rem; color: var(--color-danger); background: none; border: none; cursor: pointer; padding: 0; }
.cart-item-price { text-align: right; font-weight: 700; white-space: nowrap; }

.summary-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-100);
  padding: 20px;
}
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.92rem; color: var(--color-gray-700); }
.summary-row.total { border-top: 1px solid var(--color-gray-100); margin-top: 8px; padding-top: 14px; font-weight: 700; font-size: 1.1rem; color: var(--color-navy); }

.cart-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 860px) { .cart-layout { grid-template-columns: 1.7fr 1fr; align-items: start; } }
.summary-card { position: sticky; top: calc(var(--header-height) + 16px); }

/* ---------- Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 860px) { .checkout-layout { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.checkout-section { background: var(--color-white); border-radius: var(--radius-lg); border: 1px solid var(--color-gray-100); padding: 20px; margin-bottom: 16px; }
.payment-option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.payment-option input { width: auto; min-height: unset; }
.payment-option.selected { border-color: var(--color-navy); background: var(--color-cream); }
.mini-item-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 6px 0; color: var(--color-gray-700); }

/* ---------- Confirmation ---------- */
.confirmation-box {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 20px;
}
.confirmation-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--color-success);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
}
.order-number-pill {
  display: inline-block;
  background: var(--color-cream);
  border: 1px dashed var(--color-gold);
  color: var(--color-navy);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  margin: 12px 0 24px;
  letter-spacing: 0.04em;
}

/* ---------- Track order ---------- */
.status-track { display: flex; flex-direction: column; gap: 0; margin-top: 24px; }
.status-step { display: flex; gap: 14px; padding-bottom: 24px; position: relative; }
.status-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px; top: 30px; bottom: 0;
  width: 2px;
  background: var(--color-gray-300);
}
.status-step.done:not(:last-child)::before { background: var(--color-gold); }
.status-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  font-weight: 700;
}
.status-step.done .status-dot { background: var(--color-gold); color: var(--color-navy-dark); }
.status-step.current .status-dot { background: var(--color-navy); color: var(--color-white); }
.status-step-label { font-weight: 600; color: var(--color-navy); }
.status-step-time { font-size: 0.8rem; color: var(--color-gray-500); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-navy-dark); color: var(--color-gray-300); margin-top: 48px; padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h4 { color: var(--color-white); font-size: 0.9rem; margin-bottom: 12px; }
.footer-grid a, .footer-grid p { color: var(--color-gray-300); font-size: 0.88rem; }
.footer-grid li { margin-bottom: 8px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand img { height: 32px; width: 32px; object-fit: contain; }
.footer-brand span { font-family: var(--font-heading); font-weight: 700; color: var(--color-white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 28px; padding-top: 16px; font-size: 0.78rem; color: var(--color-gray-500); text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-navy);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.82rem; color: var(--color-gray-500); margin-bottom: 16px; }
.breadcrumb a { color: var(--color-gray-500); }
.breadcrumb a:hover { color: var(--color-navy); }
