@import url('./mobile-enhancements.css');
@import url('./crm-client-mobile-fix.css?v=20261106-client-scroll4');

/* ========================================================================== 
   MOBILE — SUPPRESSION DU CADRE BLEU AU TAP
   Android/Chrome peut afficher une surbrillance bleue derrière les liens,
   boutons, logos et icônes au toucher. On la neutralise sans supprimer le
   focus clavier accessible sur ordinateur.
   ========================================================================== */
a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
summary,
label[for],
.logo,
.logo-circle,
.menu-toggle,
.nav-toggle,
.close,
.close-btn,
.btn,
[onclick] {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
}

/* Empêche le contour de focus créé uniquement par un clic/tap, tout en
   conservant un vrai indicateur de focus pour la navigation au clavier. */
:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none;
}

:focus-visible {
  outline: 2px solid #D4AF37;
  outline-offset: 3px;
}

/* ========================================================================== 
   LE ROY FACTORY — DESIGN GLOBAL (sans décor floral)
   RÈGLE PERMANENTE : les anciens bandeaux fleuris ne doivent plus être
   utilisés dans le site, le CRM ni les nouvelles pages.
   ========================================================================== */

/* 1. Fond général de toutes les pages en blanc crème / coquille d'œuf */
body, html {
  background-color: #FBF9F5 !important;
  background-image: none !important;
  color: #1A2530 !important;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

/* 2. Bandeau haut premium, sans aucune image décorative */
header,
.site-header,
.crm-topbar {
  background-color: #17191e !important;
  background-image: linear-gradient(135deg, #111318 0%, #252932 68%, #352d16 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-bottom: 2px solid #D4AF37 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.28);
  width: 100% !important;
}

/* 3. Bandeau bas premium, sans aucune image décorative */
footer,
.site-footer {
  background-color: #1b1d22 !important;
  background-image: linear-gradient(135deg, #17191e 0%, #2a2d34 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-top: 2px solid #D4AF37 !important;
  color: #FFFFFF !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  padding: 1rem 0.5rem !important;
  text-align: center;
  width: 100vw !important;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  box-sizing: border-box !important;
}

footer a,
.site-footer a {
  color: #FFD700 !important;
  text-decoration: none;
}

/* ========================================================================== 
   TEST CENTER — structure CRM fiable sur PC et smartphone
   La sidebar doit être hors du flux : lorsqu'elle est masquée sur mobile,
   elle ne doit jamais réserver un grand espace vide au-dessus du contenu.
   ========================================================================== */
body.crm-body:has(.crm-main-content.test-page) > .crm-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 260px !important;
  height: 100dvh !important;
  overflow-y: auto !important;
}

body.crm-body:has(.crm-main-content.test-page) > .crm-main-content.test-page {
  margin-left: 260px !important;
  width: calc(100% - 260px) !important;
  min-height: 100dvh !important;
}

/* Le bandeau du Test Center est volontairement indépendant du header public. */
body.crm-body header.test-topbar {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  min-height: 0 !important;
  background-color: #17191e !important;
  background-image: linear-gradient(135deg, #151515 0%, #29261f 72%, #3c3218 100%) !important;
  background-size: cover !important;
  background-position: center !important;
  border-bottom: 2px solid #D4AF37 !important;
}

@media (max-width: 900px) {
  body.crm-body:has(.crm-main-content.test-page) > .crm-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(86vw, 320px) !important;
    height: 100dvh !important;
  }

  body.crm-body:has(.crm-main-content.test-page) > .crm-main-content.test-page {
    margin: 0 !important;
    width: 100% !important;
    padding: 88px 0 78px !important;
    min-height: 100dvh !important;
  }

  body.crm-body header.test-topbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 14px 14px !important;
    width: calc(100% - 28px) !important;
    border-radius: 18px !important;
  }
}

/* 4. Logo officiel unique : assetlogorond.png */
.logo,
.site-header a.logo,
header a.logo {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  padding-left: .65rem !important;
}

.logo > img,
.logo-circle > img,
.sidebar-brand img,
.site-header a.logo > img,
header a.logo > img {
  content: url('https://storage.googleapis.com/le-roy-factory.firebasestorage.app/public-site-assets/le-roy-factory/064a2492b7c0/assets/brand-v2/assetlogorond.png?v=20260901-official-big') !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* Site public : logo floral officiel, version de cache 18/09/2026.
   Cette règle ne s'applique jamais au CRM. */
body:not(.crm-body) header a.logo > img,
body:not(.crm-body) .site-header a.logo > img,
body:not(.crm-body) .logo > img {
  content: normal !important;
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  transform: none !important;
  background: transparent !important;
}

body:not(.crm-body) header a.logo > div,
body:not(.crm-body) .site-header a.logo > div {
  width: 82px !important;
  height: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Site public desktop : logo compact */

body.crm-body header a.logo > img,
body.crm-body .site-header a.logo > img,
body.crm-body .logo > img {
  width: 92px !important;
  height: 92px !important;
  max-width: none !important;
  max-height: none !important;
}

/* CRM : logo de la barre latérale plus grand */
.logo-circle {
  width: 82px !important;
  height: 82px !important;
  overflow: visible !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
}

@media (max-width: 900px) {
  /* Mobile : logo agrandi sans toucher aux proportions */
  body:not(.crm-body) header a.logo > img,
  body:not(.crm-body) .site-header a.logo > img,
  body:not(.crm-body) .logo > img {
    width: 78px !important;
    height: 78px !important;
  }

  body.crm-body .logo-circle {
    width: 72px !important;
    height: 72px !important;
  }
}

/* 5. Effet de survol doré sur toutes les cartes du site */
.card-premium,
.partner-card {
  transition: all 0.3s ease !important;
}

.card-premium:hover,
.partner-card:hover {
  border-color: #D4AF37 !important;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25), 0 10px 30px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-2px);
}

/* ========================================================================== 
   FORÇAGE DU TEXTE FONCÉ DANS LE FOOTER
   ========================================================================== */
footer *,
.site-footer *,
footer p,
.site-footer p {
  color: #1A2530 !important;
  text-shadow: none !important;
}

/* ========================================================================== 
   CRM — suppression de l'entrée Prospects dans la navigation
   Les prospects restent exploitables dans la base clients si nécessaire,
   mais l'entrée de menu dédiée n'est plus affichée.
   ========================================================================== */
.crm-sidebar a[href="clients.html?filter=prospect"],
.crm-sidebar a[href$="clients.html?filter=prospect"],
.lrf-mobile-actions a[href="clients.html?filter=prospect"],
.lrf-mobile-action-sheet a[href="clients.html#new-prospect"] {
  display: none !important;
}

/* ========================================================================== 
   PUBLIC — PREMIER AFFICHAGE
   Les pages restent visibles pendant les améliorations JavaScript.
   ========================================================================== */
/* Public content stays readable while the optional enhancements initialize. */
body:has(> header .main-nav) { visibility: visible; opacity: 1; }


/* ========================================================================== 
   SCROLLBAR — visible en permanence sur PC
   ========================================================================== */
html {
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
  scrollbar-width: auto !important;
  scrollbar-color: #b79232 #eee7db;
}

body {
  min-height: 100vh;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 14px !important;
  display: block !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #eee7db;
  border-left: 1px solid #d9cfbd;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#d6b453,#a67b1f);
  border-radius: 999px;
  border: 3px solid #eee7db;
  min-height: 48px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,#e4c668,#8f6817);
}

@media (max-width: 900px) {
  html {
    overflow-y: auto !important;
    scrollbar-gutter: auto;
  }

  /* Paramètres et sous-pages : le bouton/flèche retour doit rester sous la zone
     système de l'iPhone et disposer d'une vraie zone tactile. */
  a.back[href="parametres.html"] {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    margin-top: max(12px, env(safe-area-inset-top)) !important;
    position: relative !important;
    z-index: 20 !important;
    touch-action: manipulation;
  }
}

/* L'ancien curseur maillet a été supprimé. Le curseur public PC est désormais géré exclusivement par lrf-glove-cursor.js. */

/* Public desktop layout reserves the custom scrollbar before its controller loads.
   Only pages which install that controller carry this parsed HTML attribute. */
@media (min-width:901px){
  html[data-lrf-public-scrollbar]:not(:has(body.crm-body)){scrollbar-width:none!important;scrollbar-gutter:auto!important;overflow-y:scroll!important}
  html[data-lrf-public-scrollbar]:not(:has(body.crm-body))::-webkit-scrollbar,
  html[data-lrf-public-scrollbar] body:not(.crm-body)::-webkit-scrollbar{width:0!important;height:0!important;display:none!important}
  html[data-lrf-public-scrollbar] body:not(.crm-body){padding-right:18px!important;box-sizing:border-box!important}
}
