/* OVC POS — thème Pharmacie */
:root{
  --brand-gold:#0EA5E9;
  --brand-terracotta:#075985;
  --brand-dark:#0B2F4A;
  --sidebar-bg:#0B2F4A;
  --order-bg:#081B2B;
}
body.ovc-login-mode .login-layer,
.login-layer{
  background:
    linear-gradient(90deg, rgba(7,27,73,.88) 0%, rgba(7,27,73,.60) 42%, rgba(255,255,255,.10) 100%),
    url('login-bg-pharmacie.jpg') center/cover no-repeat !important;
}
body.ovc-login-mode .auth-card{
  background:rgba(255,255,255,.94) !important;
  border:1px solid rgba(215,167,66,.35) !important;
  box-shadow:0 28px 80px rgba(7,27,73,.35) !important;
}
.nav-item[data-screen="tables"],
#screen-tables,
#tableModal,
.service-card,
.kitchen-btn,
#ovcTableServiceSummary,
.right-widgets .small-card.ovc-hide-tables-widget{display:none !important;}
.order-panel header h2::before{content:'🛒 ';}
.order-panel .checkout-btn{background:linear-gradient(135deg,var(--brand-gold),#E7BE60) !important;color:#071B49 !important;}
.product-card .product-visual img,
.category-visual img,
.thumb img{object-fit:contain !important; padding:8px !important; box-sizing:border-box !important;}
.tab-btn.active,
.service-btn.active{background:linear-gradient(135deg,var(--brand-dark),#132B5A) !important;color:#fff !important;}
.report-card h2,
.page-head h1{letter-spacing:-.02em;}


/* v2 pharmacie — force exact login background */
.login-layer::before,
body.ovc-login-mode .login-layer:not(.hidden)::before{
  background-image:
    linear-gradient(135deg, rgba(7,27,73,.74), rgba(0,0,0,.58)),
    radial-gradient(circle at 30% 22%, rgba(215,167,66,.18), transparent 34%),
    url('login-bg-pharmacie.jpg') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
body.ovc-login-mode .login-layer,
.login-layer{
  background:#071B49 !important;
}

/* v3 pharmacie — panier et tabs actifs liés au thème choisi */
.order-panel {
  background:
    radial-gradient(
      circle at 45% 10%,
      color-mix(in srgb, var(--brand-terracotta) 42%, var(--order-bg) 58%) 0%,
      var(--order-bg) 54%,
      color-mix(in srgb, var(--order-bg) 82%, #000 18%) 100%
    ) !important;
  color: #FFF9EF !important;
  padding: 26px 24px !important;
  border-radius: 24px 0 0 24px !important;
  margin: 18px 18px 18px 0 !important;
  box-shadow: -18px 0 45px color-mix(in srgb, var(--brand-terracotta) 18%, transparent) !important;
  overflow: auto !important;
}

#categoryTabs .tab-btn.active,
.tabs .tab-btn.active,
.variant-tabs .tab-btn.active,
#variantTabs .tab-btn.active,
.catalog-panel .tab-btn.active,
.category-tab.active,
.variant-chip.active,
button[data-category].active,
button[data-variant].active {
  background: linear-gradient(
    135deg,
    var(--brand-gold),
    color-mix(in srgb, var(--brand-gold) 62%, var(--brand-terracotta) 38%)
  ) !important;
  color: var(--brand-dark) !important;
  border-color: color-mix(in srgb, var(--brand-gold) 70%, transparent) !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-gold) 24%, transparent) !important;
}

#categoryTabs .tab-btn.active *,
.tabs .tab-btn.active *,
.variant-tabs .tab-btn.active *,
#variantTabs .tab-btn.active *,
.catalog-panel .tab-btn.active *,
.category-tab.active *,
.variant-chip.active * {
  color: inherit !important;
  stroke: currentColor !important;
}

/* v13 — mode administration globale : aucune vente en cours */
body.ovc-admin-global #app,
#app.no-pos-selected{
  grid-template-columns: 260px minmax(760px, 1fr) !important;
}
body.ovc-admin-global .order-panel,
#app.no-pos-selected .order-panel{
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
#posDropdown .drop-item.active,
#posDropdown .pos-all-btn.active{
  background: color-mix(in srgb, var(--brand-gold) 18%, #fff 82%) !important;
  border-color: color-mix(in srgb, var(--brand-gold) 55%, transparent) !important;
}


/* v14 — filtre point de vente page Ventes + label stable */
.ovc-cmd-filters{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:10px !important;
  align-items:center !important;
  margin:12px 0 14px !important;
}
.ovc-cmd-filters select,
.ovc-cmd-filters button{
  min-height:38px !important;
}
#selectedPosName{
  white-space:nowrap !important;
}

/* v20 — restauration du style catalogue caisse en grille */
#catalogArea.catalog-grid,
#catalogArea.product-grid,
.catalog-panel #catalogArea.catalog-grid,
.catalog-panel #catalogArea.product-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
  min-height: 420px !important;
}

#catalogArea.catalog-grid .product-card,
#catalogArea.product-grid .product-card,
#catalogArea .product-card.ovc-unit-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(255,255,255,.76) !important;
  border: 1px solid var(--line) !important;
  border-radius: 20px !important;
  padding: 14px !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden !important;
}

#catalogArea.catalog-grid .product-visual,
#catalogArea.product-grid .product-visual,
#catalogArea .product-card.ovc-unit-card .product-visual {
  width: 100% !important;
  height: 92px !important;
  max-height: 92px !important;
  border-radius: 14px !important;
  background: #F0E6DA !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  margin-bottom: 10px !important;
}

#catalogArea.catalog-grid .product-visual img,
#catalogArea.product-grid .product-visual img,
#catalogArea .product-card.ovc-unit-card .product-visual img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}

#catalogArea.catalog-grid .product-card strong,
#catalogArea.product-grid .product-card strong,
#catalogArea .product-card.ovc-unit-card strong {
  font-size: 14px !important;
  line-height: 1.18 !important;
  margin: 0 0 5px !important;
}

#catalogArea.catalog-grid .product-card p,
#catalogArea.product-grid .product-card p,
#catalogArea .product-card.ovc-unit-card p {
  margin: 3px 0 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

#catalogArea.catalog-grid .ovc-unit-add,
#catalogArea.product-grid .ovc-unit-add,
#catalogArea .product-card.ovc-unit-card .ovc-unit-add {
  align-self: flex-start !important;
  margin-top: 8px !important;
  background: #FFF4E3 !important;
  color: #6D4A20 !important;
  border: 1px solid #E9D2AC !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-weight: 900 !important;
  font-size: 12px !important;
  text-decoration: none !important;
}

/* v21 — page caisse : 3 produits par ligne + espace catégorie / variation */
#catalogArea.catalog-grid,
#catalogArea.product-grid,
.catalog-panel #catalogArea.catalog-grid,
.catalog-panel #catalogArea.product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#catalogArea .product-card p .badge.tiny,
#catalogArea .product-card p .badge,
#catalogArea .product-card .badge.tiny {
  margin-left: 8px !important;
}

@media (max-width: 1200px) {
  #catalogArea.catalog-grid,
  #catalogArea.product-grid,
  .catalog-panel #catalogArea.catalog-grid,
  .catalog-panel #catalogArea.product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767px) {
  #catalogArea.catalog-grid,
  #catalogArea.product-grid,
  .catalog-panel #catalogArea.catalog-grid,
  .catalog-panel #catalogArea.product-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v22 — style image produit demandé */
#catalogArea.catalog-grid .product-visual,
#catalogArea.product-grid .product-visual,
#catalogArea .product-card.ovc-unit-card .product-visual {
  width: 100% !important;
  height: 200px !important;
  max-height: 200px !important;
  border-radius: 14px !important;
  background: #F0E6DA !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  margin-bottom: 10px !important;
}

#catalogArea.catalog-grid .product-visual img,
#catalogArea.product-grid .product-visual img,
#catalogArea .product-card.ovc-unit-card .product-visual img {
  width: 100% !important;
  height: 200px !important;
  object-fit: contain !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}


/* v24 — variation en badge rouge comme avant */
#catalogArea .product-card .ovc-card-meta .ovc-card-variant,
#catalogArea .product-card .badge.tiny.ovc-card-variant,
#catalogArea .product-card .product-variant-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  background: rgba(220, 38, 38, .10) !important;
  border: 1px solid rgba(220, 38, 38, .22) !important;
  color: #B91C1C !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  margin-left: 8px !important;
}


/* OVC Pharmacie — thème médical + background login */
body.ovc-login-mode .login-layer,
.login-layer{background:#0B2F4A !important;}
.login-layer::before,
body.ovc-login-mode .login-layer:not(.hidden)::before{
  background-image:
    linear-gradient(135deg, rgba(6,53,82,.78), rgba(3,22,38,.54)),
    radial-gradient(circle at 18% 18%, rgba(14,165,233,.24), transparent 36%),
    url('login-bg-pharmacie.jpg') !important;
  background-size:cover !important;
  background-position:center center !important;
  background-repeat:no-repeat !important;
}
body.ovc-login-mode .auth-card{border-color:rgba(14,165,233,.32) !important;}
.order-panel .checkout-btn{background:linear-gradient(135deg,var(--brand-gold),#38BDF8) !important;color:#062033 !important;}
#categoryTabs .tab-btn.active,
.tabs .tab-btn.active,
.variant-tabs .tab-btn.active,
#variantTabs .tab-btn.active,
.catalog-panel .tab-btn.active,
.category-tab.active,
.variant-chip.active,
button[data-category].active,
button[data-variant].active{
  background:linear-gradient(135deg,var(--brand-gold),#38BDF8) !important;
  color:#062033 !important;
}
#catalogArea.catalog-grid,
#catalogArea.product-grid,
.catalog-panel #catalogArea.catalog-grid,
.catalog-panel #catalogArea.product-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
@media (max-width:1200px){#catalogArea.catalog-grid,#catalogArea.product-grid,.catalog-panel #catalogArea.catalog-grid,.catalog-panel #catalogArea.product-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}}
@media (max-width:767px){#catalogArea.catalog-grid,#catalogArea.product-grid,.catalog-panel #catalogArea.catalog-grid,.catalog-panel #catalogArea.product-grid{grid-template-columns:1fr !important;}}
#catalogArea .product-card .ovc-card-variant{margin-left:8px !important;background:#FEE2E2 !important;color:#DC2626 !important;border-color:rgba(220,38,38,.18) !important;}


/* Pharmacie v2 — icônes catégories blanches sur fond transparent */
.category-visual,
.category-card .category-visual,
.category-thumb,
#categoryTabs .tab-btn span[data-icon] {
  background: transparent !important;
}
.category-visual img,
.category-card .category-visual img,
.category-thumb img {
  object-fit: contain !important;
  padding: 10px !important;
  background: transparent !important;
  filter: none !important;
}
.category-card .category-visual,
.category-visual {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-terracotta)) !important;
}
#categoryTabs .tab-btn span[data-icon],
.tabs .tab-btn span[data-icon] {
  color: #fff !important;
  stroke: currentColor !important;
}
#catalogArea .product-card .product-visual img,
#catalogArea .product-card.ovc-unit-card .product-visual img {
  object-fit: contain !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}
