@import url("theme.css");

/*
 * Base structure
 */

/* Move down content because we have a fixed navbar that is 50px tall */
body {
  padding-top: var(--navbar-height);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}


.topbar_btn:hover,
.filter_btn:hover,
.sidebar-action:hover{
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.topbar_btn:focus,
.topbar_btn:active,
.topbar_btn:active:focus,
.filter_btn:focus,
.filter_btn:active,
.filter_btn:active:focus,
.sidebar-action:focus,
.sidebar-action:active,
.sidebar-action:active:focus{
  transform: translateY(-2px) !important;
}


/*
 * Dark-theme overrides for Bootstrap elements
 */

h1, h2, h3, h4, h5, h6,
label,
.page-header h3 {
  color: var(--color-text-primary);
}

a {
  color: var(--color-text-secondary);
}

a:hover, a:focus {
  color: var(--color-text-primary);
}

.form-control {
  background-color: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-subtle);
}

.form-control:focus {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-accent-blue);
}

.form-control::placeholder {
  color: var(--color-text-placeholder);
}

.btn {
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-width: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
              color var(--transition-fast), box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.btn-default {
  background-color: var(--color-bg-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-subtle);
}

.btn-default:hover,
.btn-default:focus {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-text-placeholder);
}

.btn-primary {
  background-color: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
  color: var(--color-white);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #3a62e0;
  border-color: #3a62e0;
  color: var(--color-white);
}

.btn-warning {
  background-color: transparent;
  border-color: var(--color-accent-gold);
  color: var(--color-accent-gold);
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: rgba(243,200,75,0.16);
  border-color: var(--color-accent-gold);
  color: var(--color-accent-gold-light);
}

.btn-danger {
  background-color: var(--color-accent-red);
  border-color: var(--color-accent-red);
  color: var(--color-white);
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #d4443e;
  border-color: #d4443e;
  color: var(--color-white);
}

.page-header {
  border-bottom-color: var(--color-border-subtle);
}

.container {
  color: var(--color-text-primary);
}

/*
 * Global add-ons
 */

.sub-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.ui-autocomplete{
  z-index: 2000 !important;
}

/*
 * Top navigation
 * Hide default border to remove 1px line.
 */
.navbar-fixed-top {
  border: 0;
  background-color: var(--color-bg);
}

.topbar-logo-wrap{
  text-align:center;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

.topbar-side-logo{
  height:128px;
  width:auto;
  max-width:100%;
}

body.has-index-topbar .topbar-side-logo{
  height:128px;
}

.topbar-search-filters{
  padding: 2px 0 0 0;
}

.topbar-search-filters > .col-sm-10{
  padding-left:0;
}

.topbar-menu-row{
  margin-bottom:4px;
}

.topbar-inline-collapse{
  border-top:0;
  box-shadow:none;
  padding-left:0;
  padding-right:0;
}

.topbar-inline-collapse .navbar-nav{
  margin:0;
}

.topbar-inline-collapse .navbar-form{
  margin-top:4px;
  margin-bottom:4px;
}

.topbar-search-filters .form-control,
.topbar-search-filters .filter_btn{
  margin-bottom: 6px;
  height:28px;
  border-radius:2px;
  border-color: var(--color-border-input);
}

.topbar-search-filters .form-control{
  font-size:12px;
}

#name_search_input,
#brand_search_input,
#category_search_input,
#reference_search_input{
  font-size:14px;
}

#name_search_input::placeholder,
#brand_search_input::placeholder,
#category_search_input::placeholder,
#reference_search_input::placeholder{
  color: var(--color-text-placeholder);
  opacity:1;
  font-size:16px !important;
}

#name_search_input::-webkit-input-placeholder,
#brand_search_input::-webkit-input-placeholder,
#category_search_input::-webkit-input-placeholder,
#reference_search_input::-webkit-input-placeholder{
  color: var(--color-text-placeholder);
  font-size:16px;
}

#name_search_input::-moz-placeholder,
#brand_search_input::-moz-placeholder,
#category_search_input::-moz-placeholder,
#reference_search_input::-moz-placeholder{
  color: var(--color-text-placeholder);
  font-size:16px;
  opacity:1;
}

.topbar-row-icon{
  color: var(--color-text-primary);
  text-align:center;
  padding-top:6px;
  font-size:14px;
}

body.has-index-topbar{
  padding-top: var(--index-topbar-height);
}

.navbar-inverse .navbar-nav>li>a {
  color: var(--color-text-secondary);
  font-size:12px !important;
  padding-top:14px;
  padding-bottom:14px;
}

.navbar-nav>.active>a{
  color: var(--color-accent-gold) !important;
}

.navbar-inverse .navbar-nav>.active>a,
.navbar-inverse .navbar-nav>.active>a:hover,
.navbar-inverse .navbar-nav>.active>a:focus{
  background-color: transparent !important;
  box-shadow: none;
}

/* ── Top-right controls (theme toggle + auth menu) ──
   Same pattern as elen / artsiderz: a fixed pill in the top-right. Stays
   above the Chakra header by z-index. When the full React header is on
   the page, its own right-side controls are hidden so there's no duplicate. */
.gk-topright { position: fixed; top: 10px; right: 12px; z-index: 1040; display: flex; align-items: center; gap: 8px; }
.gk-topright .theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--color-border); background: transparent;
  color: var(--color-text-primary); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.gk-topright .theme-toggle:hover { background: var(--color-bg-surface); }
.gk-topright .theme-toggle .icon-moon { display: block; }
.gk-topright .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .gk-topright .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .gk-topright .theme-toggle .icon-sun  { display: block; }

/* Auth pill font sizes — overrides gateka-core's shared header_auth.css
   which is served cross-origin from gateka.fr (no cache-buster there, so
   old aggressive-small values may be cached in the browser). Keeping the
   overrides in stealth's own stylesheet guarantees the visible size. */
.gk-topright .header-auth { font-size: 0.95rem; }
.gk-topright .header-auth-name { font-size: 0.9rem; }
.gk-topright .header-auth-avatar { font-size: 0.75rem; }
.header-auth-menu-name { font-size: 0.95rem; }
.header-auth-menu-email { font-size: 0.82rem; }
.header-auth-menu-item { font-size: 0.9rem; }

/* Auth pill styling lives in gateka-core's shared
   /gateka/static/header_auth.css (included from base.html). We only
   alias stealth's token names onto the `--gk-*` vars it expects. */
:root {
  --gk-accent:       var(--color-accent-blue, #4c78ff);
  --gk-accent-hover: #3e66e0;
  --gk-accent-glow:  rgba(76, 120, 255, .35);
  --gk-text:         var(--color-text-primary);
  --gk-text-muted:   var(--color-text-muted);
  --gk-bg:           var(--color-bg-surface);
  --gk-bg-surface:   var(--color-bg);
  --gk-border:       var(--color-border);
  /* gateka-core's connect.css uses --gk-primary and --accent for the
     features button and a few other shared controls. Alias them to
     stealth's accent so the shared button themes correctly. */
  --gk-primary:      var(--color-accent-blue, #4c78ff);
  --accent:          var(--color-accent-blue, #4c78ff);
  --accent-hover:    #3e66e0;
  --accent-glow:     rgba(76, 120, 255, .35);
  --radius:          10px;
  /* Aliases for gateka-core's shared partials (features.css, panels) that
     read --surface / --text* / --bg2 / --bg3 / --border. Without these the
     rights matrix and modal stay light-on-dark in dark mode. */
  --surface:         var(--color-bg-surface);
  --text:            var(--color-text-primary);
  --text2:           var(--color-text-primary);
  --text3:           var(--color-text-muted);
  --bg:              var(--color-bg);
  --bg2:             var(--color-bg-surface);
  --bg3:             var(--color-bg);
  --border:          var(--color-border);
}

/* Kill the Chakra header's duplicate right-side controls (avatar pill,
   theme button, logout) — the elen-style .gk-topright already provides
   them. Keep the nav links + asset-class row visible. */
.header-shell .header-menu { display: none !important; }

/* Make Plotly chart text selectable (axis labels, titles, annotations). */
.js-plotly-plot, .js-plotly-plot .plotly, .js-plotly-plot .svg-container,
.js-plotly-plot text { user-select: text !important; -webkit-user-select: text !important; }

/* ── Header (unified Gateka navbar) ── */
.header-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: transparent;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  padding: 0 24px;
  transition: background 0.3s, border-color 0.3s;
}

.header-shell .header-row {
  display: flex;
  align-items: center;
  height: 48px;
  gap: 24px;
}

.header-shell .header-ac-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0 6px;
  overflow-x: auto;
  justify-content: center;
}

.header-ac-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  transition: all .15s;
  white-space: nowrap;
}
.header-ac-btn:hover {
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.header-ac-btn.active {
  background: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
  color: #fff;
}

.header-shell .header-brand {
  display: flex;
  align-items: center;
}

.header-shell .header-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-shell .header-brand-text {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-shell .header-center {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.header-shell .header-nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.header-shell .header-nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(128,128,128,0.1);
}

.header-shell .header-nav-link.active {
  color: var(--color-text-primary);
  background: rgba(128,128,128,0.15);
}

.header-shell .header-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-shell .header-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.header-shell .header-profile-link:hover {
  color: var(--color-text-primary);
  background: rgba(128,128,128,0.1);
}

.header-shell .header-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.header-shell .header-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-elevated);
}

.header-shell .header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.header-shell .header-btn:hover {
  color: var(--color-text-primary);
  background: rgba(128,128,128,0.1);
  border-color: var(--color-text-muted);
}

.header-shell .header-btn--logout:hover {
  color: var(--color-accent-red);
  border-color: var(--color-accent-red);
}

@media (max-width: 700px) {
  .header-shell { padding: 0 12px; }
  .header-shell .header-brand-text { display: none; }
  .header-shell .header-nav-link { font-size: 12px; padding: 6px 10px; }
  .header-shell .header-profile-link span:last-child { display: none; }
}

/*
 * Sidebar
 */

/* Hide for mobile, show later */
.sidebar {
  display: none;
}
@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    top: 78px;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
    background-color: var(--color-sidebar-bg);
    border-right: 1px solid var(--color-sidebar-border);
  }

  .has-index-topbar .sidebar {
    top: 170px;
  }
}

/* Sidebar navigation */
.nav-sidebar {
  margin-right: -21px; /* 20px padding + 1px border */
  margin-bottom: 20px;
  margin-left: -20px;
}
.nav-sidebar > li > a {
  padding-right: 20px;
  padding-left: 20px;
  padding: 3px 17px;
  font-size:12px !important;
}
.nav-sidebar > .active > a,
.nav-sidebar > .active > a:hover,
.nav-sidebar > .active > a:focus {
  color: #fff;
  background-color: var(--color-accent-link);
}

.nav a{
  font-size:13px !important;
}

/*
 * Main content
 */

.main {
  padding: 20px;
}

body.has-index-topbar .main{
  background-color: var(--color-bg);
}

@media (min-width: 768px) {
  .main {
    padding-right: 40px;
    padding-left: 40px;
  }
}
.main .page-header {
  margin-top: 0;
}

@-moz-document url-prefix() {
  fieldset { display: table-cell; }
}

.table>tbody>tr>td{
  vertical-align: middle !important;
}

#table_products tbody tr.product_row td{
  transition: background-color .15s ease;
}

#table_products tbody tr.product_row:hover td{
  background-color:transparent;
}

#table_products tbody tr.product_row td:nth-child(2) img{
  transition: transform .18s ease;
  transform-origin: center center;
}

#table_products tbody tr.product_row td:nth-child(2) img:hover{
  transform: scale(2);
}

#table_products tbody tr.product_row td:nth-child(3){
  transition: transform .18s ease;
}

#table_products tbody tr.product_row td:nth-child(2):hover + td{
  transform: translateX(18px);
}

#active_order_topbar_txt{
	color: var(--color-text-secondary);
}

.sidebar-actions{
  margin: -20px -20px 14px -20px;
}

.sidebar-action{
  width:100%;
  background:transparent;
  border:0;
  color: var(--color-text-muted);
  font-size:14px;
  font-weight:600;
  text-align:center;
  padding:12px 10px;
}

.sidebar-action-new{
  color: var(--color-accent-red);
  border-top:1px solid var(--color-sidebar-border);
  border-bottom:1px solid var(--color-sidebar-border);
  margin-bottom:16px;
}

.sidebar-action-promo{
  color: var(--color-accent-orange);
  border-top:1px solid var(--color-sidebar-border);
  border-bottom:1px solid var(--color-sidebar-border);
  margin-bottom:16px;
}

.sidebar-action-history{
  color: var(--color-accent-gold);
  border-top:1px solid var(--color-sidebar-border);
  border-bottom:1px solid var(--color-sidebar-border);
  margin-bottom:16px;
}

.sidebar-action-cart{
  color: var(--color-sidebar-cart);
  border-top:1px solid var(--color-sidebar-border);
  border-bottom:1px solid var(--color-sidebar-border);
}

.active-order-sidebar{
  color: var(--color-text-secondary) !important;
  font-size:12px;
  line-height:1.45;
  background-color:transparent;
  border:0;
  text-align:center;
  padding:6px 6px 8px 6px;
  margin:0 -20px 8px -20px;
}

.active-order-sidebar .topbar_fixed_txt{
  color: var(--color-text-primary) !important;
  font-weight:700;
}

.active-order-sidebar .sidebar-order-row{
  margin-bottom:2px;
  font-weight:700;
}

.sidebar-validate-wrap{
  text-align:center;
  margin:0 0 20px 0;
}

.sidebar-validate-btn{
  min-width:106px;
  padding:6px 12px;
  font-size:12px;
  border-radius:3px;
}

#side_category,
#side_brand{
  margin:0 -20px 10px -20px;
}

#side_category > li.active > a,
#side_brand > li.active > a{
  background:transparent !important;
  color: var(--color-text-muted) !important;
  text-align:center;
  font-size:15px !important;
  font-weight:500;
  letter-spacing:0.4px;
  border-top:1px solid var(--color-sidebar-border);
  border-bottom:1px solid var(--color-sidebar-border);
  padding:10px 8px !important;
}

#side_category .sidebar_li a,
#side_brand .sidebar_li a{
  padding:3px 18px !important;
  font-size:12px !important;
  color: var(--color-text-muted) !important;
  border:0;
}

#side_category .sidebar_li a .glyphicon,
#side_brand .sidebar_li a .glyphicon{
  color:#3f8fd8;
}

#side_category .sidebar_sub_li a{
  padding:2px 0 2px 36px !important;
  font-size:11px !important;
  color: var(--color-text-placeholder) !important;
}

#side_category .sidebar_li a:hover,
#side_brand .sidebar_li a:hover,
#side_category .sidebar_sub_li a:hover{
  background:transparent !important;
  color: var(--color-text-primary) !important;
}

.sidebar_li a{
  padding:1px 17px !important;
  font-size:12px;
  cursor: pointer;
}

.sidebar_sub_li a{
  padding:1px 0px 1px 35px !important;
  font-size:11px;
  color: var(--color-text-secondary) !important;
  cursor: pointer;
}

#table_products, #table_order, #table_order_details{
  font-size:11px;
}

#table_products tbody tr.product_row td{
  transition: background-color .15s ease, transform .15s ease;
}

#table_products tbody tr.product_row td > *{
  transition: transform .15s ease;
}

#table_products tbody tr.product_row:hover td{
  background-color:transparent;
}

#table_products tbody tr.product_row:hover td > *{
  transform: scale(1.03);
}

#table_order td.order-money-cell{
  text-align:right;
  white-space:nowrap;
}

#container_products{
  background-color: var(--color-bg-surface);
}

#table_order thead th.sortable-header{
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

#table_order thead th.sortable-header .sort-indicator{
  margin-left:4px;
  font-size:14px;
  font-weight:800;
  line-height:1;
  color: var(--color-text-placeholder);
}

#table_order thead th.sortable-header.sorted-asc .sort-indicator,
#table_order thead th.sortable-header.sorted-desc .sort-indicator{
  color:#5f6b78;
}

#table_products thead th.product-sortable-header{
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

#table_products thead th.product-sortable-header .sort-indicator{
  margin-left:4px;
  font-size:14px;
  font-weight:800;
  line-height:1;
  color: var(--color-text-placeholder);
}

#table_products thead th.product-sortable-header.sorted-asc .sort-indicator,
#table_products thead th.product-sortable-header.sorted-desc .sort-indicator{
  color:#5f6b78;
}

#table_products thead th[data-col-index="4"]{
  text-align:center;
}

#table_products tbody td.qty-dispo-cell{
  padding-left:6px;
  padding-right:6px;
}

#table_products tbody td.product-photo-cell{
  text-align:center;
  vertical-align:middle;
}

#table_products .product-photo-wrap{
  height:80px;
  display:flex;
  align-items:center;
  justify-content:center;
}

#table_products .product-photo-img{
  display:block;
  max-height:80px;
  max-width:100%;
  width:auto;
  object-fit:contain;
  margin:0 auto;
}

#table_products tbody td.qty-dispo-cell .qty-dispo-wrap{
  width:100%;
  justify-content:center;
}

#container_address_livraison, #container_address_facturation, #container_mode_transport{
  font-size:11px;
}

#cart_option_title_shipping{
  font-size:11px;
  font-weight:bold;
}

#cart_option_title_total{
  font-size:11px;
  text-align:center;
  font-weight:bold;
}

#address_facturation{
  margin-top:10px;
  margin-bottom:10px;
}

#cart_container{
  margin-top:50px;
}

#cart_head_row{
  margin-top:30px;
}

#cart_title_row{
  font-size:12px;
}

#cart_total_ht, #cart_total_tva, #cart_total_ttc, #cart_total_weight{
  margin-bottom:20px;
  text-align:center;
  font-size:11px;
}

.topbar_fixed_txt{
  color: var(--color-accent-orange);
}

.breadcrumb{
  background-color: var(--color-breadcrumb-bg);
  border-radius: 0px;
  text-align:right;
  font-size:13px;
  padding:4px 15px;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width:100%;
  z-index:1000;
}

.filter_btn, .topbar_btn{
  width:150px;
}

.input_qty{
  width: 50px;
}

/* popover */
.popover-content{
  text-align:center;
}

.popover-title{
  font-size:10px;
  text-align:center;
}

.promo_price{
  color:red;
  font-weight:bold;
}

.removed td{
  background-color: var(--color-bg-elevated) !important;
}
