/* ════════════════════════════════════════════════
   YB Ausome Shoppe — Store v3 (Printful-first)
   ════════════════════════════════════════════════ */

:root {
  --baltic:     #000abe;
  --lime:       #4bb417;
  --cta:        #FFD000;
  --white:      #ffffff;
  --black:      #000000;
  --surface:    #ffffff;
  --surface-2:  #f5f6f8;
  --border:     #e2e4e9;
  --muted:      #6b7280;
  --faint:      #9ca3af;
  --danger:     #dc2626;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.18);
  --font:       "Nunito Sans", "Nunito", system-ui, sans-serif;
  --font-display: "Nunito", system-ui, sans-serif;
  --max-w:      1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--lime);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ── Skip link ── */
.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--cta); color: var(--black);
  padding: 12px 24px; font-weight: 700; font-size: 16px;
  text-decoration: none; z-index: 1000; transition: top .2s;
}
.skip-link:focus { top: 16px; outline: 3px solid var(--white); outline-offset: 2px; }

/* ── Site header ── */
header .site-nav {
  background: var(--baltic); padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; position: sticky; top: 0; z-index: 200;
  max-width: var(--max-w); width: 100%; margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-display); font-size: clamp(1.05rem,.95rem + .45vw,1.3rem);
  font-weight: 700; color: var(--white); text-decoration: none;
}
.nav-logo span { color: var(--white); }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a { color: var(--white); text-decoration: none; font-weight: 600; font-size: clamp(.95rem,.88rem + .35vw,1.12rem); }
.nav-links a:hover { opacity: .9; text-decoration: underline; }
.nav-shop-btn {
  background: var(--cta); color: var(--black); text-decoration: none;
  font-size: clamp(.85rem,.8rem + .2vw,.95rem); font-weight: 700;
  padding: 10px 22px; border-radius: 4px;
}
.nav-shop-btn:hover { background: var(--lime); }

/* ── Store shell ── */
.store-main {
  max-width: var(--max-w); margin: 0 auto;
  padding: 44px 32px 64px; background: var(--baltic);
}
.store-shell {
  position: relative; max-width: 1200px; margin: 0 auto;
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
  min-height: 60vh;
}

/* ── Store top bar ── */
.store-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.store-topbar__logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.1rem; color: var(--black); text-decoration: none;
}
.store-topbar__cart {
  background: var(--baltic); color: var(--white); border: none;
  padding: 8px 18px; border-radius: 6px; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; gap: 6px;
}
.cart-badge {
  background: var(--cta); color: var(--black); border-radius: 50%;
  min-width: 22px; height: 22px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}

/* ── Sync bar ── */
.sync-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 24px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: .82rem; color: var(--muted); gap: 12px; flex-wrap: wrap;
}
.sync-bar__btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 12px; font-size: .8rem; color: var(--baltic);
  font-weight: 600; white-space: nowrap;
}
.sync-bar__btn:hover { background: var(--baltic); color: var(--white); }

/* ── Loading overlay ── */
.store-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px; text-align: center;
}
.store-loading[hidden] { display: none; }
.store-loading__card { max-width: 320px; }
.store-loading__dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.store-loading__dots span {
  width: 12px; height: 12px; border-radius: 50%; background: var(--baltic);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.store-loading__dots span:nth-child(2) { animation-delay: .15s; }
.store-loading__dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: .25; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}
.store-loading__title { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.store-loading__hint { color: var(--muted); font-size: .88rem; line-height: 1.5; }

/* ── Pages ── */
.page { display: none; padding: 24px; }
.page.active { display: block; }

/* ── Section header ── */
.section-header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.section-header__title {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
}
.section-header__count { color: var(--muted); font-size: .88rem; }

.store-section { margin-bottom: 40px; }
.store-section:last-child { margin-bottom: 0; }

.empty-msg {
  color: var(--muted); font-size: .92rem; padding: 32px 16px;
  text-align: center; line-height: 1.6;
}
.empty-msg[hidden] { display: none; }

/* ════════════════════════════════════════
   Product Cards
   ════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  cursor: pointer; text-decoration: none; color: inherit; display: block;
}
.product-card:hover, .product-card:focus-visible {
  box-shadow: var(--shadow-md); transform: translateY(-2px);
}
.product-card:focus-visible { outline: 3px solid var(--baltic); outline-offset: 2px; }

.product-card__img {
  aspect-ratio: 1; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-card__img img {
  width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: multiply;
}
.product-card__img--emoji { font-size: 56px; }

.product-card__body { padding: 14px 16px 18px; }
.product-card__name {
  font-weight: 700; font-size: .92rem; line-height: 1.35;
  margin-bottom: 6px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__price { color: var(--baltic); font-weight: 700; font-size: .95rem; }
.product-card__meta { color: var(--muted); font-size: .78rem; margin-top: 4px; }

/* ════════════════════════════════════════
   Product Modal
   ════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 16px;
}
.modal-overlay[hidden] { display: none; }
.modal-overlay__bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 860px; width: 100%; z-index: 1;
  animation: modal-in .25s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.modal-panel__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: none;
  font-size: 22px; line-height: 1; display: flex;
  align-items: center; justify-content: center; color: var(--black);
}
.modal-panel__close:hover { background: var(--border); }
.modal-panel__title {
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 700; padding: 20px 24px 0;
}
.modal-panel__body { padding: 16px 24px 28px; }

/* ── Modal product layout (image + info) ── */
.modal-product {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  align-items: start;
}
.modal-product__media {
  aspect-ratio: 1; background: var(--surface-2);
  border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.modal-product__media img {
  width: 100%; height: 100%; object-fit: contain;
}
.modal-product__media--emoji { font-size: 72px; }
.modal-product__info { display: flex; flex-direction: column; gap: 16px; }

.modal-product__type { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.modal-product__price { font-size: 1.35rem; font-weight: 800; color: var(--baltic); }

/* ── Color selector (text pill buttons) ── */
.picker-label { font-weight: 700; font-size: .85rem; margin-bottom: 8px; color: var(--black); }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pill {
  padding: 7px 16px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface);
  font-size: .85rem; font-weight: 600; transition: all .15s;
  white-space: nowrap;
}
.color-pill:hover { border-color: var(--baltic); background: rgba(0,10,190,.04); }
.color-pill.active {
  background: var(--baltic); color: var(--white); border-color: var(--baltic);
}
.color-pill:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }

/* ── Size buttons ── */
.size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn {
  padding: 7px 16px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface);
  font-size: .85rem; font-weight: 600; transition: all .15s;
}
.size-btn:hover { border-color: var(--baltic); }
.size-btn.active {
  background: var(--baltic); color: var(--white); border-color: var(--baltic);
}
.size-btn:disabled {
  opacity: .35; cursor: not-allowed; border-color: var(--border);
}

/* ── Quantity + add to cart ── */
.qty-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.qty-row label { font-weight: 600; font-size: .88rem; }
.qty-input {
  width: 64px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; text-align: center; font-size: .95rem; font-weight: 600;
}
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* ── Buttons ── */
.btn-primary {
  background: var(--cta); color: var(--black); border: none;
  padding: 12px 28px; border-radius: 6px; font-weight: 700; font-size: .95rem;
  transition: background .15s;
}
.btn-primary:hover { background: var(--lime); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline {
  background: none; color: var(--baltic); border: 2px solid var(--baltic);
  padding: 10px 28px; border-radius: 6px; font-weight: 700; font-size: .95rem;
}
.btn-outline:hover { background: var(--baltic); color: var(--white); }
.btn-block { width: 100%; }

/* ════════════════════════════════════════
   Cart
   ════════════════════════════════════════ */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.cart-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.cart-item__emoji { font-size: 28px; flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__title { font-weight: 600; font-size: .92rem; }
.cart-item__fulfillment { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.cart-item__stepper {
  display: flex; align-items: center; gap: 0; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
}
.cart-item__stepper button {
  width: 32px; height: 32px; background: var(--surface-2);
  border: none; font-size: 1.1rem; font-weight: 700;
}
.cart-item__stepper button:hover { background: var(--border); }
.cart-item__stepper span {
  width: 36px; text-align: center; font-weight: 700; font-size: .88rem;
}
.cart-item__price { font-weight: 700; min-width: 60px; text-align: right; }
.cart-item__remove {
  background: none; border: none; color: var(--muted); font-size: 1.2rem;
  padding: 4px; line-height: 1;
}
.cart-item__remove:hover { color: var(--danger); }
.cart-empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.cart-sidebar { position: sticky; top: 80px; }
.cart-summary {
  background: var(--surface-2); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.cart-summary__line { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .9rem; }
.cart-summary__line--total { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--border); padding-top: 10px; margin-top: 10px; }

/* ════════════════════════════════════════
   Checkout
   ════════════════════════════════════════ */
.checkout-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.form-section { border: none; margin-bottom: 20px; }
.form-legend { font-weight: 700; font-size: 1rem; margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.form-group input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: .92rem;
}
.form-group input:focus { outline: 2px solid var(--baltic); outline-offset: -1px; }
.ship-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s;
}
.ship-option.selected { border-color: var(--baltic); background: rgba(0,10,190,.04); }
.ship-option input { accent-color: var(--baltic); }
.ship-option span { font-size: .88rem; font-weight: 500; }
.checkout-error { color: var(--danger); font-weight: 600; font-size: .9rem; min-height: 1.2em; }
.checkout-fine { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.checkout-sidebar { position: sticky; top: 80px; }
.checkout-order-summary { background: var(--surface-2); border-radius: var(--radius); padding: 20px; }

/* ── Success page ── */
.success-card {
  text-align: center; padding: 60px 24px; max-width: 420px; margin: 0 auto;
}
.success-card__icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--lime); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; margin: 0 auto 16px;
}
.success-card__title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 8px; }
.success-card__body { color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.success-card__order { font-size: .88rem; color: var(--muted); margin-bottom: 24px; }

/* ── Footer ── */
footer {
  background: var(--black); padding: 36px 48px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; max-width: var(--max-w); width: 100%; margin: 0 auto;
}
.footer-logo { font-family: var(--font-display); font-weight: 700; color: var(--white); text-decoration: none; font-size: 1.05rem; }
.footer-logo span { color: var(--white); }
footer p { color: var(--white); margin: 0; font-size: .88rem; }
footer a { color: var(--white); }
.footer-links { display: flex; gap: 24px; list-style: none; margin-top: 8px; }
.footer-links a { color: var(--white); text-decoration: none; font-weight: 600; font-size: .88rem; }
.footer-links a:hover { opacity: .9; }

/* ════════════════════════════════════════
   Responsive
   ════════════════════════════════════════ */
@media (max-width: 768px) {
  header .site-nav { padding: 0 16px; min-height: 52px; max-width: none; }
  header .nav-links { display: none; }
  .nav-shop-btn { font-size: 15px; padding: 10px 14px; }
  .store-main { padding: 16px 8px 32px; max-width: none; }
  .store-shell { border-radius: var(--radius); }
  .page { padding: 16px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product-card__body { padding: 10px 12px 14px; }
  .modal-overlay { padding: 16px 8px; }
  .modal-panel { border-radius: var(--radius); }
  .modal-product { grid-template-columns: 1fr; gap: 16px; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-sidebar { position: static; }
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-sidebar { position: static; }
  footer { max-width: none; padding: 24px 16px; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .modal-panel__body { padding: 12px 16px 20px; }
  .modal-product__media { aspect-ratio: 4/3; }
}
