/* ==========================================================================
   Layout and components. Colors and the font are in theme.css.
   ========================================================================== */

:root {
  /* colors and --font come from theme.css */
  --max: 2000px;
  --gutter: clamp(1rem, 3.5vw, 4rem);
  --space: clamp(3rem, 6vw, 6rem);
  --header-h: 5.5rem;

  --bs-body-font-family: var(--font);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--navy);
  --bs-body-bg: var(--white);
}

/* ---------- Base ---------- */
h1, h2, h3 { font-family: var(--font); font-weight: 500; letter-spacing: -.01em; text-wrap: balance; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
section[id], footer[id] { scroll-margin-top: var(--header-h); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 2000;
  background: var(--navy); padding: .5rem 1rem;
}
.skip-link:focus, .skip-link:hover { top: 1rem; color: var(--white); }

/* Content and imagery stop at 2000px; solid color bands run full width */
.frame { max-width: var(--max); margin-inline: auto; }
.shell { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space); }
.section-flush { padding-top: 0; }
.section-title {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  font-weight: 700;
}

/* Uppercase homepage titles (being tested): delete this rule to go back */
.hero-card h1, .section-title { text-transform: uppercase; letter-spacing: .04em; }
/* Listing grids use Bootstrap gutters, whose negative top margin lies over whatever is above them (Filter button,
   filter tags, "Previous page"). Only the cards take clicks. */
#listGrid { pointer-events: none; }
#listGrid > * { pointer-events: auto; }
.view-all { margin-top: clamp(1.5rem, 3vw, 2.5rem); text-align: center; }
.view-all .btn { --bs-btn-border-color: var(--navy); --bs-btn-padding-x: 2.25rem; }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-border-radius: 3px;
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: .7rem;
  --bs-btn-font-size: .75rem;
  --bs-btn-font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.btn-brand {
  --bs-btn-color: var(--white);
  --bs-btn-bg: var(--navy);
  --bs-btn-border-color: var(--navy);
  --bs-btn-hover-color: var(--white);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: var(--white);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
  --bs-btn-disabled-color: var(--white);
  --bs-btn-disabled-bg: var(--grey);
  --bs-btn-disabled-border-color: var(--grey);
}
.btn-outline-brand {
  --bs-btn-color: var(--navy);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--white);
  --bs-btn-hover-bg: var(--navy);
  --bs-btn-hover-border-color: var(--navy);
  --bs-btn-active-color: var(--white);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
}

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: 50%;
  background: none; color: var(--navy);
  font-size: 1.35rem;
}
.icon-btn:hover { background: var(--soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
}
.brand {
  justify-self: start;
  font-size: 2.1rem; font-weight: 300; line-height: 1;
  letter-spacing: -.04em; white-space: nowrap;
}
.brand strong { font-weight: 800; }
.brand img { max-height: 3rem; width: auto; }

.main-nav { align-self: stretch; gap: clamp(1.5rem, 3vw, 3rem); list-style: none; margin: 0; padding: 0; }
.main-nav > li { display: flex; align-items: stretch; }
/* The link fills the header height (so dropdowns stay open); the underline hugs the text */
.nav-item-link {
  position: relative;
  display: flex; align-items: center;
  font-size: .75rem; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase;
}
.nav-item-link::after {
  content: "";
  position: absolute; left: 0; right: 0; top: calc(50% + .8rem);
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}
.nav-item-link.active::after, .nav-item-link:hover::after, .has-mega.is-open > .nav-item-link::after { transform: scaleX(1); }
.nav-item-link:hover { color: var(--navy); }
.header-actions { display: flex; justify-self: end; gap: .25rem; }
.cart-count {
  position: absolute; top: .15rem; right: .1rem;
  min-width: 1.15rem; height: 1.15rem; padding-inline: .3rem;
  border-radius: 1rem;
  background: var(--navy); color: var(--white);
  font-size: .65rem; font-weight: 600; line-height: 1.15rem;
}

/* Large dropdowns under the header */
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  padding-block: 2.25rem;
  background: var(--white);
  border-block: 1px solid var(--line);
  box-shadow: 0 1.5rem 2rem -1.5rem rgba(22, 32, 44, .18);
  visibility: hidden; opacity: 0;
  transition: opacity .2s, visibility .2s;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
/* Visibility switches at once on open so the links can be tabbed into straight away */
.has-mega.is-open > .mega { visibility: visible; opacity: 1; transition: opacity .2s; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 15rem)); justify-content: center; gap: 2rem 4rem; }
.mega-heading {
  display: block; margin-bottom: .9rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line);
  font-size: .75rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
}
.mega-groups li { margin-bottom: .3rem; font-size: .9375rem; }
.mega .mega-collections {
  display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: .5rem 1.5rem; max-width: 75rem; margin-inline: auto; font-size: .9375rem;
}
.mega-groups li a, .mega-collections a { color: var(--text-muted); }
.mega-groups li a:hover, .mega-collections a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: .3em; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 28rem;
  max-height: 75rem;
  overflow: hidden;
  background: var(--soft);
}
.hero .carousel, .hero .carousel-inner, .hero .carousel-item { height: 100%; }
.hero .carousel-item { transition-duration: 1.2s; }
.hero .carousel-item picture { display: block; height: 100%; }
.hero .carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.hero-card {
  position: absolute; z-index: 2;
  left: var(--gutter); bottom: var(--gutter);
  max-width: min(26rem, calc(100% - 2 * var(--gutter)));
  padding: clamp(1.25rem, 2.5vw, 2rem);
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px); /* keeps the text readable over patterned linens */
}
.hero-card h1 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 700; line-height: 1; margin-bottom: 1.25rem; }
.hero-controls {
  position: absolute; z-index: 2;
  right: var(--gutter); bottom: var(--gutter);
  display: flex;
  background: var(--white);
  border-radius: 3px;
}
.hero-controls button { width: 2.5rem; height: 2.5rem; border: 0; background: none; color: var(--navy); }
.hero-controls button:hover { background: var(--soft); }

/* ---------- Tiles ---------- */
.tile-media { display: block; overflow: hidden; aspect-ratio: 1; background: var(--soft); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.category:hover img, .product:hover .tile-media img { transform: scale(1.04); }
.category { display: block; text-align: center; }
.category .tile-media { aspect-ratio: 5 / 6; }
.category-name { display: block; margin-top: .85rem; font-size: .9375rem; font-weight: 500; }

/* Category banners: five across, an endless Swiper row (5:6 images, as on nuagedesigns.com) */
.scroller { position: relative; }
.category-scroller { list-style: none; margin: 0; padding: 0; }
.category-scroller a:focus-visible { outline-offset: -3px; }
/* before (or without) Swiper the row has the same shape and scrolls sideways */
#categorySwiper:not(.swiper-initialized) { overflow-x: auto; }
#categorySwiper:not(.swiper-initialized) .category-scroller { column-gap: 22px; }
#categorySwiper:not(.swiper-initialized) .swiper-slide { flex: 0 0 calc((100% - 88px) / 5); }
@media (max-width: 991.98px) { #categorySwiper:not(.swiper-initialized) .swiper-slide { flex-basis: calc((100% - 44px) / 3); } }
@media (max-width: 575.98px) { #categorySwiper:not(.swiper-initialized) .swiper-slide { flex-basis: 62%; } }
/* arrows: only while the pointer is over the row (or on keyboard focus); touch screens swipe */
.scroller .scroll-btn { z-index: 2; opacity: 0; transition: opacity .25s; }
@media (hover: hover) { .scroller:hover .scroll-btn { opacity: 1; } }
@media (hover: none) { .scroller .scroll-btn { pointer-events: none; } }
.scroller .scroll-btn:focus-visible { opacity: 1; }
.scroll-btn {
  position: absolute; top: 45%; transform: translateY(-50%);
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--navy); font-size: 1.2rem;
}
.scroll-btn.is-prev { left: -.5rem; }
.scroll-btn.is-next { right: -.5rem; }

.collection { position: relative; display: block; overflow: hidden; aspect-ratio: 5 / 3; background: var(--soft); }
.collection img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.collection:hover img { transform: scale(1.03); }
.tile-label {
  position: absolute; left: 50%; bottom: clamp(.75rem, 2vw, 1.5rem); transform: translateX(-50%);
  padding: .65rem 1.5rem;
  border-radius: 3px;
  background: var(--white); color: var(--navy);
  font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .25s, color .25s;
}
.collection:hover .tile-label { background: var(--navy); color: var(--white); }

/* ---------- Products ---------- */
.product { display: flex; flex-direction: column; height: 100%; text-align: center; }
.product h3 { margin: .9rem 0 .15rem; font-size: .9375rem; }
.product h3 a { color: inherit; }
.product p { margin-bottom: 0; font-size: .8125rem; color: var(--text-muted); }
.product-add { margin-top: auto; }
.product-add.is-added { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--white); padding-block: clamp(3rem, 5vw, 5rem) calc(1.75rem + 50px); }
.site-footer a { color: var(--grey); }
.site-footer a:hover, .site-footer .footer-email { color: var(--white); }
.site-footer a:focus-visible { outline-color: var(--white); }
.footer-caption {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  font-size: clamp(1.75rem, 4vw, 3.25rem); font-weight: 700; line-height: 1.2;
  letter-spacing: -.02em; text-wrap: balance;
}
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.25rem 3rem;
  padding-block: 1.5rem;
  border-block: 1px solid rgba(255, 255, 255, .12);
}
.footer-row ul {
  display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; list-style: none; margin: 0; padding: 0;
  font-size: .75rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
}
.footer-email { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; overflow-wrap: anywhere; }
.footer-legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem;
  padding-top: 1.5rem;
  font-size: .8125rem; color: var(--grey);
}

/* Phones only: everything centred, one link per row, the email below them, "Back to top" at the right */
@media (max-width: 767.98px) {
  .footer-caption { text-align: center; }
  .footer-row { flex-direction: column; justify-content: center; gap: 1.25rem; padding-block: 1.75rem; text-align: center; }
  .footer-row nav { width: 100%; }
  .footer-row ul { flex-direction: column; gap: 0; }
  .footer-row ul a { display: block; padding-block: .6rem; }
  .footer-legal { flex-direction: column; align-items: center; text-align: center; }
  .footer-legal > a { align-self: flex-end; }
}

/* ---------- Panels: menu, search, list ---------- */
.panel {
  --bs-offcanvas-bg: var(--white);
  --bs-offcanvas-color: var(--navy);
  --bs-offcanvas-border-width: 0;
  --bs-offcanvas-padding-x: 1.5rem;
  --bs-offcanvas-padding-y: 1.25rem;
}
.panel .offcanvas-title { font-size: 1.25rem; margin: 0; }
/* Light veil in place of Bootstrap's black backdrop */
.offcanvas-backdrop { background-color: var(--grey); }
.offcanvas-backdrop.show { opacity: .35; }

.menu-list, .menu-list ul { list-style: none; padding: 0; margin: 0; }
.menu-list { margin-bottom: 2rem; border-top: 1px solid var(--line); }
.menu-list > li { border-bottom: 1px solid var(--line); }
.menu-list > li > a, .menu-list > li > button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: .9rem 0; border: 0; background: none; color: var(--navy);
  font-size: 1.0625rem; font-weight: 500; text-align: left;
}
.menu-list button .ti { transition: transform .25s; }
.menu-list button:not(.collapsed) .ti { transform: rotate(180deg); }
.menu-list ul a { display: block; padding: .45rem 1rem; color: var(--text-muted); }
.menu-list ul .menu-heading a { padding-top: .9rem; color: var(--navy); font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }

.search-panel { --bs-offcanvas-height: min(46rem, 92vh); }
.search-panel .offcanvas-header { padding-inline: var(--gutter); }
.search-inner { max-width: 44rem; margin-inline: auto; }
.search-field { display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--navy); }
.search-field .ti { font-size: 1.25rem; }
.search-field input {
  flex: 1; min-width: 0; padding: .75rem 0;
  border: 0; background: transparent; color: var(--navy);
  font: 400 1.25rem var(--font);
}
.search-field input:focus { outline: 0; }
.search-field:focus-within { box-shadow: 0 1px 0 var(--navy); }
.search-results { list-style: none; padding: 0; margin: 1rem 0 0; }
.search-results a { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.search-results a span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.search-results a { align-items: center; }
.search-results img { flex: none; width: 3.5rem; height: 3.5rem; object-fit: cover; background: var(--soft); }
.search-results small { color: var(--text-muted); text-align: right; }
.search-results .no-results { padding: .6rem 0; color: var(--text-muted); }
.search-results .search-all a {
  justify-content: center; margin-top: 1rem; padding: .7rem 1rem;
  border: 1px solid var(--navy); border-radius: 3px;
  font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.search-results .search-all a:hover { background: var(--navy); color: var(--white); }

.cart-empty { margin-block: auto; text-align: center; }
.cart-empty .ti { font-size: 2.25rem; color: var(--grey); }
.cart-empty p { margin: .5rem 0 1.25rem; }
.cart-items { list-style: none; padding: 0; margin: 0; }
.cart-item {
  display: grid; grid-template-columns: 5rem 1fr auto; gap: 1rem; align-items: start;
  padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.cart-item img { width: 5rem; height: 5rem; object-fit: cover; }
.cart-item h3 { margin: 0 0 .35rem; font-size: .9375rem; }
.cart-item small { display: block; margin-bottom: .4rem; font-size: .8125rem; color: var(--text-muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 3px; }
.qty button { width: 2rem; height: 2rem; border: 0; background: none; color: var(--navy); }
.qty span { min-width: 2rem; text-align: center; font-size: .875rem; }
/* Stays in view however long the cart gets */
.cart-foot {
  position: sticky; bottom: calc(-1 * var(--bs-offcanvas-padding-y));
  margin: auto 0 calc(-1 * var(--bs-offcanvas-padding-y));
  padding-block: 1.25rem;
  background: var(--white);
}
.cart-foot p { margin: .75rem 0 0; font-size: .8125rem; color: var(--text-muted); }
.cart-foot p:empty { display: none; }
.cart-foot .btn-outline-brand { --bs-btn-border-color: var(--navy); margin-top: .5rem; }

/* ---------- Smaller screens ---------- */
@media (max-width: 991.98px) {
  :root { --header-h: 4.25rem; }
  .header-bar { padding-inline: .5rem; }
  .menu-btn { justify-self: start; }
  .brand { justify-self: center; font-size: 1.65rem; }
}
@media (max-width: 575.98px) {
  .hero { height: 70svh; }
  .hero-card { right: var(--gutter); max-width: none; text-align: center; }
  .hero-controls { top: .75rem; right: .75rem; bottom: auto; }
  .product-add { --bs-btn-padding-x: .25rem; --bs-btn-font-size: .6875rem; letter-spacing: .08em; }
}
@media (max-width: 379.98px) {
  .brand { font-size: 1.35rem; }
  .header-actions { gap: 0; }
  .header-bar .icon-btn { width: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  :root { scroll-behavior: auto; }
}

/* ---------- Contact page ---------- */
.contact-grid { display: grid; gap: var(--gutter); padding-block: 0 var(--gutter); }

.contact-text {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0;
  padding-block: var(--space) calc(var(--space) - var(--gutter));
  text-align: center;
}
.contact-text .section-title { margin-bottom: .75rem; }
.contact-lead { margin-bottom: clamp(2rem, 4vw, 3rem); color: var(--text-muted); }

/* A long address from config.js wraps instead of widening the page */
.contact-email {
  max-width: 100%; margin: 0;
  font-size: clamp(1.25rem, 6vw, 2rem); font-weight: 500; line-height: 1.3;
  letter-spacing: -.02em; overflow-wrap: anywhere;
}

.contact-note {
  width: 100%; max-width: 24rem;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .875rem; color: var(--text-muted); text-wrap: balance;
}
.contact-cart {
  display: table; margin: .75rem auto 0; padding: .25rem 0;
  border: 0; background: none; color: var(--navy);
  font-weight: 600; text-decoration: underline; text-underline-offset: .3em;
}
.contact-cart:hover { color: var(--accent); }

.contact-photo { position: relative; min-width: 0; aspect-ratio: 5 / 4; background: var(--soft); }
.contact-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 992px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: clamp(34rem, calc(100svh - var(--header-h)), 48rem);
    padding-block: var(--gutter);
  }
  .contact-text { padding-block: 2rem; }
  .contact-photo { aspect-ratio: auto; }
  .contact-email { font-size: clamp(1.75rem, 2.4vw, 2.75rem); }
}

/* ---------- Page not found ---------- */
.not-found { min-height: 55vh; display: flex; align-items: center; }
.not-found-code { margin-bottom: .5rem; font-size: clamp(4rem, 12vw, 8rem); font-weight: 700; line-height: 1; color: var(--grey); }
.not-found .section-title { margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.75rem; }
.not-found-actions .btn-outline-brand { --bs-btn-border-color: var(--navy); }
