/* ==================================================================
 * Mode application — styles actifs uniquement dans la PWA installée.
 *
 * Tout est préfixé par html.crbpwa-app, classe ajoutée par JavaScript
 * quand la boutique tourne en mode autonome. Sur le site consulté
 * normalement, ce fichier n'a strictement aucun effet.
 * ================================================================== */

html.crbpwa-app {
  -webkit-text-size-adjust: 100%;
}

html.crbpwa-app body {
  font-size: 16px;
  line-height: 1.5;
  /* Réserve la place de la barre de navigation basse */
  padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
}

/* ------------------------------------------------------------------
 * Grille produits : une seule colonne, photo pleine largeur.
 * Sur une grille à deux colonnes, une charnière ou un boîtier devient
 * indéchiffrable ; mieux vaut faire défiler un peu plus.
 * ------------------------------------------------------------------ */
@media (max-width: 991px) {
  html.crbpwa-app .products > [class*="col-"],
  html.crbpwa-app .products > .js-product,
  html.crbpwa-app .product_list > li {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

html.crbpwa-app .product-miniature .thumbnail-container {
  width: 100%;
  height: auto;
  margin-bottom: 18px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
  border-radius: 10px;
  overflow: hidden;
}

html.crbpwa-app .product-miniature .product-thumbnail,
html.crbpwa-app .product-miniature .product-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

/* Le bloc description ne doit plus être en surimpression */
html.crbpwa-app .product-miniature .product-description {
  position: static !important;
  width: 100%;
  background: #fff;
  padding: 14px 14px 16px;
}

html.crbpwa-app .product-miniature .product-title,
html.crbpwa-app .product-miniature .product-title a {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
}

html.crbpwa-app .product-price-and-shipping .price,
html.crbpwa-app .product-miniature .price {
  font-size: 20px;
  font-weight: 700;
}

/* L'aperçu rapide au survol n'a aucun sens au doigt */
html.crbpwa-app .quick-view,
html.crbpwa-app .highlighted-informations {
  display: none !important;
}

/* ------------------------------------------------------------------
 * Fiche produit
 * ------------------------------------------------------------------ */
html.crbpwa-app .product-cover img,
html.crbpwa-app .js-qv-product-cover {
  width: 100%;
  height: auto;
}

html.crbpwa-app .product-prices .current-price,
html.crbpwa-app .product-price .current-price {
  font-size: 26px;
  font-weight: 700;
}

html.crbpwa-app .product-description,
html.crbpwa-app .product-information {
  font-size: 16px;
  line-height: 1.6;
}

html.crbpwa-app .product-reference,
html.crbpwa-app .product-quantities {
  font-size: 15px;
}

/* ------------------------------------------------------------------
 * Zones tactiles : 48 px de haut minimum, la recommandation Google
 * ------------------------------------------------------------------ */
html.crbpwa-app .btn,
html.crbpwa-app button,
html.crbpwa-app input[type="submit"],
html.crbpwa-app .add-to-cart,
html.crbpwa-app .dropdown-item,
html.crbpwa-app .navbar-toggler {
  min-height: 48px;
  font-size: 16px;
}

html.crbpwa-app .btn,
html.crbpwa-app .add-to-cart {
  padding: 12px 20px;
  border-radius: 8px;
}

html.crbpwa-app .add-to-cart {
  width: 100%;
  font-weight: 600;
}

html.crbpwa-app input[type="text"],
html.crbpwa-app input[type="email"],
html.crbpwa-app input[type="password"],
html.crbpwa-app input[type="tel"],
html.crbpwa-app input[type="number"],
html.crbpwa-app input[type="search"],
html.crbpwa-app select,
html.crbpwa-app textarea,
html.crbpwa-app .form-control {
  /* 16 px empêche le zoom automatique du champ sur iOS */
  font-size: 16px !important;
  min-height: 48px;
  border-radius: 8px;
}

html.crbpwa-app .menu li a,
html.crbpwa-app #_mobile_currency_selector a,
html.crbpwa-app #_mobile_language_selector a,
html.crbpwa-app .footer-container li a {
  padding-top: 12px;
  padding-bottom: 12px;
  display: inline-block;
}

/* Espacement entre liens serrés du pied de page */
html.crbpwa-app .footer-container li {
  margin-bottom: 4px;
}

/* ------------------------------------------------------------------
 * Recherche accessible en permanence
 * ------------------------------------------------------------------ */
html.crbpwa-app #search_widget,
html.crbpwa-app .search-widget {
  display: block !important;
  width: 100%;
  float: none;
}

html.crbpwa-app #search_widget form input[type="text"] {
  width: 100%;
}

/* ------------------------------------------------------------------
 * Allègement : ce qui n'a pas sa place dans une application
 * ------------------------------------------------------------------ */
html.crbpwa-app #footer .block-social,
html.crbpwa-app #footer .block_newsletter,
html.crbpwa-app .header-banner,
html.crbpwa-app #_desktop_language_selector,
html.crbpwa-app #_desktop_currency_selector {
  display: none !important;
}

html.crbpwa-app #footer {
  padding-bottom: 8px;
}

/* ------------------------------------------------------------------
 * Barre de navigation basse
 * ------------------------------------------------------------------ */
#crbpwa-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  background: #fff;
  border-top: 1px solid #e3e3e3;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
}

#crbpwa-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 60px;
  padding: 8px 4px;
  color: #6b6b6b;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  position: relative;
}

#crbpwa-nav a:active {
  background: #f4f4f4;
}

#crbpwa-nav a.is-current {
  color: var(--crbpwa-accent, #06a1d9);
  font-weight: 600;
}

#crbpwa-nav svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pastille du nombre d'articles au panier */
#crbpwa-nav .crbpwa-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #d0021b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  #crbpwa-nav a { transition: none; }
}
