/* =============================================================
   sanvella-child / legacy-overrides.css
   -------------------------------------------------------------
   Loaded after `assets/legacy/theme.css` on shop / product /
   product-category / product-tag pages. Its job is to:
     1) Reconcile lazy-loading (legacy uses `lazysizes`; we don't,
        so images would stay at opacity:0 forever).
     2) Provide a graceful fallback when the collection-hero has
        no background image configured.
     3) Tighten up a few Shopify-only behaviours that don't apply
        to a WooCommerce build (cart icon counter, AJAX price
        money formatting, etc.).
   ============================================================= */

/* ---------- 1. Make product images visible ---------- */
.grid-product__image,
.grid-product__image.lazyload,
.grid-product__image.lazyloaded,
.grid-product__secondary-image,
.image-wrap > img,
.collection-hero__image,
.collection-hero__image.lazyload,
.collection-hero__image.lazyloaded {
  opacity: 1 !important;
  transition: none !important;
}

/* The image-wrap element legacy-side enforces aspect-ratio via padding-bottom.
   Make sure the <img> sizes correctly inside it (legacy css pairs with `lazysizes`
   which sets width/height after load). */
.image-wrap {
  position: relative;
  overflow: hidden;
}
.image-wrap > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 2. Collection-hero fallback (no image) ---------- */
.collection-hero--no-image {
  background: var(--color-surface) !important;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-hero--no-image .collection-hero__image {
  display: none !important;
}

.collection-hero--no-image .collection-hero__content {
  color: #1a1a1a !important;
}

.collection-hero--no-image .section-header__title,
.collection-hero--no-image .section-header__title--medium {
  color: #1a1a1a !important;
  text-shadow: none !important;
}

/* ---------- 3. Sidebar tags (legacy: 16px, line-height ~36px, generous spacing) ---------- */
/* Sidebar lives inside .grid--uniform as a grid__item. Allow it to extend
   naturally — its height roughly matches one product card row in legacy. */
.grid__item--collection-template {
  align-self: flex-start;
  padding-right: 24px;
}

.tags.tags--vertical {
  list-style: none;
  margin: 0 0 32px !important;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
}
.tags.tags--vertical li {
  margin: 0 !important;
  padding: 6px 0 !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}
.tags.tags--vertical li a {
  color: #1a1a1a !important;
  text-decoration: none !important;
  display: inline-block;
  font-weight: 400 !important;
  letter-spacing: 0.005em;
  font-size: 16px !important;
  line-height: 1.5 !important;
  transition: color 0.12s ease, opacity 0.12s ease;
}
.tags.tags--vertical li a:hover,
.tags.tags--vertical li a:focus-visible {
  opacity: 0.6;
  outline: none;
}
.tags.tags--vertical li.tag--active > a {
  color: #1a1a1a !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Slightly larger leading on the active "ALL PRODUCTS" so it visually anchors. */
.tags.tags--vertical li.tag--active {
  padding: 4px 0 12px;
}

/* ---------- 4. Product price / money block (WooCommerce compat) ---------- */
.grid-product__price del,
.grid-product__price ins {
  text-decoration: none;
  background: none;
}
.grid-product__price del .amount,
.grid-product__price del .woocommerce-Price-amount {
  color: #999;
  text-decoration: line-through;
  margin-right: 6px;
}
.grid-product__price ins .amount,
.grid-product__price ins .woocommerce-Price-amount {
  color: #c00;
  font-weight: 500;
}

/* ---------- 5. Hide Shopify-only artefacts that leak in ---------- */
.shopify-product-reviews-badge,
.shopify-section-related,
.shopify-section[data-section-type="cart-template"] {
  display: none !important;
}

/* ---------- 6. Page-content padding (legacy uses generous top space) ---------- */
.page-content {
  padding-top: 32px;
  padding-bottom: 64px;
}

/* ---------- 7. Announcement bar (legacy = pale blue, uppercase, 11px) ---------- */
.top-notice-bar {
  background: #dbeaff !important;
  color: #1a1a1a !important;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  position: relative;
}

.top-notice-bar a {
  color: #1a1a1a !important;
  text-decoration: none;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.top-notice-bar a:hover,
.top-notice-bar a:focus-visible {
  text-decoration: underline;
}

.top-notice-bar .announcement-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #1a1a1a !important;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
}

/* ---------- 8. Site header (white, thin separator) ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

/* Legacy storefront has no separate search icon on desktop (search lives only
   inside the mobile menu drawer). Mirror that so the icon row is exactly
   `[currency] [account] [cart]` on desktop. The button is still rendered for
   keyboard / mobile fallback. */
@media (min-width: 769px) {
  .site-header__icon-link--search {
    display: none !important;
  }
}

/* The current uploaded logo file is a white-on-transparent PNG that vanishes
   on the white site-header background. Invert it so it becomes black until a
   proper full-color SANVELLA logo asset is uploaded. */
.site-header__logo a img,
.site-header__logo-link img {
  filter: brightness(0) saturate(100%);
}

/* ---------- 8b. Site nav chevron (▾) on items that have a dropdown ---------- */
.site-nav__chevron {
  display: inline-block;
  width: 9px;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
.site-nav__item--has-chevron > a {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.site-nav .site-nav__item--has-chevron a svg.site-nav__chevron {
  transition: transform 0.15s ease;
}
.site-nav .site-nav__item--has-chevron:hover > a svg.site-nav__chevron {
  transform: rotate(180deg);
}

/* ---------- 8c. Collection hero ---------- */
.collection-hero {
  position: relative;
  height: auto;
  min-height: clamp(320px, 42vw, 480px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--color-surface);
}
.collection-hero__image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
/* Soft gradient at bottom keeps the title legible over product photography. */
.collection-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.35) 100%);
  z-index: 1;
  pointer-events: none;
}
.collection-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 36px 0;
}
.collection-hero .section-header {
  text-align: left;
  margin: 0;
}
.collection-hero .section-header__title,
.collection-hero .section-header__title--medium {
  color: #fff !important;
  font-family: var(--font-display);
  text-shadow: none;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.1;
  letter-spacing: 0;
}

/* ---------- 8d. Floating widgets (Rewards pill + WhatsApp circle) ---------- */
.sanvella-floating-widgets {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 998;
}
.sanvella-floating-widget {
  pointer-events: auto;
  position: fixed;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Rewards: white pill, blue-feather icon, blue text — bottom-left */
.sanvella-floating-widget--rewards {
  bottom: 24px;
  left: 24px;
  background: #fff;
  border: 1px solid #cfe1ff;
  color: #2b6bd1;
  border-radius: 999px;
  padding: 10px 18px 10px 14px;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(43, 107, 209, 0.15);
}
.sanvella-floating-widget--rewards:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(43, 107, 209, 0.25);
}
.sanvella-floating-widget__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8f1ff;
  color: #2b6bd1;
}
.sanvella-floating-widget__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}
.sanvella-floating-widget__label {
  white-space: nowrap;
}

/* WhatsApp: green circle — bottom-right */
.sanvella-floating-widget--whatsapp {
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}
.sanvella-floating-widget--whatsapp:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.5);
}
.sanvella-floating-widget--whatsapp svg {
  width: 30px;
  height: 30px;
  display: block;
}

/* On phones, shrink rewards to icon-only to keep room for thumb-zone */
@media (max-width: 480px) {
  .sanvella-floating-widget--rewards .sanvella-floating-widget__label {
    display: none;
  }
  .sanvella-floating-widget--rewards {
    padding: 12px;
    width: 48px;
    height: 48px;
    justify-content: center;
  }
  .sanvella-floating-widget__icon {
    width: 24px;
    height: 24px;
    background: transparent;
  }
  .sanvella-floating-widget__icon svg {
    width: 18px;
    height: 18px;
  }
}

/* ---------- 9. Tame WooCommerce pagination to feel like Shopify ---------- */
.woocommerce-pagination {
  text-align: center;
  margin-top: 24px;
}
.woocommerce-pagination ul.page-numbers {
  border: 0 !important;
  display: inline-flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.woocommerce-pagination ul.page-numbers li {
  border: 0 !important;
  margin: 0;
}
.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 50%;
  border: 0 !important;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 13px;
  background: transparent;
}
.woocommerce-pagination ul.page-numbers li span.current {
  background: #c19a48;
  color: #fff;
}
.woocommerce-pagination ul.page-numbers li a:hover {
  background: #f0ebdf;
}
