/* === Base Styles === */
:root {
  --primary: #ffffff;
  --secondary: #121212;
  --accent: #ff3366;
  --accent-light: #ff80ab;
  --text: #1c1c1c;
  --background: #fafafa;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Open Sans', sans-serif; }
body { background: var(--background); color: var(--text); }

/* === Swatch Color Circles === */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ccc; cursor: pointer; outline: none; transition: transform 0.2s; background-size: cover; background-position: center; }
.color-swatch.selected { border: 2px solid var(--accent); box-shadow: 0 0 0 2px #fff, 0 0 4px rgba(0, 0, 0, 0.3); transform: scale(1.1); }

/* === Header === */
header { background: var(--secondary); color: var(--primary); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 999; }
header h1 { font-size: 1.5rem; }
nav a { color: var(--primary); margin-left: 1.5rem; text-decoration: none; font-weight: 600; }

/* === Hero === */
.hero { background: linear-gradient(135deg, #f9f9f9, #e2e2e2); padding: 4rem 2rem; text-align: center; max-width: 1200px; margin: auto; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }

/* === Sections === */
.section { padding: 4rem 2rem; max-width: 1200px; margin: auto; }

/* === Products === */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.products.grid-layout { overflow: visible; }
article.product { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); transition: transform 0.3s ease; cursor: pointer; }
article.product:hover { transform: translateY(-5px); }
article.product img { width: 100%; height: auto; }
#themes .product img { height: 200px; width: 100%; object-fit: contain; background-color: #fff; padding: 1rem; }
.product-details { padding: 1rem; text-align: center; }
.product-details h3 { font-size: 1.1rem; margin: 0.5rem 0; }
.product-details p { color: #888; font-style: italic; font-size: 0.9rem; }

/* === Modal === */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.8); }
.modal-content { background: white; margin: 10% auto; padding: 2rem; border-radius: 10px; max-width: 500px; position: relative; }
.close { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; color: #000; cursor: pointer; }

/* === Modal Image === */
#modalImg { position: absolute; top: 20%; left: 50%; max-width: 36%; width: 100%; height: auto; transform: translateX(-50%); pointer-events: none; }

/* === Buttons === */
.button { display: inline-block; background: var(--accent); color: white; padding: 0.75rem 1.5rem; border: none; border-radius: 5px; font-weight: bold; text-decoration: none; margin-top: 1rem; transition: background 0.3s ease; }
.button:hover { background: var(--accent-light); }

/* === Quantity Controls === */
.qty-controls { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.qty-btn { background: var(--accent); color: white; border: none; padding: 0.3rem 0.75rem; font-size: 1rem; border-radius: 5px; cursor: pointer; font-weight: bold; }
.qty-btn:hover { background: var(--accent-light); }

/* === Responsive Themes (original mobile behavior) === */
@media (max-width: 768px) {
  #themes .products { display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; gap: 1rem; }
  #themes .product { flex: 0 0 auto; scroll-snap-align: start; min-width: 75%; }
  /* #modalImg { max-width: 50%; top: 30%; } */
}

/* === Contact Form === */
.contact-form h2 { font-size: 2rem; text-align: center; margin-bottom: 2rem; color: var(--text); }
.contact-form form { background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.05); max-width: 600px; margin: auto; }
.contact-form label { display: block; margin-top: 1rem; font-weight: 600; color: var(--text); }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.75rem; margin-top: 0.25rem; border: 1px solid #ccc; border-radius: 6px; background: var(--primary); color: var(--text); font-size: 1rem; }
.contact-form textarea { resize: vertical; }
.contact-form .hidden { display: none; }

/* === Footer === */
footer { background: var(--secondary); color: var(--primary); text-align: center; padding: 2rem; margin-top: 4rem; }
footer a { color: var(--accent); text-decoration: underline; }

/* === Mobile UX (baseline) === */
#hamburger { display: none; background: none; font-size: 1.5rem; border: none; color: white; cursor: pointer; }
.mobile-nav { display: none; flex-direction: column; background: #121212; position: absolute; top: 100%; left: 0; width: 100%; padding: 1rem 0; z-index: 998; }
.mobile-nav a { padding: 1rem; color: white; text-decoration: none; border-top: 1px solid #2c2c2c; }
.mobile-nav a:hover { background: #1f1f1f; }
.mobile-nav.hidden { display: none !important; }
@media (max-width: 768px) { #hamburger { display: block; } header nav:not(.mobile-nav) { display: none; } }

/* === Floating Cart Button === */
.floating-cart { position: fixed; bottom: 1rem; right: 1rem; z-index: 999; padding: 0.75rem 1.5rem; background: var(--accent); color: white; border-radius: 100px; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.3); font-weight: bold; }
.floating-cart.hidden { display: none; }

/* Uniform product thumbnails — no cropping */
.products .product > img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }

/* (Optional but nice) consistent title row height */
.products .product .product-details { padding: 12px 14px; min-height: 56px; display: flex; align-items: center; }
.products .product .product-details h3 { margin: 0; }

/* Desktop checkout grid */
@media (min-width: 900px) {
  #checkout-form.checkout-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px 28px; align-items: start; overflow: visible; }
  #checkout-form.checkout-grid > .checkout-main, #checkout-form.checkout-grid > #summary { min-width: 0; }
  #checkout-form.checkout-grid > #summary {
    grid-column: 2; position: sticky; top: calc(var(--header-height, 64px) + 14px); align-self: start;
    margin-top: 0; border-top: 0; background: #fff; border: 1px solid var(--gray-border,#e1e4e8);
    border-radius: 10px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.04);
  }
}
@media (max-height:700px) and (min-width:900px) { #checkout-form.checkout-grid > #summary { position: static; } }
@media (max-width: 899.98px) { #checkout-form.checkout-grid { display: block; } #checkout-form.checkout-grid > #summary { position: static; margin-top: 24px; } }
.checkout-container { overflow: visible; }

/* === Product MODAL thumbnails — captions centered/darker === */
#productModal figure, #productModal .thumb, #productModal .thumbnail, #productModal .gallery-item, #productModal .variant-thumb { display:flex; flex-direction:column; align-items:center; text-align:center; }
#productModal figure > img, #productModal .thumb > img, #productModal .thumbnail > img, #productModal .gallery-item > img, #productModal .variant-thumb > img { display:block; width:100%; height:auto; }
#productModal figure > figcaption,
#productModal .thumb > .label,
#productModal .thumbnail > .label,
#productModal .gallery-item > .label,
#productModal .variant-thumb > .label,
#productModal .thumb > span,
#productModal .thumbnail > span,
#productModal .gallery-item > span,
#productModal .variant-thumb > span { margin-top:.4rem; color:#111; font-weight:600; line-height:1.2; }
#productModal :is(.thumb,.thumbnail,.gallery-item,.variant-thumb) > a.button { background:none; border:0; padding:0; border-radius:0; color:#111; font-weight:700; text-decoration:none; }
#productModal :is(.thumb,.thumbnail,.gallery-item,.variant-thumb) > a.button:hover,
#productModal :is(.thumb,.thumbnail,.gallery-item,.variant-thumb) > a.button:focus-visible { text-decoration: underline; }

/* === New Arrivals (product-list) — darker, centered first line === */
#product-list .product .product-details { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
#product-list .product .product-details > :is(p,h3,a,.title,.name):first-child { color:#111; font-style:normal; margin:0; }

/* =========================================================
   MOBILE‑ONLY ENFORCED OVERRIDES (desktop untouched)
   ========================================================= */
@media (max-width: 768px) {
  /* 1) Hide desktop nav row (wins over inline display:flex on <nav>) */
  header nav:not(.mobile-nav) { display: none !important; }

  /* 2) Make sure hamburger is visible and drawer shows when toggled */
  #hamburger { display: block !important; }
  .mobile-nav:not(.hidden) { display: flex !important; }

  /* 3) Force ALL product grids to 2 columns on phones */
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1rem !important; }

  /* 4) Convert Themes from horizontal scroller to the same 2‑up grid */
  #themes .products { display: grid !important; overflow: visible !important; scroll-snap-type: none !important; -webkit-overflow-scrolling: auto !important; }
  #themes .product { flex: unset !important; min-width: 0 !important; scroll-snap-align: unset !important; }
}

/* ===== Mobile navbar cart (mobile only) ===== */
.mobile-actions { display: none; align-items: center; gap: .5rem; }
.mobile-cart-link {
  display: none;                /* shown only on mobile */
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  color: var(--primary); text-decoration: none;
  position: relative;
}

/* small count bubble (re-used for desktop and mobile) */
.cart-bubble{
  position: absolute; transform: translate(9px,-8px);
  background: var(--accent); color:#fff; border-radius: 999px;
  font-size: 11px; padding: 2px 6px; line-height: 1;
  min-width: 18px; text-align: center;
}

@media (max-width: 768px){
  .mobile-actions { display: flex; margin-left: auto; }
  .mobile-cart-link { display: inline-flex; }
}
