/* ==========================================================================
   AURALIS — Shared stylesheet
   Design tokens, base reset, header, footer, and shared UI components.
   Page-specific rules live in assets/css/page-<slug>.css
   ========================================================================== */

:root {
  /* Brand palette */
  --cream: #f0ede6;
  --black: #1a1a1a;
  --white: #ffffff;
  --gray: #666666;
  --light-gray: #f5f5f5;
  --border: #e5e5e5;
  --border-gray: #e0e0e0;

  /* Accents */
  --taupe: #b8b0a8;
  --taupe-light: #d4ccc4;
  --taupe-dark: #8a7d72;
  --gold: #c9a96e;
  --soft-gray: #e8e6e1;
  --blue-section: #a8c8e8;
  --newsletter-blue: #a8c8ec;

  /* Status */
  --green-online: #4caf50;
  --error: #c0392b;
  --success: #27ae60;

  /* Aliases kept so page CSS lifted from the originals keeps working */
  --charcoal: #1a1a1a;
  --text-gray: #666666;
  --muted: #666666;

  /* Type */
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --maxw: 1400px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .serif {
  font-family: var(--serif);
  font-weight: 400;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

.relative { position: relative; }

/* Accessible skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--black);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
}
.skip-link:focus { left: 8px; top: 8px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.auralis-header {
  width: 100%;
  position: relative;
  z-index: 100;
  background: var(--cream);
}

/* Announcement bar — optional, driven from the admin. It sits inside the header
   so the overlay/fixed treatment on the homepage carries it along. */
.header-announce {
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 9px 16px;
  line-height: 1.35;
}

/* It adds height, so in-page anchor targets need to clear that much more. */
body.has-announce { --announce-h: 38px; }

@media (max-width: 767px) {
  .header-announce { font-size: 11px; padding: 8px 12px; letter-spacing: 0.04em; }
}

.header-top {
  background: var(--cream);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-top-left,
.header-top-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--black);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  transition: opacity 0.2s;
}

.header-link:hover { opacity: 0.6; }

.header-logo-wrap {
  background: var(--cream);
  text-align: center;
  padding: 8px 0 16px;
  position: relative;
}

.header-logo {
  color: var(--black);
  text-decoration: none;
  display: inline-block;
  line-height: 1;
}
.header-wordmark {
  display: block;
  width: auto;
  height: 72px;
  object-fit: contain;
}
.header-wordmark.logo-light {
  display: none;
}

/* The homepage starts over the hero with the white wordmark. */
.page-index.header-overlay .auralis-header:not(.solid) .header-wordmark.logo-dark {
  display: none;
}
.page-index.header-overlay .auralis-header:not(.solid) .header-wordmark.logo-light {
  display: block;
}

.nav-bar {
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 0 32px 16px;
  position: relative;
}

.nav-item {
  font-size: 14px;
  color: var(--black);
  text-decoration: none;
  padding-bottom: 8px;
  border: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
  cursor: pointer;
  /* Deliberately NOT position:relative. The mega panel is absolutely
     positioned and must resolve against .nav-bar (full width), not this
     ~80px chip — otherwise its 5 columns cram into the width of one word. */
  background: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
}

.nav-item:hover,
.nav-item.active {
  border-bottom-color: var(--black);
}

.nav-item.search-icon {
  border-bottom: none;
  padding-bottom: 0;
}

/* Anchor-jump offset.
   Jumping to collections.php#shop-by-category used to land the heading
   underneath whichever bar was sticky at the time. scroll-margin-top keeps
   the target clear of it. --sticky-h is re-declared per page for pages that
   stack a filter bar under the header. */
[id] {
  scroll-margin-top: calc(var(--sticky-base, 0px) + var(--announce-h, 0px) + 24px);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Mega menu */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  display: none;
  /* auto-fit + minmax: columns are only created for the headings that exist,
     and each is guaranteed readable width. Column count is data-driven
     (ceil(headings/2) + 1), so a hardcoded 5 left gaps or squeezed text. */
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 32px 40px;
  padding: 40px 48px 48px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-top: 1px solid var(--border);
  z-index: 100;
  text-align: left;
}

.nav-item:hover .mega-menu,
.nav-item:focus-within .mega-menu { display: grid; }

/* Each column carries a hairline on its left so the groups read as distinct
   lists instead of one undifferentiated block of links. :first-child drops the
   leading rule, and because the grid is auto-fit the divider follows whatever
   column count the data produces. */
.mega-col { padding-left: 28px; border-left: 1px solid var(--border); }
.mega-col:first-child { padding-left: 0; border-left: none; }

.mega-col h4 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--black);
}

/* :not(.mega-image) matters — the featured tile is also an <a> in a .mega-col,
   and the row padding/hover tint below would shift it out of alignment and
   flash a grey box behind the photo. */
.mega-col a:not(.mega-image) {
  display: block;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--gray);
  text-decoration: none;
  /* Padding rather than margin: it gives each link a real hit area, so the
     hover tint reads as a row and the list stops looking crowded. The -10px
     left margin pulls that tint back to the column edge so it lines up with
     the heading above it. */
  padding: 7px 10px;
  margin: 0 0 1px -10px;
  border-radius: 3px;
  transition: color 0.2s, background-color 0.2s;
}

.mega-col a:not(.mega-image):hover,
.mega-col a:not(.mega-image):focus-visible {
  color: var(--black);
  background: var(--light-gray);
}

.mega-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
  overflow: hidden;
}

.mega-image img { width: 100%; height: 100%; object-fit: cover; }

/* Badges */
.cart-badge,
.wish-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--black);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cart-badge.show,
.wish-badge.show { display: flex; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--black);
}

.mobile-nav-overlay { display: none; }

/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 400;
  display: none;
  flex-direction: column;
  padding: 24px 48px;
}

.search-overlay.open { display: flex; }

.search-top {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 12px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 20px;
  font-family: inherit;
  background: transparent;
  color: var(--black);
}

.search-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--black);
  padding: 4px;
  line-height: 1;
}

.search-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  margin-top: 32px;
  overflow-y: auto;
}

.search-section h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
}

.search-tag {
  display: block;
  font-size: 14px;
  color: var(--black);
  text-decoration: none;
  margin-bottom: 12px;
  cursor: pointer;
}

.search-tag:hover { opacity: 0.6; }

.search-empty {
  font-size: 14px;
  color: var(--gray);
  padding: 8px 0;
}

.bestseller-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bestseller-card {
  border: 1px solid var(--border);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.2s;
}

.bestseller-card:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }

.bestseller-img {
  width: 100%;
  aspect-ratio: 1;
  background: #f8f8f8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #bbb;
  overflow: hidden;
}

.bestseller-img img { width: 100%; height: 100%; object-fit: cover; }
.bestseller-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.bestseller-desc { font-size: 12px; color: #888; }

/* ==========================================================================
   CART DRAWER (shared on every page)
   ========================================================================== */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 92%;
  max-width: 420px;
  background: #fff;
  z-index: 501;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.cart-overlay.open .cart-drawer { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.cart-title { font-family: var(--serif); font-size: 24px; }

.cart-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--black);
}

.cart-body { flex: 1; overflow-y: auto; padding: 16px 24px; }

.cart-empty { text-align: center; color: #999; padding: 48px 0; font-size: 14px; }

.cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 78px;
  height: 78px;
  background: var(--light-gray);
  flex: none;
  overflow: hidden;
}

.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.cart-item-desc { font-size: 12px; color: var(--gray); margin-bottom: 10px; }

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-item-price { font-size: 14px; font-weight: 500; white-space: nowrap; }

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-gray);
}

.qty-control button {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--black);
}

.qty-control button:hover { background: var(--light-gray); }
.qty-control span { min-width: 28px; text-align: center; font-size: 13px; }

.cart-remove {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-top: 8px;
  font-family: inherit;
}

.cart-remove:hover { color: var(--error); }

.cart-footer { padding: 20px 24px; border-top: 1px solid var(--border); }

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 14px;
}

.cart-checkout {
  display: block;
  width: 100%;
  background: var(--black);
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.cart-checkout:hover { opacity: 0.85; }

/* ==========================================================================
   TOAST
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: #fff;
  padding: 13px 26px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 600;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   NEWSLETTER
   ========================================================================== */

.newsletter {
  background: var(--blue-section);
  padding: 64px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.newsletter-content { max-width: 620px; }

.newsletter h2 {
  font-family: var(--serif);
  font-size: 34px;
  margin-bottom: 14px;
}

.newsletter p {
  font-size: 14px;
  line-height: 1.6;
  color: #24405c;
  margin-bottom: 22px;
}

.newsletter p a { color: #24405c; }

.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }

.newsletter-input {
  flex: 1;
  min-width: 220px;
  padding: 13px 16px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.newsletter-input:focus { border-color: var(--black); }

.btn-primary {
  background: var(--black);
  color: #fff;
  border: none;
  padding: 13px 30px;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.85; }

.newsletter-note { font-size: 12px; margin-top: 10px; color: #24405c; }
.newsletter-image { width: 150px; flex: none; }
.newsletter-image svg { width: 100%; height: auto; }

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

.footer {
  background: var(--black);
  color: #fff;
  padding: 64px 32px 28px;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
/* The contact column is optional, so the track count follows the content rather
   than being hard-coded to four — a shop that has not filled in an address keeps
   the three-column footer exactly as it was. */
.footer-inner:has(.footer-contact) { grid-template-columns: repeat(4, 1fr); }
@supports not (selector(:has(*))) {
  .footer-inner { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

/* Address block: same look as the link lists around it, but it is not a link. */
.footer-contact address {
  font-style: normal;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}
.footer-hours {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.footer-col h4 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  color: #fff;
  letter-spacing: 0.4px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--maxw);
  margin: 44px auto 0;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-locale {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  flex-wrap: wrap;
}

.footer-locale a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.footer-locale a.active { color: #fff; font-weight: 500; }

.footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  max-width: 320px;
  line-height: 1.5;
}

.footer-logo {
  color: #fff;
  text-decoration: none;
  line-height: 1;
}
.footer-logo img {
  display: block;
  width: auto;
  height: 46px;
  object-fit: contain;
}

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

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.social-links svg { width: 16px; height: 16px; fill: #fff; }

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

@media (max-width: 1024px) {
  .header-top { padding: 12px 24px; }
  .header-wordmark { height: 56px; }
  .nav-bar { gap: 24px; padding: 0 24px 14px; }
  .nav-item { font-size: 13px; }
  .mega-menu { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px 28px; padding: 28px 32px 34px; }
  .mega-col { padding-left: 20px; }
  .search-overlay { padding: 20px 32px; }
  .search-body { grid-template-columns: 220px 1fr; gap: 32px; }
  .bestseller-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { gap: 32px; }
}

/* ==========================================================================
   RESPONSIVE — MOBILE
   ========================================================================== */

@media (max-width: 767px) {
  .header-top { padding: 10px 16px; position: relative; }
  .header-top-left .header-link span { display: none; }
  .header-top-right .hide-mobile { display: none; }

  .header-logo-wrap { padding: 6px 0 10px; }
  .header-wordmark { height: 40px; }

  .nav-bar { padding: 0 16px 12px; justify-content: space-between; }
  .nav-item { display: none; }
  .nav-item.search-icon { display: flex; border-bottom: none; }

  .mobile-menu-btn { display: flex; align-items: center; }

  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .mobile-nav-overlay.open { opacity: 1; visibility: visible; }

  .mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 360px;
    background: #fff;
    z-index: 301;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-overlay.open .mobile-nav-drawer { transform: translateX(0); }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
  }

  .mobile-nav-header span { font-family: var(--serif); font-size: 24px; font-weight: 500; }

  .mobile-nav-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--black);
    line-height: 1;
    padding: 0 4px;
  }

  .mobile-nav-list { list-style: none; padding: 0; }
  .mobile-nav-item { border-bottom: 1px solid var(--border); }

  .mobile-nav-item > a {
    display: block;
    padding: 16px;
    font-size: 15px;
    color: var(--black);
    text-decoration: none;
  }

  .mobile-nav-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: none;
    border: none;
    font-size: 15px;
    color: var(--black);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
  }

  .mobile-nav-toggle .chevron { transition: transform 0.25s; font-size: 12px; }
  .mobile-nav-item.open .chevron { transform: rotate(180deg); }

  .mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafafa;
  }

  .mobile-nav-item.open .mobile-submenu { max-height: 1200px; }

  .mobile-submenu a {
    display: block;
    padding: 12px 16px 12px 32px;
    font-size: 14px;
    color: var(--gray);
    text-decoration: none;
    border-top: 1px solid var(--border);
  }

  .mobile-submenu a:hover { color: var(--black); }

  .mobile-submenu h4 {
    font-family: var(--sans);
    padding: 12px 16px 6px 32px;
    font-size: 12px;
    font-weight: 600;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-nav-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-nav-footer a {
    font-size: 14px;
    color: var(--black);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .search-overlay { padding: 16px; }
  .search-input { font-size: 18px; }
  .search-body { grid-template-columns: 1fr; gap: 24px; margin-top: 20px; }
  .bestseller-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bestseller-card { padding: 10px; }

  .newsletter { padding: 48px 24px; gap: 28px; }
  .newsletter-image { display: none; }
  .newsletter h2 { font-size: 28px; }
  .footer { padding: 48px 24px 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 24px; }
  .footer-locale { justify-content: center; }
  .footer-logo img { height: 40px; }
}

/* ==========================================================================
   RESPONSIVE — SMALL PHONE
   ========================================================================== */

@media (max-width: 479px) {
  .header-wordmark { height: 32px; }
  .header-top { padding: 8px 12px; }
  .header-top-right { gap: 12px; }
  .bestseller-grid { grid-template-columns: 1fr 1fr; }
  .search-body { padding-bottom: 40px; }
  .newsletter h2 { font-size: 24px; }
  .footer-logo img { height: 32px; }
  .social-links { gap: 12px; }
}

/* ==========================================================================
   FLASH MESSAGES
   Server-rendered by includes/header.php after a POST + redirect. auralis.js
   retires them after a few seconds; with JS off they simply stay put.
   ========================================================================== */

.flash-stack {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 460px;
  transition: opacity 0.5s;
}

.flash-stack.fade { opacity: 0; }

.flash {
  padding: 13px 18px;
  font-size: 14px;
  background: var(--black);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.flash-error { background: var(--error); }

/* ==========================================================================
   PRODUCT CARD ADDITIONS (see includes/cards.php)
   ========================================================================== */

.product-was {
  color: var(--gray);
  font-size: 0.85em;
  margin-left: 6px;
  font-weight: 400;
}

/* Sold-out buttons stay in the layout so the grid does not reflow. */
.is-disabled,
button[disabled].product-add,
button[disabled].card-add {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.cart-item-name a { color: inherit; text-decoration: none; }
.cart-item-name a:hover { text-decoration: underline; }

/* The search overlay input sits in a form so Enter runs a real server search. */
.search-form { flex: 1; display: flex; }

/* ==========================================================================
   CARD HOVER SWAP  (second product photo)
   ========================================================================== */

/* When a product has a second image, the card layers it over the hero and
   fades it in on hover — another view of the same piece, with no layout shift
   and no JS. .has-hover is only emitted for products that genuinely have one,
   so every other card renders exactly the markup it did before.

   Every skin already styles its images with a one-class-one-type selector
   (.product-card img, .product-image-wrap img, .aur-product img) in a sheet
   that loads AFTER this one, so a bare .card-hover-img would lose both the
   specificity tie and the cascade. Qualifying with the wrapper's .has-hover
   gives two classes, which outranks all three of them regardless of order.

   width/height are pinned to auto because those same rules set 100%, which
   would resolve against the padding box and push this copy outside the hero;
   the inset is what sizes it instead. object-fit is deliberately left alone so
   it stays contain on category grids and cover on the rails. */
.has-hover .card-hover-img {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.5s ease;
  pointer-events: none;
}

/* Triggered from the card, not the image box, so hovering the name or price
   swaps the photo too. focus-within covers keyboard users tabbing the card's
   link. */
.product-card:hover .card-hover-img,
.product-card:focus-within .card-hover-img,
.aur-product:hover .card-hover-img,
.aur-product:focus-within .card-hover-img {
  opacity: 1;
}

/* .product-image-wrap and .aur-product-img-wrap are already positioned; the
   homepage rail's .img-wrap is not, and without this the overlay would escape
   to the nearest positioned ancestor. Scoped to .has-hover so cards without a
   second photo keep their existing box untouched. */
.img-wrap.has-hover { position: relative; }

/* .product-image-wrap insets its photo by 24px of padding; an absolutely
   positioned copy has to match that or it sits proud of the hero. */
.product-image-wrap.has-hover .card-hover-img { inset: 24px; }

@media (max-width: 479px) {
  .product-image-wrap.has-hover .card-hover-img { inset: 16px; }
}

/* Touch devices have no hover to speak of, and :hover there is a sticky
   post-tap state that would strand the card on the second photo. */
@media (hover: none) {
  .has-hover .card-hover-img { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .has-hover .card-hover-img { transition: none; }
}

/* ==========================================================================
   WHATSAPP BUTTON
   Bottom-right, below the toast (z 600) and the flash stack (z 700) so neither
   is ever covered by it. WhatsApp's own green is used deliberately: this is one
   of the few places where matching an outside brand is the point, because the
   colour is what makes the button recognisable at a glance.
   ========================================================================== */

.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  /* Sits above the iOS home indicator on phones that have one. */
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.wa-float svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}
.wa-float:hover,
.wa-float:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
.wa-float:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
}

/* The cart drawer, search and mobile nav all slide in over the page; a floating
   button left on top of them looks like part of the panel and steals taps.
   These match the overlays' own .open state — the general sibling combinator,
   because .wa-float follows all three in the markup. auralis.js sets .open on
   the overlay and nothing on <body>, so there is no body class to hook. */
.cart-overlay.open ~ .wa-float,
.search-overlay.open ~ .wa-float,
.mobile-nav-overlay.open ~ .wa-float {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  .wa-float { right: 14px; bottom: 14px; width: 50px; height: 50px; }
  .wa-float svg { width: 27px; height: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float { transition: none; }
  .wa-float:hover, .wa-float:focus-visible { transform: none; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  .auralis-header, .footer, .newsletter,
  .cart-overlay, .search-overlay, .mobile-nav-overlay, .toast,
  .flash-stack, .wa-float { display: none !important; }
}
