/* =========================================
   Franklin Puzzles — Global Styles
   Mobile-first, responsive
   ========================================= */

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

:root {
  --color-bg: #faf9f7;
  --color-white: #ffffff;
  --color-black: #1a1a1a;
  --color-text: #2c2c2c;
  --color-muted: #6b6b6b;
  --color-border: #e0ddd8;
  --color-accent: #3a5a3a;       /* forest green */
  --color-accent-light: #e8f0e8;
  --color-price: #1a1a1a;
  --color-sale: #c0392b;
  --color-btn: #2c2c2c;
  --color-btn-text: #ffffff;
  --color-btn-hover: #3a5a3a;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --max-width: 1280px;
  --header-height: 56px;
  --top-bar-height: 30px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================================
   HEADER
   ========================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.header-top-bar {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
}

.header-logo {
  font-family: var(--font-serif);
  font-weight: normal;
  letter-spacing: 0.05em;
  color: var(--color-black);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-img {
  display: block;
  height: 48px;
  width: auto;
}

.header-logo-text {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: normal;
  letter-spacing: 0.05em;
  color: var(--color-black);
  white-space: nowrap;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon-btn {
  background: none;
  border: none;
  padding: 4px;
  color: var(--color-black);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.header-icon-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hamburger / mobile nav toggle */
.nav-toggle {
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-black);
  border-radius: 2px;
  transition: all 0.25s;
}

/* Desktop nav — hidden on mobile, shown via media query */
.main-nav {
  display: none;
}

.main-nav ul {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.main-nav ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-black);
}

.main-nav ul li a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* Mobile nav — fixed drop-down below header */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; /* overridden by layout.js after render */
  left: 0;
  right: 0;
  z-index: 99;
  flex-direction: column;
  background: var(--color-white);
  border-bottom: 2px solid var(--color-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  display: block;
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-black);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}

.mobile-nav a:last-child { border-bottom: none; }

.mobile-nav a:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* =========================================
   HERO / PROMO BANNER
   ========================================= */

.promo-banner {
  background: var(--color-accent-light);
  border-bottom: 1px solid #c5d9c5;
  padding: 28px 16px;
  text-align: center;
}

.promo-banner-inner {
  max-width: 700px;
  margin: 0 auto;
}

.promo-banner h2 {
  font-family: var(--font-serif);
  font-size: clamp(18px, 5vw, 28px);
  font-weight: normal;
  color: var(--color-accent);
  margin-bottom: 10px;
  line-height: 1.3;
}

.promo-banner p {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 18px;
}

.btn {
  display: inline-block;
  background: var(--color-btn);
  color: var(--color-btn-text);
  border: none;
  padding: 11px 28px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--color-btn-hover);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}

.promo-banner-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 28px;
  text-align: left;
}

.promo-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.promo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.promo-card-body {
  padding: 12px;
}

.promo-card-body p {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-black);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.promo-card-body span {
  font-size: 12px;
  color: var(--color-muted);
}

/* =========================================
   SECTION HEADINGS
   ========================================= */

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 16px;
}

.section-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(18px, 4vw, 24px);
  font-weight: normal;
  color: var(--color-black);
}

.section-heading a {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
}

/* =========================================
   PRODUCT GRID / CAROUSEL
   ========================================= */

.products-section { padding-bottom: 32px; }

.products-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.products-scroll-wrapper::-webkit-scrollbar { display: none; }

.products-grid {
  display: flex;
  gap: 14px;
  padding-bottom: 8px;
  width: max-content;
}

.product-card {
  width: 200px;
  flex-shrink: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }

.product-card-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0ece4;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

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

.product-card-info {
  padding: 10px 12px 14px;
}

.product-card-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-black);
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card-info .price {
  font-size: 13px;
  color: var(--color-muted);
}

.product-card-info .price-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  display: block;
  margin-bottom: 1px;
}

/* =========================================
   SPECIAL TOUCHES SECTION
   ========================================= */

.special-touches {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 36px 0;
  margin: 20px 0;
}

.touches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.touch-item { text-align: center; padding: 0 8px; }

.touch-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  background: var(--color-accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.touch-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--color-accent);
  fill: none;
  stroke-width: 1.5;
}

.touch-item h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: normal;
  margin-bottom: 8px;
  color: var(--color-black);
}

.touch-item p {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.6;
}

/* =========================================
   FEATURE SECTIONS (Made in USA / Whimsical / Framing)
   ========================================= */

.feature-section {
  padding: 56px 0;
}

.feature-dark {
  background: #1e2c1e;
  color: #fff;
}

.feature-light {
  background: var(--color-white);
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
}

.feature-light--alt {
  background: var(--color-bg);
}

/* Inner: stacked on mobile, side-by-side on desktop */
.feature-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.feature-text {
  flex: 1;
  max-width: 520px;
}

.feature-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8ab08a;
  margin-bottom: 10px;
  font-weight: 600;
}

.feature-light .feature-eyebrow,
.feature-light--alt .feature-eyebrow {
  color: var(--color-accent);
}

.feature-heading {
  font-family: var(--font-serif);
  font-size: clamp(24px, 5vw, 38px);
  font-weight: normal;
  line-height: 1.15;
  margin-bottom: 18px;
  color: inherit;
}

.feature-dark .feature-heading { color: #fff; }

.feature-body {
  font-size: 15px;
  line-height: 1.75;
  color: #b0c4b0;
  margin-bottom: 28px;
}

.feature-light .feature-body,
.feature-light--alt .feature-body {
  color: var(--color-muted);
}

.feature-btn {
  display: inline-block;
  background: #fff;
  color: #1e2c1e;
  border: none;
  padding: 12px 28px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.feature-btn:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

.feature-light .feature-btn,
.feature-light--alt .feature-btn {
  background: var(--color-btn);
  color: #fff;
}

.feature-light .feature-btn:hover,
.feature-light--alt .feature-btn:hover {
  background: var(--color-btn-hover);
}

/* Images side */
.feature-images {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-images--duo {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.feature-img-wrap {
  flex: 1;
  overflow: hidden;
}

.feature-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Second image nudged down to create stagger effect */
.feature-img-wrap--offset {
  margin-top: 24px;
}

.feature-img-wrap--tall img {
  aspect-ratio: 6 / 7;
  object-fit: cover;
}

/* Desktop: side-by-side */
@media (min-width: 768px) {
  .feature-inner {
    flex-direction: row;
    align-items: center;
    gap: 64px;
  }

  /* Reverse layout: images left, text right */
  .feature-inner--reverse {
    flex-direction: row-reverse;
  }

  .feature-text { flex: 0 0 44%; }
  .feature-images { flex: 1; }
}

/* =========================================
   FOOTER
   ========================================= */

.site-footer {
  background: var(--color-black);
  color: #ccc;
  padding: 40px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  font-size: 13px;
  color: #aaa;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-contact p {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 6px;
  line-height: 1.5;
}

.footer-newsletter {
  margin-bottom: 28px;
}

.footer-newsletter h4 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 12px;
}

.footer-newsletter-form {
  display: flex;
  gap: 0;
  max-width: 360px;
}

.footer-newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.footer-newsletter-form input::placeholder { color: #777; }

.footer-newsletter-form button {
  padding: 10px 18px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-legal a {
  font-size: 11px;
  color: #777;
}

.footer-legal a:hover { color: #aaa; text-decoration: none; }

.footer-social {
  display: flex;
  gap: 14px;
}

.footer-social a {
  color: #aaa;
  font-size: 12px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-social a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-copy {
  font-size: 11px;
  color: #555;
}

/* =========================================
   ===  PRODUCT DETAIL PAGE  ===
   ========================================= */

.breadcrumb {
  font-size: 12px;
  color: var(--color-muted);
  padding: 14px 0 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-accent); text-decoration: none; }
.breadcrumb span { color: var(--color-border); }

/* Product layout — stacked on mobile, two-col on desktop */
.product-detail {
  padding: 12px 0 48px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* Image gallery */
.product-gallery {
  min-width: 0;
}

.product-main-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  background: #f0ece4;
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: 10px;
}

.product-main-image img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.product-thumbnails::-webkit-scrollbar { display: none; }

.thumb-btn {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}

.thumb-btn.active { border-color: var(--color-accent); }
.thumb-btn:hover { border-color: var(--color-border); }

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product info panel */
.product-info {}

.product-info .product-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: normal;
  color: var(--color-black);
  margin-bottom: 10px;
  line-height: 1.2;
}

.product-price-block {
  margin-bottom: 16px;
}

.price-label-sm {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  display: block;
  margin-bottom: 3px;
}

.product-price {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-price);
}

.product-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-accent-light);
  border: 1px solid #c5d9c5;
}

.meta-item {}

.meta-item .meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  display: block;
  margin-bottom: 2px;
}

.meta-item .meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-black);
}

/* Qty + Add to cart */
.add-to-cart-block {
  margin-bottom: 20px;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.qty-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  min-width: 60px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
}

.qty-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qty-btn:hover { background: var(--color-accent-light); }

.qty-input {
  width: 44px;
  height: 36px;
  border: none;
  border-left: 1.5px solid var(--color-border);
  border-right: 1.5px solid var(--color-border);
  text-align: center;
  font-size: 14px;
  font-family: inherit;
  background: none;
  color: var(--color-black);
  outline: none;
}

.cart-count-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-left: 4px;
}

.btn-add-cart {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--color-btn);
  color: #fff;
  border: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-add-cart:hover { background: var(--color-btn-hover); }

.shipping-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
  text-align: center;
}

.shipping-note a { color: var(--color-accent); }

/* Product description */
.product-description {
  margin-top: 24px;
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.product-description h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: normal;
  margin-bottom: 12px;
  color: var(--color-black);
}

.product-description p {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 10px;
}

.whimsy-note {
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-accent);
  line-height: 1.5;
}

/* =========================================
   RESPONSIVE — TABLET / DESKTOP
   ========================================= */

@media (min-width: 640px) {
  .promo-banner { padding: 36px 24px; }

  .touches-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .product-card { width: 220px; }
}

@media (min-width: 768px) {
  :root { --header-height: 62px; }

  .nav-toggle { display: none; }

  .main-nav { display: block; }

  .main-nav ul li a:hover { background: transparent; color: var(--color-accent); }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .header-logo {
    flex: unset;
    text-align: left;
  }

  .main-nav { grid-column: 2; }

  .header-icons {
    justify-content: flex-end;
  }
}

@media (min-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
  }

  .product-meta {
    grid-template-columns: repeat(3, 1fr);
  }

  .product-card { width: 240px; }
}
