/* MES PRODUITS V4.1 — surfaces, contraste et accessibilité du mode sombre.
   Chargé en dernier. Aucune modification aux comptes, droits ou API.
*/
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink:#f9e9f0;
  --muted:#d9bac9;
  --canvas:#1d1720;
  --white:#302533;
  --line:#675063;
  --tag:#463442;
  --rose:#df8fac;
  --teal:#e2a6bc;
  --teal-dark:#f0b7ca;
}
:root[data-theme="dark"] body { background:#1c1720 !important; color:#f7eaf0 !important; }
:root[data-theme="dark"] .site-header {background:linear-gradient(120deg,#302331,#241c28) !important;border-color:#543e4d !important;}
:root[data-theme="dark"] .brandmark {background:#493242 !important;color:#ffc3d6 !important;}
:root[data-theme="dark"] .identity, :root[data-theme="dark"] .brandword, :root[data-theme="dark"] .brand-subtitle {color:#ffedf3 !important;}
:root[data-theme="dark"] .header-bloom{color:#ac758b!important;opacity:.28!important;}
:root[data-theme="dark"] .account-button,:root[data-theme="dark"] .account-name,:root[data-theme="dark"] .site-nav button:not(.is-current){color:#f8e7ed!important;}
:root[data-theme="dark"] .account-avatar{background:#523849!important;color:#fbe4ee!important;}
:root[data-theme="dark"] .site-nav .nav-catalogue.is-current{background:linear-gradient(120deg,#b95575,#8d3353)!important;color:#fff!important;}
:root[data-theme="dark"] .theme-button,:root[data-theme="dark"] .admin-trigger{background:#483142!important;border-color:#826073!important;color:#fff1f5!important;}
:root[data-theme="dark"] .site-nav .my-interests.active{color:#ffc6d8!important;}
:root[data-theme="dark"] .site-footer{background:#261d29!important;border-color:#624758!important;color:#e5c9d4!important;}
:root[data-theme="dark"] .catalog-layout,:root[data-theme="dark"] .catalog-results,:root[data-theme="dark"] .catalog-topbar,:root[data-theme="dark"] .main-content{color:#f5e9ee!important;}
:root[data-theme="dark"] .catalog-sidebar{background:#2d222e!important;border-color:#664658!important;box-shadow:0 10px 28px #09050a55!important;}
:root[data-theme="dark"] .side-heading,:root[data-theme="dark"] .sidebar-label,:root[data-theme="dark"] .gender-filter-label,:root[data-theme="dark"] .catalog-sidebar .filter-group label{color:#f8dce7!important;}
:root[data-theme="dark"] .side-category{color:#f3e0e9!important;}
:root[data-theme="dark"] .side-category:hover,:root[data-theme="dark"] .side-category.active{background:#563748!important;border-color:#84566b!important;color:#fff!important;}
:root[data-theme="dark"] .side-category-count{background:#5e3d50!important;color:#ffe4ee!important;}
:root[data-theme="dark"] .sidebar-categories,:root[data-theme="dark"] .sidebar-select-section,:root[data-theme="dark"] .gender-filter,:root[data-theme="dark"] .side-heading{border-color:#59414f!important;}
:root[data-theme="dark"] .sidebar-note,:root[data-theme="dark"] .collapse-filter{color:#dfb5c5!important;}
:root[data-theme="dark"] .gender-choice{background:#3d2d3a!important;color:#f3dfe8!important;border:1px solid #765263!important;}
:root[data-theme="dark"] .gender-choice.active{background:#795066!important;color:#fff!important;border-color:#c4869e!important;box-shadow:0 0 0 1px #d28da7!important;}
:root[data-theme="dark"] .catalog-sidebar select,:root[data-theme="dark"] .top-sort select,:root[data-theme="dark"] .filter-group select{background:#3e2d3a!important;border-color:#816171!important;color:#fff1f5!important;}
:root[data-theme="dark"] .select-wrap:after{color:#edc3d1!important;}
:root[data-theme="dark"] .reset-button,:root[data-theme="dark"] .sidebar-close{background:#48313f!important;border-color:#855e72!important;color:#ffe2ec!important;}
:root[data-theme="dark"] .search-input-wrap,:root[data-theme="dark"] .catalog-topbar .search-input-wrap{background:#362936!important;border-color:#765768!important;box-shadow:none!important;}
:root[data-theme="dark"] .search-input-wrap input{color:#fff1f6!important;background:transparent!important;}
:root[data-theme="dark"] input::placeholder{color:#cfacbb!important;opacity:1!important;}
:root[data-theme="dark"] .search-icon{color:#f0b9cd!important;}
:root[data-theme="dark"] .search-shortcut{color:#f3d2de!important;border-color:#735065!important;}
:root[data-theme="dark"] .category-head,:root[data-theme="dark"] .category-head span:first-child{color:#f3c2d2!important;}
:root[data-theme="dark"] .category-head span:last-child{color:#d6b1c2!important;}
:root[data-theme="dark"] .rail-arrow{background:#433141!important;border-color:#795266!important;color:#ffe4ec!important;}
:root[data-theme="dark"] .category-tab{background:linear-gradient(160deg,#382937,#352733)!important;border-color:#67485a!important;color:#f9e8ee!important;}
:root[data-theme="dark"] .category-tab:nth-child(even){background:#40303f!important;}
:root[data-theme="dark"] .category-tab:hover{background:#503449!important;border-color:#9c637c!important;}
:root[data-theme="dark"] .category-tab.active{background:linear-gradient(145deg,#724158,#543547)!important;border-color:#d68aa6!important;box-shadow:0 0 0 1px #cb81a0 inset!important;}
:root[data-theme="dark"] .category-label{color:#f9e6ef!important;}
:root[data-theme="dark"] .filter-chip{background:#573747!important;color:#ffdfeb!important;border-color:#a16b82!important;}
:root[data-theme="dark"] .catalog-results .results-head{background:#302533!important;border-color:#66475a!important;color:#f7e7ef!important;}
:root[data-theme="dark"] .result-count,:root[data-theme="dark"] #resultCount,:root[data-theme="dark"] .result-count b{color:#f3e1e9!important;}
:root[data-theme="dark"] .result-count b{color:#f9aeca!important;}
:root[data-theme="dark"] .refresh-button,:root[data-theme="dark"] .inventory-summary{color:#e7b9ca!important;}
:root[data-theme="dark"] .new-filter-button{background:#563647!important;color:#ffe8f0!important;}
:root[data-theme="dark"] .new-filter-button.is-active{background:#a44d6c!important;color:#fff!important;}
:root[data-theme="dark"] .view-tools,:root[data-theme="dark"] .view-tools span{color:#e9c5d2!important;}
:root[data-theme="dark"] .view-button,:root[data-theme="dark"] .mobile-filter-toggle,:root[data-theme="dark"] .load-more{background:#45303e!important;color:#fff0f5!important;border-color:#8b6175!important;}
:root[data-theme="dark"] .product-card{background:#302534!important;border-color:#634655!important;box-shadow:0 8px 25px #0b081048!important;color:#f7e6ec!important;}
:root[data-theme="dark"] .product-visual{background:radial-gradient(ellipse at 50% 60%,#4a3544,#372a38 70%)!important;}
:root[data-theme="dark"] .product-card .product-name,:root[data-theme="dark"] .product-card .product-brand{color:#fff1f5!important;}
:root[data-theme="dark"] .product-card .product-detail{color:#e6becd!important;}
:root[data-theme="dark"] .product-card .product-size{background:#4b3745!important;color:#ffe1ec!important;}
:root[data-theme="dark"] .product-quantity{background:#2c5141!important;color:#d8ffe5!important;}
:root[data-theme="dark"] .detail-action{background:#543447!important;color:#ffe8f1!important;border-color:#8d5b74!important;}
:root[data-theme="dark"] .interest-action.is-selected{background:#503649!important;color:#fff0f5!important;border-color:#a36c84!important;}
:root[data-theme="dark"] .quick-heart{background:#4a3142e8!important;color:#ffd4e4!important;}
:root[data-theme="dark"] .quick-heart.is-selected{background:#74425a!important;color:#fff!important;}
:root[data-theme="dark"] .product-dialog{background:#302431!important;color:#f8e9ef!important;border-left:1px solid #745367!important;}
:root[data-theme="dark"] .dialog-close{background:#4a3342!important;color:#ffe9f2!important;border-color:#846275!important;}
:root[data-theme="dark"] .detail-photo{background:linear-gradient(150deg,#4b3442,#322431)!important;}
:root[data-theme="dark"] .detail-copy h2,:root[data-theme="dark"] .detail-copy h3,:root[data-theme="dark"] .detail-eyebrow,:root[data-theme="dark"] .detail-brand{color:#fff1f6!important;}
:root[data-theme="dark"] .detail-copy #detailMetadata{background:#513649!important;color:#f9e4ec!important;}
:root[data-theme="dark"] .detail-copy #detailDescription{color:#f0dce5!important;}
:root[data-theme="dark"] .detail-copy .detail-stock{background:#2a533e!important;color:#d8ffdf!important;}
:root[data-theme="dark"] .detail-copy .detail-notes{color:#edceda!important;border-color:#705166!important;}
:root[data-theme="dark"] .detail-copy .detail-source{color:#dcb9c8!important;border-color:#705166!important;}
:root[data-theme="dark"] .detail-copy h3{border-color:#705166!important;}
:root[data-theme="dark"] .empty-state,:root[data-theme="dark"] .empty-state h2,:root[data-theme="dark"] .empty-state p,:root[data-theme="dark"] .error-state,:root[data-theme="dark"] .error-state strong,:root[data-theme="dark"] .error-state p{color:#f0d9e3!important;}
:root[data-theme="dark"] .empty-state button,:root[data-theme="dark"] .error-state button{background:#503345!important;color:#fff1f5!important;border-color:#92637a!important;}
/* L'administration prend aussi le thème sombre, sans modifier la gestion des comptes. */
:root[data-theme="dark"] .admin-page{color:#f9eaf0!important;}
:root[data-theme="dark"] .admin-heading h1,:root[data-theme="dark"] .admin-card h2{color:#fff0f6!important;}
:root[data-theme="dark"] .admin-heading p,:root[data-theme="dark"] .admin-hint,:root[data-theme="dark"] .admin-meta,:root[data-theme="dark"] .admin-empty,:root[data-theme="dark"] .admin-footnote,:root[data-theme="dark"] .admin-add-form label{color:#dfbccb!important;}
:root[data-theme="dark"] .admin-card{background:#302533!important;border-color:#66475a!important;box-shadow:0 8px 30px #09060945!important;}
:root[data-theme="dark"] .admin-rows,:root[data-theme="dark"] .admin-row{border-color:#604655!important;}
:root[data-theme="dark"] .admin-person,:root[data-theme="dark"] .admin-detail,:root[data-theme="dark"] .admin-detail summary{color:#f9e9f0!important;}
:root[data-theme="dark"] .admin-card input,:root[data-theme="dark"] .admin-page input{background:#41303e!important;color:#fff2f6!important;border:1px solid #896176!important;}
:root[data-theme="dark"] .admin-card input[type="checkbox"]{accent-color:#c96b8e!important;}
:root[data-theme="dark"] .admin-count{background:#613f50!important;color:#ffdfed!important;}
:root[data-theme="dark"] .admin-back,:root[data-theme="dark"] .admin-refresh,:root[data-theme="dark"] .admin-action{background:#4d3645!important;color:#fff0f6!important;border-color:#846073!important;}
:root[data-theme="dark"] .admin-primary{background:#a94968!important;color:#fff!important;border-color:#ce7e9e!important;}
:root[data-theme="dark"] .admin-action.negative{background:#604047!important;border-color:#a66d78!important;color:#ffd5dc!important;}
:root[data-theme="dark"] .admin-message{background:#31483e!important;color:#e8ffef!important;border-color:#5c9477!important;}
:root[data-theme="dark"] .admin-message.is-error{background:#613a42!important;color:#ffe0e1!important;border-color:#ad7079!important;}
:root[data-theme="dark"] .admin-page code{background:#483441!important;color:#ffe3ed!important;}
/* Sur mobile : pas de zone masquée derrière le tiroir des filtres. */
@media (max-width:700px){
  :root[data-theme="dark"] .catalog-sidebar.filters-open{background:#2d222e!important;}
}
/* Les neuf univers restent sur UNE ligne : rail réellement horizontal. */
.category-rail{min-width:0;align-items:center;}
.category-rail .category-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;padding:1px 2px 8px!important;align-items:stretch;}
.category-rail .category-tabs::-webkit-scrollbar{display:none;}
.category-rail .category-tab{flex:0 0 116px!important;scroll-snap-align:start;}
:root[data-theme="dark"] .account-button{background:#453344!important;border:1px solid #74556a!important;color:#f8ecf1!important;}
:root[data-theme="dark"] .account-name,:root[data-theme="dark"] .exit-icon{color:#f8dce8!important;}
:root[data-theme="dark"] .admin-popular-info strong,:root[data-theme="dark"] .admin-perfume-name strong{color:#f9e6ed!important;}
:root[data-theme="dark"] .admin-popular-info span,:root[data-theme="dark"] .admin-popular-emails,:root[data-theme="dark"] .admin-perfume-name span,:root[data-theme="dark"] .admin-perfume-name small,:root[data-theme="dark"] .admin-popular-count,:root[data-theme="dark"] .admin-show-all{color:#e9c3d1!important;}
:root[data-theme="dark"] .genre-option,:root[data-theme="dark"] .genre-reset{background:#4c3544!important;color:#fff1f6!important;border-color:#8b6477!important;}
:root[data-theme="dark"] .genre-option.active{background:#7d4a65!important;color:#fff!important;}
@media(max-width:700px){
  .category-rail .category-tab{flex-basis:106px!important;}
  .site-header{flex-wrap:wrap!important;align-items:center!important;row-gap:4px!important;}
  .identity{flex:1 1 155px;min-width:0;}
  .site-header .header-right{flex:1 1 auto;min-width:0;flex-wrap:wrap;display:flex;justify-content:flex-end;align-items:center;gap:6px;}
  .site-header .site-nav{order:2;flex:1 1 100%;justify-content:flex-end;}
  .site-header .site-nav .nav-catalogue{display:none!important;}
  .site-header .site-nav .my-interests{font-size:12px!important;padding:5px 11px!important;border:1px solid #c997aa!important;width:auto!important;height:auto!important;min-height:30px!important;line-height:1.4;white-space:nowrap;}
  .theme-button{height:35px;width:36px;min-width:36px;padding:0!important;font-size:0!important;display:grid;place-items:center;}
  .theme-button::first-letter{font-size:19px!important;}
  .site-header .admin-trigger{width:35px;height:35px;padding:0!important;font-size:0!important;display:grid;place-items:center;}
  .site-header .admin-trigger::before{content:'⚙';font-size:19px!important;line-height:1;color:inherit;}
  .site-header .account-name,.site-header .exit-icon{display:none;}
  .site-header .account-button{width:35px;height:35px;min-width:35px;justify-content:center;padding:2px!important;}
  .site-header .account-avatar{width:27px;height:27px;}
}
@media(max-width:385px){.category-rail .category-tab{flex-basis:103px!important;}}
/* Réparation de l'en-tête étroit : deux rangées nettes, sans icône vide ni chevauchement. */
@media(max-width:700px){
  .site-header{display:flex!important;flex-wrap:wrap!important;justify-content:space-between!important;gap:8px!important;padding:9px 3% 11px!important;}
  .site-header .identity{flex:1 1 100%!important;min-width:0!important;max-width:100%!important;}
  .site-header .header-right{display:flex!important;flex:1 1 100%!important;min-width:0!important;max-width:100%!important;flex-wrap:nowrap!important;justify-content:space-between!important;align-items:center!important;gap:7px!important;margin-left:0!important;}
  .site-header .site-nav{flex:1 1 auto!important;order:0!important;min-width:0!important;display:flex!important;justify-content:flex-start!important;}
  .site-header .site-nav .my-interests{flex-shrink:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important;font-size:12px!important;width:auto!important;height:35px!important;max-width:none!important;line-height:1!important;padding:6px 10px!important;}
  .site-header #themeButton{font-size:0!important;flex:0 0 35px!important;width:35px!important;min-width:35px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;}
  .site-header #themeButton::before{content:'☾';font-size:21px!important;line-height:1;}
  :root[data-theme="dark"] .site-header #themeButton::before{content:'☀';}
  .site-header #themeButton::first-letter{font-size:0!important;}
  .site-header #adminButton{flex:0 0 35px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;}
  .site-header #adminButton::after{content:none!important;display:none!important;}
  .site-header #accountButton{flex:0 0 35px!important;}
}
@media(max-width:700px){.site-header .site-nav .my-interests::before{content:none!important;display:none!important;}}
