/* ============================================================
   bijoux-polish.css — Couche finale de polish — iter 50
   Chargé EN DERNIER. Animations, transitions, micro-interactions.
   ============================================================ */

/* ----------------------------------------------------------
   0. CUSTOM PROPERTIES — valeurs centralisées
   ---------------------------------------------------------- */
:root {
  --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.28), 0 1px 4px rgba(0, 0, 0, 0.18);
  --radius-card: 8px;
  --gap-section: 24px;
  --container-pad-sm: 24px;
  --container-pad-lg: 48px;
}

/* ----------------------------------------------------------
   1. TRANSITIONS GLOBALES (composants ciblés)
   ---------------------------------------------------------- */
a,
button,
.btn,
.card,
.product-miniature,
input,
select,
textarea {
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    opacity var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base),
    outline-color var(--transition-base);
}

/* ----------------------------------------------------------
   2. HOVER MICRO-INTERACTIONS
   ---------------------------------------------------------- */

/* Cards — inertia cubic-bezier + border-radius + shadow cohérent */
.card,
.product-miniature {
  border-radius: var(--radius-card);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.card:hover,
.product-miniature:hover {
  box-shadow: var(--shadow-md);
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 181, 112, 0.18);
}

.product-miniature:hover {
  transform: translateY(-3px);
}

/* Ripple — boutons primary */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.28) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.btn-primary:active::after {
  opacity: 1;
  transition: opacity 0s;
}

/* Nav links — underline gauche → droite */
.nav a,
#header nav a,
.top-menu a {
  position: relative;
  text-decoration: none;
}

.nav a::after,
#header nav a::after,
.top-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold, #D4B570);
  transition: width var(--transition-base);
}

.nav a:hover::after,
#header nav a:hover::after,
.top-menu a:hover::after {
  width: 100%;
}

/* ----------------------------------------------------------
   2b. HOVER GOLD — tous les liens body
   ---------------------------------------------------------- */
body a:not(.btn):not([class*="nav"]):not([class*="menu"]) {
  color: inherit;
  text-decoration-color: transparent;
  transition:
    color var(--transition-base),
    text-decoration-color var(--transition-base);
}

body a:not(.btn):not([class*="nav"]):not([class*="menu"]):hover {
  color: var(--gold, #D4B570);
  text-decoration-color: var(--gold, #D4B570);
}

/* ----------------------------------------------------------
   3. FOCUS VISIBLE ENRICHI
   ---------------------------------------------------------- */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold, #D4B570);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-color var(--transition-base), outline-offset var(--transition-base);
}

/* Checkbox / radio focus visible */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--gold, #D4B570);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 181, 112, 0.2);
}

/* ----------------------------------------------------------
   4. SCROLLBAR CUSTOM — dark + gold WebKit + Firefox
   ---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--night, #0E0B1E);
}

::-webkit-scrollbar-thumb {
  background: var(--gold, #D4B570);
  border-radius: 4px;
  border: 2px solid var(--night, #0E0B1E);
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--gold, #D4B570) 85%, white);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold, #D4B570) var(--night, #0E0B1E);
}

/* ----------------------------------------------------------
   5. SELECTION — gold accent
   ---------------------------------------------------------- */
::selection {
  background: var(--gold, #D4B570);
  color: var(--night, #0E0B1E);
}

::-moz-selection {
  background: var(--gold, #D4B570);
  color: var(--night, #0E0B1E);
}

/* ----------------------------------------------------------
   6. SKELETON LOADERS
   ---------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #14102A 25%,
    #1A1530 50%,
    #14102A 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 4px;
  color: transparent !important;
}

/* ----------------------------------------------------------
   7. PAGE TRANSITIONS (fade-in à l'entrée)
   ---------------------------------------------------------- */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter,
#wrapper {
  animation: pageEnter 0.3s ease forwards;
}

/* ----------------------------------------------------------
   8. IMAGE LOADING — éviter alt-broken render
   ---------------------------------------------------------- */
img:not([src]):not([srcset]) {
  background: #14102A;
  min-height: 40px;
}

/* ----------------------------------------------------------
   9. LAZY FADE-IN
   ---------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

img[loading="lazy"] {
  opacity: 0;
  animation: fadeIn 0.35s ease forwards;
  animation-play-state: paused;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-lazy]) {
  animation-play-state: running;
}

@supports (animation-timeline: scroll()) {
  img[loading="lazy"] {
    animation-play-state: running;
  }
}

/* ----------------------------------------------------------
   10. LOADING STATES
   ---------------------------------------------------------- */
@keyframes spinGold {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 2px solid transparent;
  border-top-color: var(--gold, #D4B570);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spinGold 0.7s linear infinite;
}

/* ----------------------------------------------------------
   11. FOOTER POLISH
   ---------------------------------------------------------- */
.bhr-footer__links a {
  position: relative;
  text-decoration: none;
  transition: color var(--transition-base);
}

.bhr-footer__links a:hover {
  color: var(--gold, #D4B570);
}

.bhr-footer__links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold, #D4B570);
  transition: width var(--transition-base);
}

.bhr-footer__links a:hover::after {
  width: 100%;
}

.bhr-footer__nl-input {
  border-radius: 4px 0 0 4px !important;
}

.bhr-footer__nl-btn {
  border-radius: 0 4px 4px 0;
  padding: 10px 16px;
  font-size: .85rem;
  letter-spacing: .03em;
  cursor: pointer;
}

.bhr-footer__nl-btn:hover {
  background: var(--gold, #D4B570);
  color: var(--night, #0E0B1E);
}

.block-social a,
.bhr-footer__social a {
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.block-social a:hover,
.bhr-footer__social a:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

@media (max-width: 767px) {
  .bhr-footer__accordion {
    border-bottom: 1px solid rgba(212, 181, 112, 0.15);
  }

  .bhr-footer__accordion > .bhr-footer__links {
    display: none;
  }

  .bhr-footer__accordion[open] > .bhr-footer__links {
    display: block;
  }

  .bhr-footer__col-title {
    padding: .75rem 0;
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .bhr-footer__col-title::marker,
  .bhr-footer__col-title::-webkit-details-marker {
    display: none;
  }

  .bhr-footer__col-title::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--gold, #D4B570);
    flex-shrink: 0;
  }

  .bhr-footer__accordion[open] > .bhr-footer__col-title::after {
    content: '−';
  }
}

.bhr-footer__legal a {
  text-decoration: none;
  transition: color var(--transition-base);
}

.bhr-footer__legal a:hover {
  color: var(--gold, #D4B570);
  text-decoration: underline;
}

/* ----------------------------------------------------------
   12. REDUCE MOTION
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------
   13. PRINT
   ---------------------------------------------------------- */
@media print {
  .bhr-mobile-burger,
  .bhr-newsletter-sticky,
  .modal-backdrop,
  .modal,
  #header .cart-preview,
  #header .search-widget {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  a {
    color: black !important;
    text-decoration: underline;
  }

  .product-miniature,
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc;
  }
}

/* ----------------------------------------------------------
   14. LIENS — text-underline-offset global 4px
   ---------------------------------------------------------- */
a {
  text-underline-offset: 4px;
}

/* ----------------------------------------------------------
   15. CARROUSELS HORIZONTAUX — scroll-snap
   ---------------------------------------------------------- */
.products-carousel,
.carousel-inner,
[data-slick],
.owl-carousel .owl-stage,
.js-product-list {
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.products-carousel > *,
.carousel-item,
[data-slick] > *,
.owl-carousel .owl-stage > * {
  scroll-snap-align: start;
}

/* ----------------------------------------------------------
   16. IMAGES — aspect-ratio fallback
   ---------------------------------------------------------- */
.product-miniature img,
.card img,
.product-cover img,
.product_image img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
}

@supports not (aspect-ratio: 1 / 1) {
  .product-miniature .product-thumbnail,
  .card .product-thumbnail {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
  }

  .product-miniature .product-thumbnail img,
  .card .product-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* ----------------------------------------------------------
   17. CONTAINER PADDING COHÉRENT
   ---------------------------------------------------------- */
.container,
.container-fluid,
#wrapper .container {
  padding-left: var(--container-pad-sm);
  padding-right: var(--container-pad-sm);
}

@media (min-width: 992px) {
  .container,
  .container-fluid,
  #wrapper .container {
    padding-left: var(--container-pad-lg);
    padding-right: var(--container-pad-lg);
  }
}

/* ----------------------------------------------------------
   18. GAP SECTIONS — 24px standard
   ---------------------------------------------------------- */
.page-content,
.products-section,
.category-products,
.featured-products,
.product-accessories,
.crossselling-product {
  gap: var(--gap-section);
}

/* ----------------------------------------------------------
   19. prefers-color-scheme: light — fallback graceful
   ---------------------------------------------------------- */
@media (prefers-color-scheme: light) {
  :root {
    --night: #FAF6F0;
    --night-alt: #F0EAE0;
    --text-base: #1A1020;
    --text-muted: #5A4A6A;
  }

  body {
    background-color: var(--night, #FAF6F0);
    color: var(--text-base, #1A1020);
  }

  ::-webkit-scrollbar-track {
    background: #E8DFD0;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--gold, #C9A84C);
    border-color: #E8DFD0;
  }

  * {
    scrollbar-color: var(--gold, #C9A84C) #E8DFD0;
  }
}

/* ----------------------------------------------------------
   20. prefers-contrast: more — renforcement
   ---------------------------------------------------------- */
@media (prefers-contrast: more) {
  :focus-visible {
    outline-width: 3px;
    outline-color: #000;
    outline-offset: 3px;
  }

  .btn-primary,
  .btn {
    border: 2px solid currentColor !important;
  }

  a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
  }

  .product-miniature,
  .card {
    outline: 1px solid rgba(0,0,0,0.4);
  }

  @media (prefers-color-scheme: light) {
    body {
      background-color: #FFFFFF !important;
      color: #000000 !important;
    }
  }
}

/* ----------------------------------------------------------
   21. CURSOR VARIANTS — pointer / help / grab
   ---------------------------------------------------------- */
a,
button,
.btn,
label[for],
.product-miniature .product-thumbnail,
.slick-slide,
[role="button"] {
  cursor: pointer;
}

abbr[title],
[data-tooltip],
.js-tooltip,
.help-icon {
  cursor: help;
}

.slick-track,
.carousel-inner,
.product-images-large,
.js-draggable {
  cursor: grab;
}

.slick-track:active,
.carousel-inner:active,
.product-images-large:active,
.js-draggable:active {
  cursor: grabbing;
}

/* ----------------------------------------------------------
   22. LOADER INLINE — mini spinner
   ---------------------------------------------------------- */
@keyframes bx-spin {
  to { transform: rotate(360deg); }
}

.bx-spinner,
.btn.loading::after,
[data-loading]::after {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: bx-spin 0.65s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
  content: "";
}

.btn.loading {
  pointer-events: none;
  opacity: 0.75;
  position: relative;
}

/* ----------------------------------------------------------
   23. TOOLTIP — hover delay 400ms
   ---------------------------------------------------------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  transition-delay: 0s;
  white-space: nowrap;
  z-index: 9999;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  background: rgba(20, 10, 30, 0.92);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 4px 9px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-tooltip]::after {
  content: "";
  bottom: calc(100% + 0px);
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: rgba(20, 10, 30, 0.92);
  transform: translateX(-50%) translateY(2px);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 400ms;
}

/* ----------------------------------------------------------
   24. IMAGE ZOOM ON HOVER — wrapper
   ---------------------------------------------------------- */
.bx-zoom-wrap,
.product-thumbnail,
.product-cover,
.product-miniature .thumbnail-container {
  overflow: hidden;
  border-radius: var(--radius-card, 8px);
}

.bx-zoom-wrap img,
.product-thumbnail img,
.product-cover img,
.product-miniature .thumbnail-container img {
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.45s ease;
  will-change: transform;
  display: block;
  width: 100%;
}

.bx-zoom-wrap:hover img,
.product-thumbnail:hover img,
.product-cover:hover img,
.product-miniature:hover .thumbnail-container img {
  transform: scale(1.06);
  filter: brightness(1.04);
}

/* ----------------------------------------------------------
   25. SUBTLE PARALLAX SCROLL BG
   ---------------------------------------------------------- */
.bx-parallax,
#index .carousel,
.page-home .banner {
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  will-change: background-position;
}

@media (prefers-reduced-motion: reduce) {
  .bx-parallax,
  #index .carousel,
  .page-home .banner {
    background-attachment: scroll;
  }
}

/* ----------------------------------------------------------
   26. BACKDROP BLUR FALLBACK GRACEFUL
   ---------------------------------------------------------- */
.bx-glass,
.modal-content,
.navbar-sticky,
.offcanvas,
.dropdown-menu {
  background: rgba(18, 8, 28, 0.82);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

@supports not (backdrop-filter: blur(1px)) {
  .bx-glass,
  .modal-content,
  .navbar-sticky,
  .offcanvas,
  .dropdown-menu {
    background: rgba(18, 8, 28, 0.96);
  }
}

/* ----------------------------------------------------------
   27. SELECTION MULTI-LINE PRESERVE
   ---------------------------------------------------------- */
::selection {
  background-color: rgba(201, 168, 76, 0.38);
  color: inherit;
  -webkit-text-fill-color: inherit;
}

::-moz-selection {
  background-color: rgba(201, 168, 76, 0.38);
  color: inherit;
}

p::selection,
span::selection,
h1::selection, h2::selection, h3::selection,
h4::selection, h5::selection, h6::selection,
li::selection,
td::selection {
  background-color: rgba(201, 168, 76, 0.38);
  color: inherit;
}

/* ----------------------------------------------------------
   28. MARQUEE ANIMATION PAUSE ON HOVER
   ---------------------------------------------------------- */
@keyframes bx-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.bx-marquee-track,
.marquee-track,
[data-marquee] {
  display: flex;
  overflow: hidden;
  width: 100%;
  white-space: nowrap;
}

.bx-marquee-inner,
.marquee-inner,
[data-marquee] > * {
  display: flex;
  animation: bx-marquee 28s linear infinite;
  will-change: transform;
}

.bx-marquee-track:hover .bx-marquee-inner,
.marquee-track:hover .marquee-inner,
[data-marquee]:hover > * {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .bx-marquee-inner,
  .marquee-inner,
  [data-marquee] > * {
    animation: none;
  }
}

/* ============================================================
   HOTFIX 2026-05-03 — Restore img visibility + cookie banner UX
   ============================================================ */

/* Force loaded lazy images visible (animation override safety net) */
img[loading="lazy"].loaded,
img[loading="lazy"][src],
img.js-qv-product-cover,
.product-cover img,
.bhr-card img,
.product-miniature img {
  opacity: 1 !important;
  animation: none !important;
}

/* Cookie banner — center bottom, with backdrop, dismissable feel */
#cookie-policy-banner,
.cookie-banner,
[id*="gdpr"][id*="banner"],
[class*="cookie"][class*="banner"] {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  bottom: 16px !important;
  max-width: min(720px, calc(100vw - 32px)) !important;
  width: auto !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.55) !important;
  border-radius: 12px !important;
}

@media (max-width: 768px) {
  #cookie-policy-banner,
  .cookie-banner {
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    transform: none !important;
    max-width: none !important;
  }
}
