/* Aura — final responsive correction layer (mobile + tablet)
   This file is loaded after the shared theme styles. It changes layout only;
   product data, URLs, prices, inventory and checkout logic remain untouched. */
:root {
  --ep-mobile-gutter: 12px;
  --ep-touch-target: 44px;
}
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; }

@media (max-width: 767px) {
  html, body { width: 100%; max-width: 100%; overflow-x: clip; }
  body { font-size: 14px; -webkit-text-size-adjust: 100%; }
  .main-content, .main-content > *, .container { min-width: 0; }
  .main-content { width: 100%; overflow-x: clip; }
  .container { max-width: 100% !important; }
  p, h1, h2, h3, h4, a, button, label { overflow-wrap: anywhere; }
  input, select, textarea, button { max-width: 100%; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: var(--ep-touch-target); font-size: 16px; }
  button, .yc-btn, .primary-button, .product-btn, .checkout_cta { min-height: var(--ep-touch-target); }

  /* Header : menu, logo centré, recherche et panier toujours accessibles. */
  .yc-header .yc-navbar {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    gap: 6px !important;
    min-height: 64px !important;
    padding: 7px 10px !important;
  }
  .yc-header .yc-navbar > .menu { grid-column: 1; grid-row: 1; justify-self: start !important; min-width: 0; }
  .yc-header .yc-navbar > .logo { grid-column: 2; grid-row: 1; justify-self: center !important; min-width: 0; max-width: 100%; }
  .yc-header .yc-navbar > .logo img { display: block; width: auto !important; max-width: min(48vw, 155px) !important; max-height: 50px !important; }
  .yc-header .yc-navbar > .corner { grid-column: 3; grid-row: 1; justify-self: end !important; gap: 9px !important; min-width: 0; }
  .yc-header .yc-navbar .menu .menu-toggler { width: 42px !important; height: 42px !important; min-height: 42px !important; }
  .yc-header .yc-navbar .corner .search { display: none !important; }
  .yc-header .yc-navbar .corner .search svg { display: none !important; }
  .yc-header .yc-navbar .corner .cart { min-width: 40px; min-height: 42px; }
  .yc-header .yc-navbar .menu-list { display: none !important; }
  .ep-mobile-top-links { max-width: 100vw; gap: 7px !important; padding: 8px 10px !important; }
  .ep-mobile-top-links a { min-height: 36px; display: inline-flex; align-items: center; padding: 7px 11px !important; font-size: 12px !important; }
  .navigation-drawer { max-width: 100vw; }
  .navigation-drawer .mobile-search { display: flex; gap: 7px; padding: 10px 12px; }
  .navigation-drawer .mobile-search input { min-width: 0; width: 100%; }

  /* Accueil : bannières fluides, raccourcis et sections sans débordement. */
  .ep-hero, .ep-hero__slider, .ep-hero__slider .splide__track,
  .ep-hero__slider .splide__list, .ep-hero__slider .splide__slide { min-width: 0; max-width: 100%; }
  .ep-hero--cats { display: block !important; }
  .ep-hero--cats .ep-catside { width: 100% !important; min-width: 0 !important; }
  .ep-home-quicklinks { width: 100%; padding: 22px 10px 18px !important; }
  .ep-home-quicklinks__heading { align-items: flex-start !important; flex-direction: column !important; gap: 8px !important; }
  .ep-home-quicklinks__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 9px !important; }
  .ep-home-quicklinks__card { min-width: 0; min-height: 138px !important; }
  .ep-home-quicklinks__copy { left: 10px !important; right: 8px !important; bottom: 10px !important; }
  .ep-home-quicklinks__copy strong { font-size: 14px !important; line-height: 1.25; }
  .ep-home-quicklinks__copy small { font-size: 10px !important; line-height: 1.3; }
  .ep-brands { overflow: hidden; }
  .ep-brands__viewport { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ep-brands__track { width: max-content; }
  .yc-section-title { padding-inline: 12px; font-size: clamp(20px, 5vw, 24px) !important; line-height: 1.25; }

  /* Catalogue, résultats de recherche et listes de produits. */
  .yc-product-listing-container { width: 100% !important; padding: 0 10px !important; }
  .yc-product-listing-container .collection-heading { display: block !important; margin: 16px auto !important; }
  .yc-product-listing-container .collection-heading .breadcrumbs-wrapper .breadcrumbs-name { font-size: 19px !important; line-height: 1.3; }
  .yc-product-listing-container .product-list,
  .yc-featured-products .product-list,
  .template-search .product-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 9px !important;
    width: 100% !important;
    margin: 16px auto 24px !important;
    padding-inline: 0 !important;
  }
  .yc-product-listing-container .product-list > *,
  .yc-featured-products .product-list > *,
  .product-list .product-block,
  .ep-product-card { min-width: 0 !important; max-width: 100%; }
  .yc-product-listing-container .product-list .product-thumbnail,
  .yc-featured-products .product-list .product-thumbnail,
  .ep-product-card .product-thumbnail {
    width: 100% !important; height: auto !important; aspect-ratio: 1 / 1 !important;
    padding: 0 !important; overflow: hidden !important; background: #fff !important;
  }
  .yc-product-listing-container .product-list .product-thumbnail img,
  .yc-featured-products .product-list .product-thumbnail img,
  .ep-product-card .product-thumbnail img {
    position: static !important; display: block !important; width: 100% !important; height: 100% !important;
    max-height: none !important; transform: none !important; object-fit: contain !important;
    object-position: center !important; padding: 7px !important;
  }
  .yc-product-listing-container .product-details,
  .yc-featured-products .product-details,
  .ep-product-card .product-details { min-width: 0; padding: 8px 8px 5px !important; margin: 0 !important; }
  .yc-product-listing-container .product-title,
  .yc-featured-products .product-title,
  .ep-product-card .product-title {
    display: -webkit-box !important; -webkit-box-orient: vertical !important; -webkit-line-clamp: 2 !important;
    overflow: hidden !important; min-height: 2.65em; font-size: 12px !important; line-height: 1.35 !important;
  }
  .yc-product-listing-container .prices, .yc-featured-products .prices, .ep-product-card .prices {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; min-width: 0;
  }
  .yc-product-listing-container .product-price, .yc-featured-products .product-price, .ep-product-card .product-price {
    font-size: 14px !important; line-height: 1.3 !important; overflow-wrap: anywhere;
  }
  .ep-product-card__actions { flex-wrap: wrap; gap: 6px; padding: 5px 8px 9px !important; }
  .ep-product-card__actions .product-btn { width: 100% !important; }
  .ep-catalog-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; padding: 10px !important; margin: 12px 0 !important; }
  .ep-catalog-toolbar .ep-catalog-search,
  .ep-catalog-toolbar .ep-catalog-count { grid-column: 1 / -1 !important; }
  .ep-catalog-toolbar label { min-width: 0; }
  .ep-catalog-toolbar input, .ep-catalog-toolbar select, .ep-catalog-toolbar button { width: 100% !important; min-width: 0 !important; height: 42px !important; font-size: 14px !important; }
  .sort-container { width: 100% !important; max-width: 100% !important; margin: 12px 0 !important; }
  .sort-container #productDropdownFiltring { width: 100% !important; min-width: 0 !important; }
  .ep-collection-page { width: 100% !important; padding: 0 10px 24px !important; }
  .ep-collections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 9px !important; }
  .ep-collections-hero-inner { padding: 18px 14px !important; }
  .ep-collections-hero h1 { font-size: clamp(23px, 6vw, 29px) !important; }
  .ep-collections-services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* Fiche produit : galerie carrée 1:1, miniatures horizontales et achat clair. */
  body.template-product .yc-single-product { width: 100% !important; padding: 0 10px !important; gap: 10px !important; }
  body.template-product .yc-single-product > .product-images,
  body.template-product .yc-single-product > .product-details { width: 100% !important; min-width: 0 !important; }
  body.template-product .yc-single-product .product-images-container { display: flex !important; flex-direction: column !important; gap: 8px !important; }
  body.template-product .yc-single-product #img-zoomer-box { width: 100% !important; height: auto !important; min-height: 0 !important; aspect-ratio: 1 / 1 !important; }
  body.template-product .yc-single-product #img-zoomer-box .main-image { width: 100% !important; height: 100% !important; object-fit: contain !important; object-position: center !important; }
  body.template-product .yc-single-product .thumbnail-images { width: 100% !important; min-width: 0 !important; overflow: hidden !important; }
  body.template-product .yc-single-product .thumbnail-images .splide__track { width: 100% !important; }
  body.template-product .yc-single-product .thumbnail-images .splide__list { display: flex !important; flex-direction: row !important; gap: 8px !important; }
  body.template-product .yc-single-product .thumbnail-images .image-container { flex: 0 0 68px !important; width: 68px !important; height: 68px !important; margin: 0 !important; }
  body.template-product .yc-single-product .thumbnail-images img { width: 100% !important; height: 100% !important; object-fit: contain !important; }
  body.template-product .yc-single-product .product-name { font-size: clamp(19px, 5vw, 23px) !important; line-height: 1.28 !important; overflow-wrap: anywhere; }
  body.template-product .yc-single-product .product-details { gap: 11px !important; padding: 14px !important; }
  body.template-product .yc-single-product .product-description { font-size: 14px !important; line-height: 1.65 !important; }
  body.template-product .yc-single-product .product-details .yc-btn,
  body.template-product .yc-single-product .product-details .express-checkout-button,
  body.template-product .yc-single-product .product-details .add-to-cart-button,
  body.template-product .yc-single-product .add-to-cart-btn button { width: 100% !important; min-height: 48px !important; }
  body.template-product .ep-product-assurance { grid-template-columns: minmax(0, 1fr) !important; }
  body.template-product .yc-single-product table { display: block !important; max-width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

  /* Panier et pages éditoriales : colonnes flexibles, récapitulatif pleine largeur. */
  .yc-cart { width: 100%; margin: 20px 0 !important; }
  .yc-cart .container { width: 100% !important; padding-inline: 10px !important; }
  .yc-cart .cart-items-container { padding: 10px !important; margin: 16px 0 !important; gap: 12px !important; }
  .yc-cart .cart-table .summary-box { width: 100% !important; max-width: 100% !important; margin: 18px auto !important; padding: 15px !important; }
  .yc-cart .cart-table .summary-box .coupon-wrapper,
  .yc-cart .cart-table .summary-box form .flex { display: flex; flex-wrap: wrap; gap: 8px; }
  .yc-cart .cart-table .summary-box input { min-width: 0; flex: 1 1 150px; }
  .table-container .row { min-width: 0; grid-template-columns: 82px minmax(0, 1fr) !important; gap: 8px; }
  .table-container .row .product-preview { margin-inline-end: 0 !important; }
  .table-container .row .product-preview .product-image img { width: 76px !important; height: 76px !important; object-fit: contain !important; }
  .table-container .row .prodcut-details { min-width: 0; padding-inline-end: 28px !important; }
  .table-container .row .prodcut-details .cell { min-width: 0; }
  .table-container .row .prodcut-details .cell .product-title { font-size: 13px !important; line-height: 1.35; }
  .table-container .row .prodcut-details .close-btn { right: 0 !important; left: auto !important; top: 5px !important; }
  .yc-page, .yc-page-container, .contact-us, .contact-form, .yc-page-title { max-width: 100% !important; }
  .yc-page, .yc-page-container { padding-inline: 12px !important; }
  .contact-form, .contact-details { width: 100% !important; min-width: 0 !important; padding: 14px !important; }
  .yc-page img, .yc-page-container img, .product-description img { height: auto; max-width: 100%; }

  /* Pied de page et éléments flottants. */
  .yc-footer { width: 100%; overflow: hidden; }
  .yc-footer .container { width: calc(100% - 24px) !important; }
  .ep-compare-dock { width: calc(100% - 20px) !important; max-width: none !important; bottom: 8px !important; }
  .ep-compare-modal { padding: 8px !important; }
  .ep-compare-modal__panel { width: 100% !important; max-height: 90vh !important; padding: 12px !important; overflow: auto !important; }
}

@media (max-width: 380px) {
  :root { --ep-mobile-gutter: 8px; }
  .yc-header .yc-navbar { grid-template-columns: 40px minmax(0, 1fr) 40px !important; padding-inline: 7px !important; }
  .yc-header .yc-navbar > .logo img { max-width: min(44vw, 132px) !important; }
  .yc-product-listing-container { padding-inline: 7px !important; }
  .yc-product-listing-container .product-list, .yc-featured-products .product-list { gap: 10px 7px !important; }
  .ep-home-quicklinks__card { min-height: 125px !important; }
  .yc-product-listing-container .product-price, .yc-featured-products .product-price, .ep-product-card .product-price { font-size: 13px !important; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .container { max-width: 100%; }
  .yc-product-listing-container { padding-inline: 22px !important; }
  .yc-product-listing-container .product-list { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 20px 14px !important; }
  .ep-collections-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .ep-home-quicklinks__grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  body.template-product .yc-single-product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 14px !important; }
  body.template-product .yc-single-product #img-zoomer-box { height: auto !important; min-height: 0 !important; aspect-ratio: 1 / 1 !important; }
}

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