/* Base extraite verbatim des styles inline du design (mêmes valeurs, aucune modification). */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  color: #1f2724;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #2f6b47; }
input, select, textarea { font: inherit; }
button { font-family: inherit; }

@keyframes floatUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Carrousel palettes (accueil) : défilement horizontal, barre de scroll masquée
   (Firefox via scrollbar-width inline, Chrome/Safari via la règle ci-dessous). */
.rs-palette-carousel::-webkit-scrollbar { display: none; }
.rs-carousel-prev:hover, .rs-carousel-next:hover { background: #eaf1eb !important; border-color: #2f6b47 !important; }

/* Accessibilité : visible uniquement au clavier, sans changer le rendu visuel du design. */
.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;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2f6b47;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Performance : place réservée pendant le chargement des images pour éviter le CLS. */
picture img { background: #eef0ec; }

/* Effets de survol du design (attribut style-hover du prototype), valeurs identiques. */
.hover-lift { transition: transform .2s; }
.hover-lift:hover { transform: translateY(-4px); }
.hover-lift-card { transition: transform .2s, box-shadow .2s; }
.hover-lift-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -18px rgba(31,39,36,.35); }

/* =====================================================================
   RESPONSIVE — mobile / tablette / desktop
   Le rendu desktop (> 900px) reste strictement celui du design d'origine :
   aucune règle ci-dessous ne s'applique au-delà de 900px. En dessous, les
   classes rs-* (ajoutées en plus des styles inline, jamais à leur place)
   pilotent l'adaptation via des overrides ciblés (!important nécessaire
   pour battre les styles inline du design, jamais utilisé ailleurs).
   ===================================================================== */

/* Toujours actif : évite le débordement horizontal quel que soit l'écran.
   Les deux (html ET body) sont nécessaires : certains navigateurs mobiles
   (Safari iOS notamment) n'appliquent le blocage du scroll élastique
   horizontal que si la règle est présente sur les deux éléments. */
html, body { overflow-x: hidden; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-x: none; position: relative; }
img, picture, svg { max-width: 100%; }

/* Le formulaire de recherche dupliqué dans le menu mobile ne doit jamais
   apparaître sur desktop (où .rs-nav reste visible en permanence). */
.rs-search-form--mobile { display: none; }

/* Bouton hamburger : masqué par défaut (desktop), stylé pour le mobile. */
.rs-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid #e0dccf;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  color: #20302a;
  cursor: pointer;
  flex-shrink: 0;
}

/* Sidebar admin : bouton et voile masqués par défaut (desktop). */
.rs-admin-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 80;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: #1a2620;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}
.rs-admin-overlay { display: none; }

/* Modernise les champs/boutons de l'admin (focus, survol, transitions) sans toucher aux
   couleurs/tailles déjà posées en style="" dans les vues : uniquement les états interactifs
   qui ne peuvent pas s'écrire en attribut style (focus, survol, transition, animation). */
.rs-admin-shell input, .rs-admin-shell select, .rs-admin-shell textarea, .rs-admin-login input {
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rs-admin-shell input:focus, .rs-admin-shell select:focus, .rs-admin-shell textarea:focus,
.rs-admin-login input:focus {
  outline: none !important;
  border-color: #2f6b47 !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 71, .16) !important;
}
.rs-admin-shell input:hover, .rs-admin-shell select:hover, .rs-admin-shell textarea:hover,
.rs-admin-login input:hover {
  border-color: #b9c2bb !important;
}
.rs-admin-shell button, .rs-admin-login button, .rs-admin-shell .rs-fav-btn {
  transition: filter .15s ease, transform .08s ease;
}
.rs-admin-shell button:hover, .rs-admin-login button:hover { filter: brightness(1.08); }
.rs-admin-shell button:active, .rs-admin-login button:active { transform: scale(.96); }
.rs-admin-shell a[href] { transition: opacity .12s ease, background-color .15s ease, color .15s ease; }
.rs-admin-sidebar a[href]:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rs-admin-shell .rs-data-row { transition: background-color .12s ease; }
.rs-admin-shell .rs-data-row:hover { background: #faf9f4; }

/* Popup de confirmation (voir admin_sidebar.php) : la carte entrait sans transition, contrairement
   au fond qui s'estompait déjà — d'où l'effet "s'ouvre bizarrement". */
@keyframes rsConfirmPop {
  from { opacity: 0; transform: scale(.94) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.rs-confirm-box { animation: rsConfirmPop .16s cubic-bezier(.2,.8,.3,1) both; }

/* Catalogue : éléments réservés au mobile, masqués sur ordinateur (voir ≤ 900px) */
.rs-filters-toggle, .rs-filters-close, .rs-cat-chips { display: none; }
.rs-no-scroll { overflow: hidden; }

/* ---------------------------------------------------------- ≤ 900px : tablette */
@media (max-width: 900px) {
  /* Header boutique → menu déroulant */
  /* Logo + panier + menu sur une seule ligne (le panier passait sous le logo : ~70px perdus) */
  .rs-header-inner { flex-wrap: wrap; row-gap: 10px; }
  .rs-menu-toggle { display: inline-flex; order: 3; margin-left: 0; }
  .rs-header-inner .rs-header-actions { order: 2; margin-left: auto !important; }
  .rs-nav {
    display: none !important;
    flex-basis: 100%;
    order: 10;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin: 0 !important;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,.08);
  }
  .rs-header.rs-nav-open .rs-nav { display: flex !important; }
  .rs-nav a { width: 100%; padding: 9px 4px; font-size: 15px; }
  .rs-nav a:hover { background: rgba(47,107,71,.06); border-radius: 8px; }
  .rs-header.rs-nav-open .rs-search-form--mobile { display: block; width: 100%; margin-top: 8px; }
  .rs-header-actions .rs-search-form:not(.rs-search-form--mobile) { display: none !important; }
  .rs-fav-link { display: none !important; }

  /* Admin : sidebar en tiroir */
  .rs-admin-shell { grid-template-columns: 1fr !important; }
  .rs-admin-menu-toggle { display: flex; }
  .rs-admin-sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 238px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .rs-admin-sidebar.rs-sidebar-open { transform: translateX(0); }
  .rs-admin-overlay.rs-sidebar-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10,15,12,.45);
    z-index: 85;
  }
  .rs-admin-shell main { padding-top: 66px !important; }
  .rs-admin-2col { grid-template-columns: 1fr !important; }

  /* Tableaux admin : défilement horizontal dès la tablette, pas seulement le mobile.
     !important nécessaire : la page Relances fixe un min-width plus large en style="" (900px/820px,
     pour son plus grand nombre de colonnes), qui sinon l'emporterait sur cette règle et forcerait un
     défilement bien plus large que partout ailleurs dans l'admin sur petit écran. */
  .rs-data-table { overflow-x: auto; }
  .rs-data-row-head, .rs-data-row { min-width: 620px !important; }

  /* Lignes de formulaire admin à colonnes fixes (variantes, images, specs,
     édition de catégorie) : illisibles/débordantes en colonnes figées sur
     petit écran, on les empile en 1 colonne. */
  .rs-admin-row-grid { grid-template-columns: 1fr !important; }

  /* Grilles génériques 3/4 colonnes → 2 colonnes */
  .rs-3col-grid, .rs-4col-grid, .rs-features-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Sections structurelles à 2 colonnes → empilées */
  .rs-hero-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .rs-why-grid { grid-template-columns: 1fr !important; }
  .rs-cta-grid { grid-template-columns: 1fr !important; padding: 34px !important; }
  .rs-catalogue-layout { grid-template-columns: 1fr !important; }
  /* Catalogue mobile : filtres cachés, ouverts en plein écran par le bouton "Filtry"
     (sinon la liste de cases à cocher repoussait les produits sous la ligne de flottaison) */
  .rs-filters { display: none; }
  .rs-filters.rs-open {
    display: block; position: fixed !important; top: 0 !important; left: 0; right: 0; bottom: 0;
    z-index: 10000; max-height: none !important; border: none !important; border-radius: 0 !important;
    overflow-y: auto !important; padding: 0 18px 20px !important; background: #fff !important;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .rs-filters-head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 16px 0 12px; margin-bottom: 0 !important; }
  .rs-filters-close {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    background: #f4f1e8; border: none; border-radius: 10px; font-size: 18px; color: #20302a; cursor: pointer;
  }
  .rs-filters-submit {
    position: sticky; bottom: 12px; z-index: 2; padding: 15px !important; font-size: 16px !important;
    box-shadow: 0 10px 24px rgba(20, 40, 30, .28);
  }
  .rs-filters-toggle {
    display: inline-flex; align-items: center; gap: 6px; background: #2f6b47; color: #fff; border: none;
    border-radius: 999px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  }
  .rs-cat-chips {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 18px 12px; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .rs-cat-chips::-webkit-scrollbar { display: none; }
  .rs-chip {
    flex: 0 0 auto; white-space: nowrap; background: #fff; border: 1px solid #e0dccf; border-radius: 999px;
    padding: 9px 16px; font-size: 14px; font-weight: 600; color: #3a433d;
  }
  .rs-chip-active { background: #2f6b47; border-color: #2f6b47; color: #fff; }
  .rs-catalogue-toolbar label[for="rs-sort"] { display: none; }
  .rs-catalogue-toolbar select { font-size: 13px !important; padding: 9px 10px !important; }
  .rs-cat-intro {
    font-size: 14px !important; line-height: 1.5 !important; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .rs-product-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .rs-product-media { position: static !important; top: auto !important; }
  .rs-desc-reviews-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
  .rs-cart-layout { grid-template-columns: 1fr !important; }
  .rs-cart-summary { position: static !important; top: auto !important; }
  .rs-payment-grid { grid-template-columns: 1fr !important; }

  .rs-h1-sm { font-size: 30px !important; }
  .rs-h2, .rs-h2-sm { font-size: 28px !important; }
  .rs-hero-title { font-size: 44px !important; }

  /* Les 3 éléments décoratifs du hero débordent volontairement de l'image
     (chevauchement design) via des offsets négatifs — sur mobile, le
     conteneur est trop proche des bords de l'écran et ce débordement
     provoque un vrai scroll horizontal parasite. On les ramène au bord. */
  .rs-hero-bg { right: 0 !important; }
  .rs-hero-badge-tl { left: 0 !important; }
  .rs-hero-badge-br { right: 0 !important; }
}

/* ---------------------------------------------------------- ≤ 640px : mobile */
@media (max-width: 640px) {
  .rs-section { padding-left: 18px !important; padding-right: 18px !important; }
  .rs-card-pad { padding: 22px !important; }

  .rs-4col-grid, .rs-features-grid,
  .rs-2col-grid, .rs-footer-grid, .rs-admin-2col { grid-template-columns: 1fr !important; }
  /* Les labels prévus pour occuper les 2 colonnes desktop (grid-column:1/3
     en dur) doivent suivre la grille réduite à 1 colonne, sinon CSS Grid
     crée une colonne implicite fantôme pour satisfaire la ligne 3 absente. */
  .rs-full-span { grid-column: 1 / -1 !important; }

  .rs-row-header { flex-direction: column; align-items: flex-start !important; gap: 10px; }

  .rs-hero-title { font-size: 34px !important; }
  .rs-hero-stats { flex-wrap: wrap; gap: 22px !important; }
  .rs-h1-sm { font-size: 26px !important; }
  .rs-h2, .rs-h2-sm { font-size: 24px !important; }

  .rs-topbar-inner { font-size: 12px !important; padding: 7px 18px !important; gap: 2px 8px !important; }
  .rs-header-inner { gap: 10px 12px !important; padding: 12px 18px !important; }
  .rs-logo-text { font-size: 18px !important; }
  .rs-cart-link { padding: 8px 14px !important; font-size: 13px !important; gap: 6px !important; }

  /* Bandeau cookies : plus compact (il couvrait ~20 % de l'écran à la première visite).
     Le texte, le lien et les deux boutons restent identiques. */
  .rs-consent { padding: 12px 16px !important; gap: 10px !important; font-size: 13px !important; line-height: 1.4 !important; }
  .rs-consent-actions { width: 100%; }
  .rs-consent-actions button { flex: 1; padding: 10px 12px !important; font-size: 14px !important; border-width: 1px !important; border-style: solid !important; }
  .rs-consent-actions [data-consent="accept"] { border-color: #e08a3c !important; }
  .rs-simple-header-inner { gap: 10px !important; }
  /* La nav du panier fait doublon avec "← Continuer mes achats" déjà présent
     et wrappait sur 2 lignes complètes avant même le contenu de la page. */
  .rs-panier-nav { display: none !important; }

  /* Stepper de commande : cercles et libellés resserrés */
  .rs-stepper-circle { width: 34px !important; height: 34px !important; font-size: 13px !important; }
  .rs-stepper-label { font-size: 10px !important; }
  .rs-stepper-bar { margin: 0 4px !important; margin-bottom: 17px !important; }

  /* Panier : la ligne article passe en 2 lignes (infos, puis qté/prix/suppr.) */
  .rs-cart-row-head { display: none !important; }
  .rs-cart-row {
    grid-template-columns: 1fr auto !important;
    grid-template-areas: "info remove" "qty price" !important;
    row-gap: 12px !important;
  }
  .rs-cart-row > :nth-child(1) { grid-area: info; }
  .rs-cart-row > :nth-child(2) { grid-area: qty; width: auto !important; justify-self: start; }
  .rs-cart-row > :nth-child(3) { grid-area: price; width: auto !important; text-align: left !important; align-self: center; }
  .rs-cart-row > :nth-child(4) { grid-area: remove; }

  /* Fiche produit : qty + bouton + favori sur une seule ligne écrasait le
     texte du bouton ("Ajouter au panier · 159 Kč" collé dans ~135px).
     Stepper et favori restent côte à côte, le bouton passe pleine largeur. */
  .rs-add-to-cart-row { flex-wrap: wrap !important; row-gap: 12px; }
  .rs-qty-stepper { order: 1; }
  .rs-fav-btn { order: 2; }
  .rs-add-to-cart-btn { order: 3; flex-basis: 100% !important; flex-grow: 0 !important; }
}

/* ---------------------------------------------------------- ≤ 340px : très petit mobile */
@media (max-width: 340px) {
  /* Sans l'icône du logo, logo + panier + menu tiennent sur une seule ligne */
  .rs-header-inner > a > svg { display: none; }
}

/* ---------------------------------------------------------- ≤ 420px : petit mobile */
@media (max-width: 420px) {
  .rs-section { padding-left: 14px !important; padding-right: 14px !important; }
  .rs-header-inner { padding-left: 14px !important; padding-right: 14px !important; gap: 10px !important; }
  .rs-logo-text { font-size: 17px !important; }
  .rs-cart-link { padding: 7px 11px !important; }
  .rs-hero-title { font-size: 29px !important; }
  .rs-h1-sm { font-size: 23px !important; }
  .rs-4col-grid, .rs-features-grid { grid-template-columns: 1fr !important; }
  .rs-stepper-label { display: none; }
}
