/* Theme aligned with site-layout.css (light theme) */
:root{
  --bg: #FAF9F6;
  --text: #1A1A1A;
  --muted: #636363;
  --accent: #D4A373;
  --accent-dark: #AD7A4B;
  --panel: #FFFFFF;
  --border: #EAE7E2;
  --shadow: 0 10px 24px rgba(0,0,0,0.08);
  --radius: 14px;
}

/* Reset / base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  padding:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  background:var(--bg);
  color:var(--text);
  display:flex;
  flex-direction:column;
}

/* Page title */
.page-title{
  max-width:1200px;
  margin:28px auto 12px;
  padding:0 20px;
  text-align:center;
}
.page-title h1{
  font-family: "Playfair Display", serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  margin:0;
  color:var(--text);
}
.page-title h3{
  margin:6px 0 0;
  color:var(--muted);
  font-weight:600;
}

/* center the subtitle on the page (applies to the <p class="page-subtitle">) */
.page-subtitle {
  max-width: 1200px;
  margin: 6px auto 0;
  padding: 0 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

/* Header / site chrome (match index) */
.site-header{
  width:100%;
  position:sticky;
  top:0;
  z-index:60;
  background: linear-gradient(180deg, rgba(250,249,246,0.9), rgba(250,249,246,0.85));
  border-bottom:1px solid var(--border);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.site-header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:12px 20px;
  display:flex;
  align-items:center;
  gap:16px;
  justify-content:space-between;
}

/* Logo */
.logo { display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; }
.logo-icon{ width:44px; height:44px; border-radius:8px; background:linear-gradient(180deg,#fff,#f3f3f3); padding:6px; }
.logo-text .brand{ font-weight:700; font-size:1.1rem; }
.logo-text .tagline{ font-size:0.8rem; color:var(--muted) }

/* Nav */
.main-nav{
  position: relative;
  z-index: 80;
  font-weight:600;
}
.main-nav ul{ display:flex; gap:14px; align-items:center; list-style:none; margin:0; padding:0; }
.main-nav a{ color:var(--text); text-decoration:none; padding:8px 10px; border-radius:8px; display:inline-block; }
.main-nav a:hover, .main-nav a:focus{ background: rgba(212,163,115,0.06); color:var(--accent-dark); outline:none; }

/* parent with mega */
.main-nav .has-mega{ position:relative; }

/* mega panel */
.main-nav .mega{
  position:absolute;
  left:0;
  right:0;
  top:100%;
  margin-top:10px;
  background:var(--panel);
  border:1px solid var(--border);
  box-shadow:0 28px 60px rgba(0,0,0,0.10);
  border-radius:12px;
  overflow:hidden;
  opacity:0;
  transform:translateY(8px) scale(.995);
  transition:opacity .20s ease, transform .20s ease;
  pointer-events:none;
}

/* show on hover/focus */
.main-nav .has-mega:hover > .mega,
.main-nav .has-mega:focus-within > .mega {
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}

/* inner grid */
.mega-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:22px;
  padding:24px;
  max-width:1200px;
  margin:0 auto;
  align-items:start;
}
.mega-col h4{ margin:0 0 8px; font-size:14px; color:var(--text); }
.mega-col ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.mega-col a{ color:var(--muted); text-decoration:none; }
.mega-col a:hover, .mega-col a:focus{ color:var(--text); }

/* promo column */
.mega-col.promo{ background: linear-gradient(180deg, rgba(212,163,115,0.04), transparent); padding:14px; border-radius:8px; }

/* accessibility */
.mega a:focus{ outline:3px solid rgba(212,163,115,0.12); outline-offset:3px; border-radius:6px; }

/* mobile behaviour */
@media (max-width:880px){
  .main-nav ul{ flex-wrap:wrap; gap:8px; }
  .main-nav .mega{
    position:static;
    transform:none;
    opacity:1;
    pointer-events:auto;
    border:0;
    box-shadow:none;
    background:transparent;
    margin:0;
    display:none; /* toggled with .open */
  }
  .main-nav .mega.open{ display:block; }
  .mega-grid{ display:block; padding:12px 16px; }
  .mega-col{ margin-bottom:16px; }
  .mega-col.promo{ padding:12px; }
}

/* toggle control (inserted in header or existing markup) */
.mega-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:transparent;
  border:0;
  padding:6px 8px;
  cursor:pointer;
  color:var(--text);
  font-weight:700;
  border-radius:8px;
}
.mega-toggle .caret{ transition: transform .18s ease; display:inline-block; }
.mega-toggle[aria-expanded="true"] .caret{ transform:rotate(180deg); }

/* small visual polish */
.main-nav .has-mega > a{ display:inline-flex; align-items:center; gap:8px; }
.mega-grid .sublink{ padding:6px 8px; border-radius:6px; }

/* Header actions */
.header-actions{ display:flex; align-items:center; gap:12px; }
.search input{
  width:220px; max-width:34vw; padding:8px 10px; border-radius:10px;
  border:1px solid var(--border); background:var(--panel); color:var(--text);
}

/* Layout: sidebar + content */
.shop-main{
  max-width:1280px;
  margin:18px auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

/* Sidebar (filters) tweaks */
.sidebar{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  box-shadow:var(--shadow);
  position:sticky;
  top:20px;
  height:fit-content;
}

.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-panel {
  border: 1px solid #e6cfaa;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf1 0%, #fff5e6 100%);
  padding: 10px;
}

.search-panel label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 800;
  color: #8a5a2d;
  letter-spacing: 0.02em;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e0c8a2;
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
}

.search-icon {
  font-size: 0.95rem;
  opacity: 0.72;
}

.search-input-wrap input {
  width: 100%;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
}

.search-help {
  margin: 7px 0 0;
  font-size: 0.75rem;
  color: #7a6a58;
}

.group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #7f5a32;
}

.group select,
.group input {
  width: 100%;
  height: 38px;
  border: 1px solid #e0c8a2;
  border-radius: 10px;
  background: #fffdf9;
  color: #2f2720;
  font-size: 0.9rem;
  padding: 0 10px;
}

.group select:focus,
.group input:focus,
.search-input-wrap:focus-within {
  border-color: #dca75d;
  box-shadow: 0 0 0 3px rgba(230, 165, 0, 0.15);
}

.filters-actions .btn.secondary {
  width: 100%;
  border: 1px solid #d9bd96;
  background: #fff4e2;
  color: #6b4b2f;
}

.filters-actions .btn.secondary:hover {
  background: #f0c88b;
  color: #2b1a09;
}

/* Sidebar collapsed state */
.sidebar.collapsed { display: none; }
@media (max-width:980px) {
  .shop-main { grid-template-columns: 1fr; padding:12px; }
  .sidebar { position:static; width:100%; margin-bottom:12px; }
}

/* Filter section */
.sidebar .filters { display:flex; flex-direction:column; gap:12px; }
.sidebar .filter-section { border-top:1px dashed var(--border); padding-top:12px; }
.sidebar .filter-section:first-child { border-top:0; padding-top:0; }
.sidebar .filter-section h4 {
  margin:0 0 8px; font-size:14px; color:var(--text);
  font-weight:700;
}
.filter-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.filter-list a, .filter-list button {
  display:flex; justify-content:space-between; align-items:center;
  text-decoration:none; color:var(--text); background:transparent; border:0;
  padding:6px 8px; border-radius:8px; cursor:pointer; font-size:14px;
}
.filter-list a:hover, .filter-list button:hover { background: rgba(212,163,115,0.04); color:var(--accent); }
.filter-count { color:var(--muted); font-size:13px; margin-left:8px; }

/* quick search inside sidebar */
.filter-search input {
  width:100%; padding:8px 10px; border-radius:8px; border:1px solid var(--border);
  background:var(--panel); box-sizing:border-box;
}

/* Product grid */
.product-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:12px;
}

/* Compact variant (even smaller cards) */
.product-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap:10px;
}

/* Product card */
.product-item{
  display:flex; flex-direction:column; gap:8px;
  background:var(--panel); border:1px solid var(--border); border-radius:10px;
  padding:8px; box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition:transform .12s ease, box-shadow .12s ease;
  min-height:160px;
}
.product-item:hover{ transform:translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.08); }

/* Image */
.product-link{ display:block; border-radius:8px; overflow:hidden; line-height:0; }
.product-image{
  width:100%; height:138px; object-fit:cover; object-position:center; display:block;
  border-radius:6px; background:linear-gradient(180deg,#f7f5f0,#efece6);
}

/* Title/meta */
.product-name{ margin:0; font-size:0.92rem; font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.product-price{ font-weight:800; color:var(--accent); font-size:0.95rem; }

/* Actions */
.product-actions{ display:flex; gap:8px; align-items:center; justify-content:flex-end; margin-top:auto; }
.add-to-cart, .product-actions .btn{
  background:var(--accent); color:#fff; border:none; padding:8px 10px; border-radius:8px; cursor:pointer; font-weight:700; font-size:0.86rem;
}
.add-to-cart:hover{ background:var(--accent-dark); }

/* Quantity controls */
.qty-controls{ display:flex; gap:6px; align-items:center; }
.qty-controls button{ padding:6px 8px; border-radius:6px; border:1px solid var(--border); background:transparent; cursor:pointer; font-size:0.9rem; }

/* Responsive adjustments */
@media (max-width:980px){
  .shop-main{ grid-template-columns: 1fr; padding: 12px; }
  .sidebar{ position:static; order:-1; width:auto; margin-bottom:12px; }
  .product-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap:14px; }
}
@media (max-width:640px){
  .product-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-image{ height:118px; }
  .product-name{ font-size:0.95rem; }
  .add-to-cart{ padding:8px 10px; font-size:0.88rem; }
  .small-search input { width:100%; }
}

/* Utility: sidebar category badges (optional) */
.filter-badge {
  background:var(--accent); color:#fff; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:700;
}

/* Footer (match index) */
footer.site-footer{
  background:transparent;
  padding:28px 20px;
  color:var(--muted);
  border-top:1px solid var(--border);
}
.footer-container{ max-width:1200px; margin:0 auto; display:flex; gap:24px; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.footer-section a{ color:var(--text); text-decoration:none; }
.footer-section a:hover{ color:var(--accent); }

/* Utility */
.btn{ display:inline-block; padding:10px 14px; border-radius:10px; text-decoration:none; font-weight:700; }
.btn-primary{ background:var(--accent); color:#fff; }
.btn-outline{ border:1px solid var(--border); color:var(--text); background:transparent; padding:8px 12px; border-radius:8px; }

/* Accessibility focus */
a:focus, button:focus, .product-link:focus{ outline:3px solid rgba(212,163,115,0.12); outline-offset:3px; }

/* Compact toolbar */
.toolbar {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:12px;
}
.small-search input {
  width:320px; max-width:60vw; padding:8px 10px; border-radius:8px; border:1px solid var(--border);
  background:var(--panel);
}

/* utility: larger grid spacing when not compact */
.product-grid:not(.compact) .product-item { padding:10px; min-height:180px; }

/* override: ensure accessible focus styles persist */
a:focus, button:focus, .product-link:focus { outline:3px solid rgba(212,163,115,0.12); outline-offset:3px; }

.shop-mega,
.under-15 {
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff8ee 100%);
  border: 1px solid #e7d2b0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.shop-mega h2,
.under-15 h2 {
  margin: 0 0 4px;
  color: #9a6532;
  font-size: 1.2rem;
}

.under-15-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.under-15-grid .product-item {
  border-color: #e6d6bc;
  background: #fffaf2;
}

.shop-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.vendor-collections {
  margin: 18px 0 20px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff8ee 100%);
  border: 1px solid #e7d2b0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.vendor-collections-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 16px;
}

.vendor-kicker {
  margin: 0 0 6px;
  color: #8a5a2d;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vendor-collections-head h2 {
  margin: 0;
  color: #9a6532;
  font-size: 1.3rem;
}

.vendor-collections-copy {
  margin: 0;
  max-width: 540px;
  color: var(--muted);
  font-size: 0.94rem;
}

.vendor-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.vendor-collection-card {
  border: 1px solid #e6d1b5;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, #fff8ec 0%, #fff3df 100%);
}

.vendor-theme-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 163, 115, 0.16);
  color: #8a5a2d;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vendor-collection-card h3 {
  margin: 12px 0 8px;
  color: #2b1a09;
  font-size: 1.05rem;
}

.vendor-collection-card p {
  margin: 0 0 14px;
  color: #6a5647;
  font-size: 0.94rem;
}

.vendor-collection-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: #7a6a58;
  font-size: 0.86rem;
  font-weight: 700;
}

.vendor-collection-card .btn {
  width: 100%;
  text-align: center;
}

.mega-col {
  border: 1px solid #e6d1b5;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #fff8ec 0%, #fff3df 100%);
}

.mega-col h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: #8a5a2d;
  font-weight: 800;
}

.mega-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mega-link {
  border: 1px solid #e0c7a3;
  background: #fffdfa;
  color: #6b4b2f;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mega-link:hover {
  border-color: #dca75d;
  background: #f1c98d;
  color: #2b1a09;
}

.mega-link:focus-visible {
  outline: 3px solid rgba(230, 165, 0, 0.22);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .shop-mega-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vendor-collections-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .shop-mega-grid {
    grid-template-columns: 1fr;
  }
}

.protected-image {
  -webkit-user-drag: none;
  user-select: none;
}

.watermarked {
  position: relative;
}

.watermarked::after {
  content: "V2 Jigsaw\A Puzzle Warehouse";
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  font-weight: 700;
  white-space: pre;
  pointer-events: none;
}

.shop-image-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 20px;
}

.shop-image-modal.open {
  display: flex;
}

body.shop-image-modal-open {
  overflow: hidden;
}

.shop-image-modal-stage {
  max-width: min(1200px, 94vw);
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 20, 20, 0.95);
}

.shop-image-modal-stage img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.shop-image-modal-stage.watermarked::after {
  right: 50%;
  bottom: 50%;
  transform: translate(50%, 50%) rotate(-18deg);
  font-size: clamp(14px, 2vw, 24px);
  opacity: 0.4;
  padding: 8px 14px;
}

.shop-image-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 640px) {
  .shop-image-modal {
    padding: 12px;
  }

  .shop-image-modal-close {
    top: 10px;
    right: 10px;
  }
}
