/* ============================================================
   Cooke's Corner Leather — site + admin styles
   ============================================================ */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #e2e8f0;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 40px rgba(15, 23, 42, 0.16);
  --radius: 12px;
  --maxw: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
/* Sticky footer: on short pages, main grows so the footer sits at the
   viewport bottom instead of floating mid-screen. Scoped to the public
   layout so the admin login (also on style.css) is unaffected. */
body.site-body { display: flex; flex-direction: column; min-height: 100vh; }
body.site-body > main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
code { background: rgba(37,99,235,.1); padding: .1em .4em; border-radius: 5px; font-size: .9em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; cursor: pointer; border: 1px solid transparent;
  padding: .7rem 1.4rem; border-radius: 8px; font-size: .95rem; font-weight: 600;
  font-family: inherit; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-outline-light { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--text); }
.btn-danger { background: #fff; border-color: #d9534f; color: #d9534f; }
.btn-danger:hover { background: #d9534f; color: #fff; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,248,250,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: flex-end; height: 68px; }

/* Logo floats top-left, layered above the nav bar and hero */
.logo-float { position: fixed; top: 0; left: max(1.25rem, calc(50% - var(--maxw) / 2 + 1.25rem)); z-index: 60; display: block; line-height: 0; }
.logo-float img { width: 168px; height: auto; display: block; border-radius: 0 0 14px 14px; filter: drop-shadow(0 8px 12px rgba(15, 23, 42, 0.32)); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.brand-mark { width: 44px; height: 44px; flex: none; background-image: url('/public/images/logo.png'); background-repeat: no-repeat; background-size: 164px auto; background-position: -60px -6px; }
.brand-name { font-size: 1.2rem; font-weight: 700; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.site-nav a:hover, .site-nav a.active { color: var(--accent); }

/* Hamburger toggle — hidden on desktop, shown in the mobile media query */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 10px; background: none; border: none; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  min-height: 78vh; display: flex; align-items: center;
  background-size: cover; background-position: center; color: #fff;
}
.hero-inner {
  max-width: 720px; margin-left: auto; margin-right: auto; text-align: center;
  padding-top: 5rem; padding-bottom: 5rem;
}
.hero-eyebrow {
  display: inline-block; margin-bottom: 1rem; font-size: .85rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: #ffd9a0;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); color: #fff; line-height: 1.1;
  text-shadow: 0 2px 18px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.55);
}
.hero p {
  font-size: 1.1rem; color: rgba(255,255,255,.9); margin-top: 1rem;
  text-shadow: 0 1px 10px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.5);
}
.hero-lead { font-size: 1.25rem !important; color: #fff !important; font-weight: 500; }
.hero-materials { font-size: 1rem !important; color: rgba(255,255,255,.82) !important; }
.hero-highlight {
  font-size: 1.35rem !important; font-weight: 600; color: #fff !important;
  margin-top: 1.5rem !important; max-width: 620px; margin-left: auto; margin-right: auto;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.25rem; justify-content: center; }

.about { padding: 5rem 0; background: var(--surface); }
.about-inner { max-width: 880px; margin: 0 auto; }
.about h2 { text-align: center; font-size: 2.2rem; }
.about-lead { text-align: center; margin: 0 auto 3rem; }
.about-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 3rem; }
.feature { text-align: center; padding: 1.75rem 1.25rem; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.feature h3 { font-size: 1.15rem; }
.about-body { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.about-body img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- Page head ---- */
.page-head { padding: 3.5rem 0 1.5rem; text-align: center; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-head .lead { margin: 0 auto; }

/* ---- Catalog ---- */
.catalog { padding-top: 1.5rem; padding-bottom: 4rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1.5rem 0 2.5rem; }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem;
}
.filter-btn.active, .filter-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.product-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; color: inherit; text-decoration: none; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); color: inherit; }
.product-card.is-hidden { opacity: .6; }
.product-image .hidden-flag { position: absolute; top: .6rem; right: .6rem; background: rgba(15,23,42,.85); color: #fff; padding: .25rem .6rem; border-radius: 6px; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.product-image .photo-count { position: absolute; bottom: .6rem; right: .6rem; background: rgba(15,23,42,.78); color: #fff; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; }
.product-image { position: relative; aspect-ratio: 1/1; background: #eef2f7; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image .no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.product-image .badge { position: absolute; top: .6rem; left: .6rem; background: rgba(37,99,235,.92); color: #fff; padding: .25rem .6rem; border-radius: 6px; font-size: .78rem; }
.product-image .badge-sale { background: #c0392b; }
.product-image .badge-soldout { background: #555; top: auto; bottom: .6rem; left: .6rem; }
.product-image .badge-mto { background: #d97706; top: auto; bottom: .6rem; left: .6rem; }
.price-was { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-right: .35rem; }
.product-option { margin: .5rem 0; }
.option-chip { display: inline-block; background: rgba(37,99,235,.12); color: var(--accent-dark); padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; margin: 0 .3rem .3rem 0; }
.product-detail-price .badge-sale { background: #c0392b; color: #fff; padding: .1rem .5rem; border-radius: 6px; font-size: .7rem; vertical-align: middle; }
.product-body { padding: 1.25rem; flex: 1; }
.product-body h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.product-desc { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: 1.4rem; font-weight: 700; color: var(--accent); margin-top: .75rem; }
.product-foot { padding: 0 1.25rem 1.25rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }

/* ---- Catalog: sidebar layout ---- */
.catalog-layout { display: grid; grid-template-columns: 230px 1fr; gap: 2.5rem; align-items: start; }
.catalog-main { min-width: 0; }
.catalog-main .product-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.catalog-sidebar { position: sticky; top: 88px; min-width: 0; }
.sidebar-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 .25rem .5rem; margin: 0 0 .5rem; border-bottom: 1px solid var(--border); }
.category-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.category-link {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .55rem .75rem; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.category-link:hover { background: var(--surface); color: var(--accent); }
.category-link.active { background: var(--accent); color: #fff; }
.category-count { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: .05rem .5rem; min-width: 1.6rem; text-align: center; }
.category-link:hover .category-count { color: var(--accent); }
.category-link.active .category-count { background: rgba(255,255,255,.2); color: #fff; border-color: transparent; }

/* ---- Nav mega menu ---- */
.nav-mega {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem; min-width: 460px; display: none; z-index: 40;
}
.nav-item.has-children:hover .nav-mega, .nav-item.has-children:focus-within .nav-mega, .nav-item.open .nav-mega { display: block; }
.nav-mega-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 .5rem .6rem; }
.nav-mega-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; }
.nav-mega-item { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .75rem; border-radius: 8px; color: var(--text); transition: background .15s ease; }
.nav-mega-item:hover { background: var(--bg); }
.nav-mega-name { font-weight: 600; font-size: .95rem; color: var(--text); }
.nav-mega-item:hover .nav-mega-name { color: var(--accent); }
.nav-mega-count { font-size: .75rem; color: var(--muted); margin-top: .1rem; }

/* ---- Product detail page ---- */
.product-detail { padding-top: 1.75rem; padding-bottom: 4rem; }
.back-link { margin-bottom: 1.25rem; }

/* Product prev/next pager (category-scoped) */
.product-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.pager-nav { display: inline-flex; align-items: center; gap: .6rem; }
.pager-link { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 500; font-size: .9rem; white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.pager-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager-link.is-disabled { opacity: .4; pointer-events: none; }
.pager-arrow { font-size: 1.1rem; line-height: 1; }
.pager-back { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .95rem; min-width: 0; }
.pager-back .pager-arrow { color: var(--accent); }
.pager-back-label { font-weight: 600; color: var(--text); }
.pager-back:hover .pager-back-label { color: var(--accent); }
.pager-pos { font-size: .82rem; color: var(--muted); min-width: 3rem; text-align: center; }
@media (max-width: 560px) { .pager-link .pager-text { display: none; } .pager-pos { display: none; } }
.product-detail-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 2.5rem; align-items: start; }
.product-detail-grid .gallery { position: sticky; top: 92px; }
.product-detail-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.product-detail-image img { width: 100%; height: auto; display: block; }
.product-detail-image .no-image { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.badge-inline { display: inline-block; background: rgba(37,99,235,.12); color: var(--accent-dark); padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; margin-bottom: .75rem; }
.product-detail-body { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.9rem 2.1rem; }
.product-detail-body h1 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: .5rem; }
.product-detail-price { font-size: 1.4rem; font-weight: 700; color: var(--accent); margin: .5rem 0 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.product-detail-desc { font-size: .95rem; line-height: 1.65; color: var(--text); margin-bottom: 1.5rem; }
.product-detail-desc p:last-child { margin-bottom: 0; }
.product-detail-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.product-detail-actions .btn { padding: .7rem 1.5rem; font-size: .95rem; }
@media (max-width: 700px) {
  .product-detail { padding-top: 1.25rem; }
  .product-detail-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .product-detail-grid .gallery { position: static; }
  .product-detail-body { padding: 1.5rem 1.25rem; }
}

/* Product gallery (main image + thumbnails + carousel) */
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.gallery-img { width: 100%; height: auto; display: block; aspect-ratio: 1/1; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); border: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: .6rem; } .gallery-nav.next { right: .6rem; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.gallery-thumb { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active { border-color: var(--accent); }

/* ---- Forms ---- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.75rem; }
.field { margin-bottom: 1.1rem; }
.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; min-width: 0; }
.field-row .field:nth-child(2) { flex: 0 0 5.5rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.field input, .field textarea, .form input, .form textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
/* Checkbox field (e.g. request shipping) — inline label, auto-width box */
.field-check .check-label { display: flex; align-items: center; gap: .5rem; font-weight: 600; cursor: pointer; margin-bottom: .25rem; }
.field-check .check-label input { width: auto; margin: 0; }
.field-check small { display: block; }
.req-ship { color: var(--accent); }
.error { color: #d9534f; font-size: .82rem; }
.form-message { margin-top: .9rem; font-weight: 600; }
.form-message.success { color: #2e7d32; }
.form-message.error-text { color: #d9534f; }

.custom-order { padding-top: 1.5rem; padding-bottom: 4rem; }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.co-image { height: 100%; min-height: 480px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.co-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Notices ---- */
.notice { padding: .9rem 1.1rem; border-radius: 8px; margin-bottom: 1.5rem; }
.notice-info { background: #eef4fb; color: #2c5f8a; }
.notice-error { background: #fdecea; color: #b3261e; }

/* ---- Dynamic pages ---- */
.page-content { padding-top: 1rem; padding-bottom: 4rem; max-width: 820px; }
.content-block { margin-bottom: 2.5rem; }
.content-block img { border-radius: var(--radius); margin: 1rem 0; }

/* ---- Footer ---- */
.site-footer { background: #1a1106; color: rgba(255,255,255,.7); padding: 2rem 0; text-align: center; margin-top: 2rem; }
.footer-inner { display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.footer-contact, .footer-social { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.footer-contact a, .footer-social a { color: rgba(255,255,255,.85); }
.footer-contact span { color: rgba(255,255,255,.6); }
.footer-text { margin: .3rem 0; }
.footer-copy { color: rgba(255,255,255,.5); font-size: .85rem; margin: .3rem 0 0; }

/* announcement bar */
.announcement-bar { background: var(--accent-dark); color: #fff; text-align: center; padding: .5rem 0; font-size: .9rem; }
.announcement-bar .container { display: flex; align-items: center; justify-content: center; gap: 1rem; position: relative; }
.announcement-bar a, .announcement-bar span { color: #fff; }
.announcement-bar a { text-decoration: underline; }
.announcement-dismiss { position: absolute; right: 1rem; background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; line-height: 1; }

/* nav dropdown */
.site-nav { align-items: center; }
.nav-item { position: relative; }
.nav-dropdown { position: absolute; top: 100%; left: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 8px; padding: .4rem 0; min-width: 170px; display: none; z-index: 20; }
.nav-item.has-children:hover .nav-dropdown, .nav-item.has-children:focus-within .nav-dropdown, .nav-item.open .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: .45rem 1rem; color: var(--text); font-size: .9rem; }
.nav-dropdown a:hover { background: var(--bg); color: var(--accent); }

/* page block types */
.content-block { margin: 2.5rem 0; }
.block-image-text { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.block-image-text.side-right { direction: rtl; }
.block-image-text.side-right > * { direction: ltr; }
.block-image-text img { border-radius: var(--radius); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery-grid img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.block-cta { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow); }
.faq-item { border-bottom: 1px solid var(--border); padding: .8rem 0; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-answer { padding-top: .5rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.content-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.content-table th, .content-table td { border: 1px solid var(--border); padding: .55rem .8rem; text-align: left; }
.content-table th { background: var(--surface); font-weight: 600; }
.block-products .product-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.25rem; }
.block-products .product-image img { margin: 0; border-radius: 0; }
.video-wrap { aspect-ratio: 16 / 9; }
.video-wrap iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.block-quote blockquote { margin: 0; padding: 1.4rem 1.8rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 1.1rem; font-style: italic; }
.block-quote cite { display: block; margin-top: .7rem; font-style: normal; font-size: .9rem; color: var(--muted); }
.columns-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.columns-grid h3 { margin-bottom: .35rem; }
@media (max-width: 700px) { .block-image-text, .columns-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Admin
   ============================================================ */
.admin-body { background: #f1f5f9; }
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-logo { width: 220px; max-width: 80%; height: auto; display: block; margin: 0 auto 1rem; }
.login-card h1 { font-size: 1.4rem; margin-bottom: 0; }
.login-card .field { text-align: left; }
/* (The old JSON-blob dashboard styles were removed in Phase 10 — the admin SPA
   is styled entirely by public/css/admin.css. Only the login page still uses
   style.css.) */

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .about-features { grid-template-columns: 1fr; }
  .about-body, .co-grid, .grid-2 { grid-template-columns: 1fr; }
  .co-image { min-height: 280px; }
  .brand-name { display: none; }
  .logo-float { top: 0; left: 1.25rem; }
  .logo-float img { width: 112px; }
  /* Keep the header clear of the fixed floating logo (20px + 112px wide) */
  .header-inner { padding-left: 140px; }

  /* Nav collapses behind the hamburger into a dropdown panel */
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: .4rem 0;
    max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-nav a { display: block; padding: .8rem 1.25rem; font-size: 1rem; }
  .nav-item { position: static; }
  /* Category menus expand inline (accordion) instead of floating */
  .nav-item.has-children:hover .nav-mega, .nav-item.has-children:focus-within .nav-mega,
  .nav-item.has-children:hover .nav-dropdown, .nav-item.has-children:focus-within .nav-dropdown { display: none; }
  .nav-item.has-children.open .nav-mega, .nav-item.has-children.open .nav-dropdown { display: block; }
  .nav-mega, .nav-dropdown {
    position: static; transform: none; min-width: 0; box-shadow: none; border: none;
    border-radius: 0; padding: 0 .75rem .75rem; background: var(--surface);
  }

  /* Catalog sidebar collapses to a horizontal, scrollable chip rail */
  .catalog-layout { grid-template-columns: 1fr; gap: 1rem; }
  .catalog-sidebar { position: static; }
  .sidebar-title { display: none; }
  .category-list {
    flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .5rem;
    padding: .25rem 0 .5rem; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; scrollbar-width: none;
  }
  .category-list::-webkit-scrollbar { display: none; }
  /* Edge fades hint that the rail scrolls (classes toggled in app.js) */
  .category-list.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgba(0,0,0,.12)); mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgba(0,0,0,.12)); }
  .category-list.fade-start { -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.12), #000 40px); mask-image: linear-gradient(to right, rgba(0,0,0,.12), #000 40px); }
  .category-list.fade-start.fade-end { -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.12), #000 40px, #000 calc(100% - 40px), rgba(0,0,0,.12)); mask-image: linear-gradient(to right, rgba(0,0,0,.12), #000 40px, #000 calc(100% - 40px), rgba(0,0,0,.12)); }
  .category-link {
    flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 999px; padding: .45rem .85rem; font-size: .9rem;
  }
  .category-link.active { border-color: var(--accent); }
  .catalog-main .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .nav-mega-grid { grid-template-columns: 1fr; }
}

/* Phones: one product per row */
@media (max-width: 600px) {
  .product-grid, .catalog-main .product-grid { grid-template-columns: 1fr; }
}

/* ---------------- Cart + checkout ---------------- */
.product-sku { margin: .25rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Header cart link */
.nav-cart { display: inline-flex; align-items: center; gap: .4rem; }
.nav-cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1;
}

/* Add-to-cart form on product page */
.add-to-cart-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.add-to-cart-form .field { display: flex; flex-direction: column; gap: .25rem; margin: 0; }
.add-to-cart-form .field span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.add-to-cart-form select, .add-to-cart-form input[type="number"] {
  padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit;
}
.add-to-cart-form .atc-qty input { width: 5rem; }
.add-to-cart-form .atc-actions { display: flex; gap: .5rem; align-items: center; }
.add-to-cart-form .form-message { flex-basis: 100%; margin: .25rem 0 0; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Cart page */
.cart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); padding: 0 .5rem .5rem; }
.cart-table td { padding: .75rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-item { display: flex; gap: .75rem; align-items: center; }
.cart-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.cart-opts span { display: inline-block; margin-right: .5rem; }
.cart-qty-input { width: 4rem; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.cart-line-total { font-weight: 600; white-space: nowrap; }
.cart-price { white-space: nowrap; }
.cart-remove { background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 .25rem; }
.cart-remove:hover { color: var(--accent-dark); }
.cart-summary h2 { margin-top: 0; }
.cart-subtotal-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; font-weight: 600; margin: .5rem 0; }
.cart-subtotal { color: var(--accent); }
.cart-summary .btn-block { margin-top: .5rem; }
/* Pickup notice — prominent callout so customers see it before checkout */
.cart-notice {
  margin: 1rem 0; padding: .85rem 1rem;
  background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.25);
  border-right: 6px solid #dc2626;
  border-radius: 8px;
}
.cart-notice p { margin: 0; font-size: .95rem; line-height: 1.45; color: var(--text); }
.cart-notice strong { color: var(--accent-dark); }
.cart-empty { text-align: center; padding: 2.5rem 1rem; }
.cart-empty .btn { margin-top: 1rem; }

/* Checkout page */
.checkout-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.5rem; align-items: start; }
.checkout-summary h2 { margin-top: 0; }
.checkout-lines { list-style: none; padding: 0; margin: 0 0 .75rem; }
.checkout-line { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.checkout-line-total { font-weight: 600; white-space: nowrap; }
.checkout-pickup-note { margin-top: 1rem; }
/* Checkout-only accent on the pickup note under the subtotal */
.checkout-note-accent { border-left: 5px solid var(--accent); padding-left: .85rem; }
/* Light gray rounded box around the "Pickup details" intro copy */
.checkout-form-intro { background: #f1f5f9; border-radius: 8px; padding: .75rem 1rem; }

/* Order confirmation — totals hierarchy (subtotal/tax light, total stands out) */
.checkout-summary .cart-subtotal-row { font-size: 1rem; font-weight: 500; margin: .35rem 0; }
.checkout-summary .checkout-total-row { font-size: 1.15rem; font-weight: 700; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--border); }

/* Order confirmation — buyer's detail readout */
.order-detail-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.order-detail-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.order-detail-list li > span:last-child { text-align: right; }

@media (max-width: 800px) {
  .cart-grid, .checkout-grid { grid-template-columns: 1fr; }
}

/* ---- Dark header nav bar ---- */
.site-header {
  background: #1a1106;
  border-bottom: 1px solid rgba(255,255,255,.09);
  backdrop-filter: blur(10px);
}
.site-nav a { color: rgba(255,255,255,.82); }
.site-nav a:hover, .site-nav a.active { color: #ffd9a0; }
.nav-toggle span { background: #fff; }

/* Floating category / dropdown panels go dark to match */
.nav-mega, .nav-dropdown {
  background: #1d1710;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 22px 44px rgba(0,0,0,.5);
}
.nav-mega-head { color: rgba(255,255,255,.55); }
.nav-mega-item, .nav-mega-name, .nav-dropdown a { color: rgba(255,255,255,.9); }
.nav-mega-count { color: rgba(255,255,255,.5); }
.nav-mega-item:hover, .nav-dropdown a:hover { background: rgba(255,255,255,.06); }
.nav-mega-item:hover .nav-mega-name, .nav-dropdown a:hover { color: #ffd9a0; }

@media (max-width: 860px) {
  /* Mobile: the expanded panel is contiguous with the dark bar */
  .site-nav {
    background: #1a1106;
    border-bottom: 1px solid rgba(255,255,255,.09);
  }
  .nav-mega, .nav-dropdown { background: transparent; border: none; box-shadow: none; }
}
