/* =========================================================
   Vintage Poster Hut — Main Stylesheet
   ========================================================= */

/* --- Variables --- */
:root {
  --cream:       #FAF8F3;
  --cream-dark:  #F0EDE5;
  --charcoal:    #1C1917;
  --brown:       #3D2B1F;
  --gold:        #8B6914;
  --gold-light:  #C9A84C;
  --border:      #E0D8C8;
  --text-muted:  #6B5E52;
  --white:       #FFFFFF;
  --error:       #B91C1C;
  --success:     #15803D;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --radius:   4px;
  --radius-lg: 8px;
  --shadow:   0 1px 3px rgba(28,25,23,.08), 0 4px 12px rgba(28,25,23,.06);
  --shadow-lg: 0 8px 32px rgba(28,25,23,.12);

  --max-w: 1280px;
  --gap:   clamp(1rem, 3vw, 2rem);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--brown); text-decoration: underline; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Layout --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
main { flex: 1; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--brown);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p + p { margin-top: .75em; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brown);
  color: var(--white);
  border-color: var(--brown);
}
.btn-primary:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--brown);
  border-color: var(--brown);
}
.btn-outline:hover { background: var(--brown); color: var(--white); text-decoration: none; }
.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--brown); border-color: var(--brown); color: var(--white); text-decoration: none; }
.btn-sm { padding: .5rem 1.25rem; font-size: .875rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.0625rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: .375rem; font-size: .9375rem; }
.form-input, .form-select, .form-textarea {
  display: block;
  width: 100%;
  padding: .6875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--charcoal);
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,105,20,.15);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-error { color: var(--error); font-size: .875rem; margin-top: .3rem; }
.form-hint  { color: var(--text-muted); font-size: .875rem; margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* --- Header --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(28,25,23,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.site-logo .logo-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown);
  line-height: 1;
}
.site-logo .logo-tag {
  font-size: .72rem;
  color: var(--gold);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 2px;
}
.site-nav { display: flex; align-items: center; gap: 2rem; }
.nav-link {
  color: var(--charcoal);
  font-weight: 500;
  font-size: .9375rem;
  transition: color .2s;
}
.nav-link:hover { color: var(--gold); text-decoration: none; }
.nav-link.active { color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--charcoal);
  font-size: 1.4rem;
  transition: color .2s;
}
.cart-icon:hover { color: var(--gold); text-decoration: none; }
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gold);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--charcoal); margin: 5px 0; transition: .3s; }

/* --- Category Nav Bar --- */
.category-bar {
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-bar-inner {
  display: flex;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.category-bar a {
  padding: .65rem 1.1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  text-decoration: none;
}
.category-bar a:hover, .category-bar a.active {
  color: var(--brown);
  border-bottom-color: var(--gold);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--brown) 0%, #2A1A10 100%);
  color: var(--cream);
  padding: clamp(4rem, 10vw, 8rem) var(--gap);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 { color: var(--cream); font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1rem; }
.hero p { color: rgba(250,248,243,.8); font-size: 1.125rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* --- Product Grid --- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.section-title { margin-bottom: 0; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* --- Product Card --- */
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--cream-dark);
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.product-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--brown);
  margin-bottom: .25rem;
  line-height: 1.3;
}
.product-card-cat { font-size: .8125rem; color: var(--text-muted); margin-bottom: .5rem; }
.product-card-price { font-weight: 700; color: var(--charcoal); margin-top: auto; padding-top: .5rem; }
.product-card-price .was { text-decoration: line-through; color: var(--text-muted); font-weight: 400; margin-left: .5rem; font-size: .875rem; }

/* --- Product Detail --- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; padding: clamp(2rem, 4vw, 3rem) 0; }
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; } }
.product-gallery { position: sticky; top: 90px; }
.product-gallery-main { aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden; background: var(--cream-dark); border: 1px solid var(--border); }
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.product-thumb { width: 70px; height: 90px; border-radius: var(--radius); overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.product-thumb.active { border-color: var(--gold); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); margin-bottom: .5rem; }
.product-category-link { color: var(--gold); font-size: .875rem; margin-bottom: 1rem; display: block; }
.product-price { font-size: 1.625rem; font-weight: 700; color: var(--charcoal); margin: 1rem 0; }
.product-description { color: var(--text-muted); line-height: 1.7; margin-bottom: 1.5rem; }
.variant-label { font-weight: 600; margin-bottom: .5rem; display: block; }
.variant-select { margin-bottom: 1.5rem; }
.product-meta { display: flex; flex-direction: column; gap: .5rem; margin: 1.5rem 0; padding: 1rem; background: var(--cream-dark); border-radius: var(--radius); }
.product-meta-row { display: flex; gap: .5rem; font-size: .875rem; }
.product-meta-row strong { min-width: 120px; color: var(--brown); }

/* --- Cart --- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: .75rem 1rem; border-bottom: 2px solid var(--border); font-size: .875rem; color: var(--text-muted); font-weight: 600; }
.cart-table td { padding: 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-item-img { width: 72px; height: 90px; object-fit: cover; border-radius: var(--radius); }
.cart-qty { display: flex; align-items: center; gap: .5rem; }
.qty-btn { width: 30px; height: 30px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--white); cursor: pointer; font-size: 1rem; font-weight: 600; transition: background .2s; }
.qty-btn:hover { background: var(--cream-dark); }
.qty-input { width: 42px; text-align: center; padding: .25rem; border: 1.5px solid var(--border); border-radius: var(--radius); }
.remove-btn { color: var(--error); background: none; border: none; cursor: pointer; font-size: .875rem; padding: .25rem; }
.cart-summary { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; position: sticky; top: 100px; }
.cart-summary h3 { margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: .75rem; font-size: .9375rem; }
.summary-row.total { font-weight: 700; font-size: 1.125rem; padding-top: .75rem; border-top: 1px solid var(--border); margin-top: .75rem; }

/* --- Checkout --- */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.checkout-section h3 { margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.usa-notice { background: #FEF3C7; border: 1px solid #F59E0B; border-radius: var(--radius); padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1.25rem; }

/* --- Order Summary Sidebar --- */
.order-sidebar { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; position: sticky; top: 100px; }
.order-sidebar h3 { margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.order-item { display: flex; gap: .75rem; margin-bottom: 1rem; }
.order-item-img { width: 56px; height: 70px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.order-item-info { flex: 1; }
.order-item-title { font-size: .875rem; font-weight: 600; color: var(--brown); }
.order-item-variant { font-size: .8125rem; color: var(--text-muted); }
.order-item-price { font-size: .875rem; font-weight: 600; }

/* --- Flash Messages --- */
.flash { padding: .875rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9375rem; }
.flash-success { background: #DCFCE7; color: #14532D; border-left: 4px solid var(--success); }
.flash-error   { background: #FEE2E2; color: #7F1D1D; border-left: 4px solid var(--error); }
.flash-info    { background: #EFF6FF; color: #1E3A5F; border-left: 4px solid #3B82F6; }

/* --- Breadcrumb --- */
.breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: .875rem; color: var(--text-muted); padding: 1rem 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { color: var(--border); }

/* --- Pagination --- */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.page-btn { width: 40px; height: 40px; border: 1.5px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--charcoal); background: var(--white); font-weight: 500; cursor: pointer; transition: .2s; text-decoration: none; }
.page-btn:hover, .page-btn.active { background: var(--brown); border-color: var(--brown); color: var(--white); text-decoration: none; }
.page-btn:disabled { opacity: .4; cursor: default; }

/* --- Categories Grid --- */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-decoration: none;
  display: block;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); text-decoration: none; }
.category-card-icon { font-size: 2rem; margin-bottom: .75rem; }
.category-card-name { font-family: var(--font-heading); font-size: 1rem; color: var(--brown); margin-bottom: .25rem; }
.category-card-count { font-size: .8125rem; color: var(--text-muted); }

/* --- Footer --- */
.site-footer { background: var(--brown); color: rgba(250,248,243,.75); margin-top: auto; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding: 3rem var(--gap) 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .logo-name { color: var(--cream); }
.footer-brand .logo-tag  { color: var(--gold-light); }
.footer-brand p { margin-top: .75rem; font-size: .875rem; line-height: 1.6; }
.footer-col h4 { color: var(--cream); font-family: var(--font-heading); margin-bottom: 1rem; font-size: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul a { color: rgba(250,248,243,.7); font-size: .875rem; text-decoration: none; transition: color .2s; }
.footer-col ul a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(250,248,243,.15);
  padding: 1.25rem var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8125rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { color: rgba(250,248,243,.6); font-size: .8125rem; }
.footer-bottom-links a:hover { color: var(--gold-light); }
.payment-icons { display: flex; gap: .5rem; align-items: center; }
.payment-icon { background: rgba(255,255,255,.1); border-radius: 3px; padding: 2px 6px; font-size: .7rem; color: var(--cream); font-weight: 600; }

/* --- Misc --- */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.empty-state h3 { margin-bottom: .75rem; color: var(--brown); }
.badge { display: inline-block; padding: .2em .6em; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.badge-gold { background: var(--gold-light); color: var(--brown); }
.badge-success { background: #DCFCE7; color: #14532D; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* --- Account --- */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; padding: 2rem 0; }
@media (max-width: 768px) { .account-layout { grid-template-columns: 1fr; } }
.account-nav { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.account-nav a { display: flex; align-items: center; gap: .75rem; padding: .875rem 1.25rem; color: var(--charcoal); font-size: .9375rem; border-bottom: 1px solid var(--border); transition: background .2s; text-decoration: none; }
.account-nav a:last-child { border-bottom: none; }
.account-nav a:hover, .account-nav a.active { background: var(--cream-dark); color: var(--brown); }
.account-content { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; }

/* --- Auth Pages --- */
.auth-page { min-height: calc(100vh - 200px); display: flex; align-items: center; padding: 3rem var(--gap); }
.auth-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.5rem; max-width: 480px; width: 100%; margin: 0 auto; box-shadow: var(--shadow); }
.auth-card h2 { text-align: center; margin-bottom: 1.75rem; }
.auth-links { text-align: center; margin-top: 1.25rem; font-size: .9375rem; }

/* --- Loading spinner --- */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive header --- */
@media (max-width: 900px) {
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); flex-direction: column; gap: 0; padding: 1rem 0; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav .nav-link { padding: .75rem var(--gap); width: 100%; border-bottom: 1px solid var(--border); }
  .hamburger { display: block; }
  .header-inner { position: relative; }
}

/* --- Trust badges --- */
.trust-bar { background: var(--cream-dark); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-bar-inner { display: flex; justify-content: center; gap: clamp(1.5rem, 4vw, 3rem); padding: 1rem var(--gap); flex-wrap: wrap; max-width: var(--max-w); margin: 0 auto; }
.trust-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text-muted); }
.trust-item svg { color: var(--gold); }

/* --- Sort filter bar --- */
.filter-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.filter-bar-left { color: var(--text-muted); font-size: .9375rem; }
.sort-select { padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--white); font-size: .875rem; }

/* --- Secure badge on checkout --- */
.secure-badge { display: flex; align-items: center; gap: .5rem; color: var(--success); font-size: .875rem; font-weight: 600; }
