/**
 * ==========================================================================
 * HELENERIU.FR — fixes-base.css
 * ==========================================================================
 * Global fixes loaded on ALL pages.
 * Layout, typography, forms, tables, images, modals, accessibility,
 * dark mode, reduced motion, product cards & badges.
 *
 * Mobile-first: base = mobile, @media (min-width: 768px) = tablet,
 * @media (min-width: 1200px) = desktop
 * ==========================================================================
 */

/* ==========================================================================
   1. ROOT & LAYOUT
   ========================================================================== */

html {
  overflow-x: hidden !important;
  scrollbar-gutter: stable !important;
  height: auto !important;
}

body {
  overflow: visible !important;
  max-width: 100vw !important;
  height: auto !important;
  min-height: 100vh !important;
}

.wrapper,
.page-wrapper,
#wrapper,
main {
  overflow-x: hidden;
  max-width: 100%;
}

@media (min-width: 1200px) {
  .container {
    max-width: 1400px !important;
    width: 100% !important;
  }
}

:root {
  --color-accent-orange-light: #8b7355 !important;
  --color-accent-600: #65513d !important;
}


/* ==========================================================================
   2. TYPOGRAPHY
   ========================================================================== */

body, p, li, a, span, label {
  font-size: max(0.875rem, 14px);
}

.faq-question, .faq-answer, .faq-item {
  font-size: max(0.9375rem, 15px);
}

.nav-link, .menu-link {
  font-size: max(1rem, 16px);
}

.btn, button, input[type="submit"] {
  font-size: max(0.9375rem, 15px);
}

@media (max-width: 479px) {
  .small-text, .meta, .caption, small {
    font-size: max(0.8125rem, 13px) !important;
  }
}

h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
  line-height: 1.2 !important;
  margin-bottom: 1rem !important;
}

.page-title,
.category-header h1,
main > h1:first-of-type {
  font-size: clamp(1.5rem, 5vw, 2rem) !important;
  text-align: center !important;
}

@media (max-width: 479px) {
  h1 {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
  }
}

@media (min-width: 768px) {
  body, p, li, a, span, label {
    font-size: inherit;
  }
  h1 {
    font-size: revert !important;
    line-height: revert !important;
    margin-bottom: revert !important;
  }
  .page-title,
  .category-header h1,
  main > h1:first-of-type {
    font-size: revert !important;
    text-align: revert !important;
  }
}

@font-face {
  font-family: "Manrope";
  font-display: swap;
}


/* ==========================================================================
   3. IMAGES RESPONSIVE
   ========================================================================== */

img:not(.product-cover img):not(.js-qv-product-cover) {
  max-width: 100% !important;
  height: auto !important;
}

.product-cover img,
img.js-qv-product-cover {
  max-width: 100%;
}

.product-image img,
.brand-logo img,
.testimonial-image img,
.category-image img,
figure img,
.img-responsive,
.img-fluid {
  max-width: 100%;
  height: auto;
  display: block;
}


/* ==========================================================================
   4. FORMS
   ========================================================================== */

input, textarea, select {
  max-width: 100% !important;
  width: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea, select {
  font-size: 16px !important;
  min-height: 44px;
  padding: 0.625rem;
}

.form-row, .form-group {
  flex-direction: column !important;
}

.form-row > *, .form-group > * {
  width: 100% !important;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="number"],
  textarea, select {
    font-size: inherit !important;
    min-height: auto;
    padding: revert;
  }
  .form-row, .form-group {
    flex-direction: row !important;
  }
  .form-row > *, .form-group > * {
    width: auto !important;
    margin-bottom: 0;
  }
}


/* ==========================================================================
   5. TABLES
   ========================================================================== */

table {
  width: 100%;
  max-width: 100%;
}

.table-responsive, table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.table-stack-mobile thead {
  display: none;
}

table.table-stack-mobile tr {
  display: block;
  margin-bottom: 1rem;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 0.5rem;
}

table.table-stack-mobile td {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

table.table-stack-mobile td::before {
  content: attr(data-label);
  font-weight: 600;
  margin-right: 1rem;
}

@media (min-width: 768px) {
  table {
    display: table;
  }
  table.table-stack-mobile thead {
    display: table-header-group;
  }
  table.table-stack-mobile tr {
    display: table-row;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    padding: 0;
  }
  table.table-stack-mobile td {
    display: table-cell;
    border-bottom: none;
  }
  table.table-stack-mobile td::before {
    content: none;
  }
}


/* ==========================================================================
   6. BREADCRUMB
   ========================================================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  overflow: visible !important;
  max-width: 100% !important;
}

.breadcrumb-item {
  max-width: none !important;
  overflow: visible !important;
}

@media (max-width: 479px) {
  .breadcrumb {
    font-size: max(0.75rem, 12px);
  }
  .breadcrumb-item:not(:last-child):not(:nth-last-child(2)) {
    max-width: 80px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}


/* ==========================================================================
   7. MODALS
   ========================================================================== */

.modal,
.popup,
[class*="modal"],
[class*="popup"] {
  max-width: 95vw !important;
  max-height: 90vh !important;
  overflow-y: auto;
}

@media (max-width: 479px) {
  .modal, .popup {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}


/* ==========================================================================
   8. PRODUCT CARDS (miniatures, badges, flags)
   Shared: home, category, product cross-sell, search results
   ========================================================================== */

/* Grid children fill their cell */
.product-accessories .products .js-product,
.crossselling-products .products .js-product,
.viewed-products .products .js-product,
.featured-products .products .js-product {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  flex: none !important;
}

.product-accessories .product-miniature,
.crossselling-products .product-miniature,
.viewed-products .product-miniature,
.featured-products .product-miniature {
  width: 100% !important;
  overflow: hidden;
}

/* Thumbnail container: vertical card */
.product-accessories .thumbnail-container,
.crossselling-products .thumbnail-container,
.viewed-products .thumbnail-container,
.featured-products .thumbnail-container {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-accessories .thumbnail-container:hover,
.crossselling-products .thumbnail-container:hover,
.viewed-products .thumbnail-container:hover,
.featured-products .thumbnail-container:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Image area: square, centered */
.product-accessories .thumbnail-top,
.crossselling-products .thumbnail-top,
.viewed-products .thumbnail-top,
.featured-products .thumbnail-top {
  width: 100% !important;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #faf8f5;
  overflow: hidden;
}

.product-accessories .product-thumbnail,
.crossselling-products .product-thumbnail,
.viewed-products .product-thumbnail,
.featured-products .product-thumbnail {
  width: 100% !important;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-accessories .product-thumbnail img,
.crossselling-products .product-thumbnail img,
.viewed-products .product-thumbnail img,
.featured-products .product-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  padding: 16px;
}

/* Product info below image */
.product-accessories .product-miniature .product-description,
.crossselling-products .product-miniature .product-description,
.viewed-products .product-miniature .product-description,
.featured-products .product-miniature .product-description {
  padding: 12px 12px 16px;
  text-align: center;
  width: 100% !important;
  flex-direction: column;
  align-items: center;
}

/* Product name: no truncation */
.product-accessories .product-miniature .product-title a,
.crossselling-products .product-miniature .product-title a,
.viewed-products .product-miniature .product-title a,
.featured-products .product-miniature .product-title a {
  display: block;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  font-size: 0.875rem;
  line-height: 1.3;
  color: #2d2418;
}

/* Price */
.product-accessories .product-miniature .product-price-and-shipping,
.crossselling-products .product-miniature .product-price-and-shipping,
.viewed-products .product-miniature .product-price-and-shipping,
.featured-products .product-miniature .product-price-and-shipping {
  font-size: 1rem;
  font-weight: 600;
  color: #8b7355;
  white-space: nowrap;
}

/* Wishlist button: top-right */
.product-accessories .wishlist-button-add,
.crossselling-products .wishlist-button-add,
.viewed-products .wishlist-button-add,
.featured-products .wishlist-button-add {
  position: absolute !important;
  top: 8px;
  right: 8px;
  z-index: 2;
}

/* Product flags in miniatures: top-left */
.product-accessories .product-flags,
.crossselling-products .product-flags,
.viewed-products .product-flags,
.featured-products .product-flags {
  position: absolute !important;
  top: 8px;
  left: 8px;
  z-index: 2;
}

/* --- Badge colors: taupe --- */

.product-flag.on-sale,
.product-flags .on-sale,
.product-flags li.product-flag.on-sale {
  background: #8b7355 !important;
  background-image: none !important;
  color: #fff !important;
}

.product-flag.discount,
.product-flags .discount,
.product-flags li.product-flag.discount,
.product-flags li.product-flag.discount-amount,
.product-flags li.product-flag.discount-percentage {
  background: #8b7355 !important;
  background-color: #8b7355 !important;
  background-image: none !important;
  color: #fff !important;
}

.discount.discount-amount,
.discount.discount-percentage,
span.discount-amount,
span.discount-percentage {
  background: #8b7355 !important;
  background-color: #8b7355 !important;
  color: #fff !important;
}

.featured-products .product-flag,
.featured-products .product-flag.on-sale,
.featured-products .product-flag.discount {
  background: #8b7355 !important;
  background-image: none !important;
}

.featured-products .discount-amount,
.featured-products .discount-percentage {
  background: #8b7355 !important;
  color: #fff !important;
}

.cart-item .discount,
.product-line-grid .discount,
.product-discount .discount,
.discount-badge,
span.discount-badge,
.cart-product-discount .discount-badge {
  background: #8b7355 !important;
  background-color: #8b7355 !important;
  color: #fff !important;
}

/* --- WCAG contrast fixes --- */

.cart-products-count,
.blockcart .cart-products-count,
#_desktop_cart .cart-products-count {
  color: #fff !important;
  font-weight: 700 !important;
}

.regular-price,
.product-price--old,
.has-discount .regular-price,
.product-prices .regular-price {
  color: #666 !important;
  text-decoration: line-through !important;
}

.cart-icon-fixed,
.blockcart .cart-icon-fixed {
  color: #5a4a35 !important;
}


/* ==========================================================================
   9. THIRD-PARTY OVERRIDES
   ========================================================================== */

/* Testimonials grid */
.testimonials-grid,
.temoignages-grid,
[class*="testimonial"] .grid,
.avis-clients-grid {
  display: grid !important;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
}

@media (max-width: 479px) {
  .testimonials-grid, .temoignages-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Brands grid */
.brands-grid,
.marques-grid,
.brand-list {
  display: grid !important;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
}

@media (max-width: 479px) {
  .brands-grid, .marques-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
}

/* Sliders / Carousels */
.slider, .carousel, .swiper,
[class*="slider"], [class*="carousel"] {
  max-width: 100%;
  overflow: hidden;
}

.slider img, .carousel img, .swiper img {
  max-width: 100%;
  height: auto;
}

/* Video responsive */
video,
iframe[src*="youtube"],
iframe[src*="vimeo"],
.video-container {
  max-width: 100%;
  width: 100%;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}


/* ==========================================================================
   10. ACCESSIBILITY
   ========================================================================== */

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  z-index: 100000;
  transition: top 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #f39c12;
  outline-offset: 2px;
}

.skip-link:hover {
  background: #34495e;
  color: #ffffff;
  text-decoration: none;
}

#main-content {
  outline: none;
}

/* Screen reader only */
.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;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #8b7355;
  outline-offset: 2px;
}

a:focus, button:focus, input:focus, select:focus, textarea:focus,
[tabindex]:focus, .btn:focus, .nav-link:focus {
  outline: 2px solid #8b7355;
  outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
.nav-link:focus:not(:focus-visible) {
  outline: none;
}

.layer[role="button"]:focus {
  outline: 3px solid #8b7355;
  outline-offset: 2px;
  background: rgba(139, 115, 85, 0.8);
}

/* Touch targets */
@media (max-width: 991px) {
  button, .btn, [role="button"], a.btn,
  input[type="submit"], input[type="button"],
  .add-to-cart, .checkout-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 0.625rem 1rem !important;
  }
  nav a, .menu a, .footer-links a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 0.5rem;
  }
}

/* Reduced 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;
  }
}


/* ==========================================================================
   11. DARK MODE (force light theme)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #2c2c2c !important;
    --color-accent: #8b7355 !important;
    --color-text: #666666 !important;
    --color-text-light: #888888 !important;
    --color-border: #e8e8e8 !important;
    --color-surface: #ffffff !important;
  }
  body, .site-header, .header-topbar, .header-main,
  .mobile-menu-panel, .footer-container {
    background-color: #ffffff !important;
    color: #666666 !important;
  }
  h1, h2, h3, h4, h5, h6, p, span, div, a {
    color: inherit !important;
  }
}
