/* ============================================
   xSmart.cz — Header Styles (Mironet.cz clone)
   2-row header: main bar + nav bar
   ============================================ */

/* ═══════════════════════════════════════════
   CSS VARIABLES — Mironet palette
   ═══════════════════════════════════════════ */
:root {
  --m-blue: #1a365d;
  --m-blue-hover: #132a4a;
  --m-blue-light: #f0f4f8;
  --m-blue-lighter: rgba(37,99,235,0.06);
  --m-blue-accent: #2563eb;
  --m-white: #ffffff;
  --m-text: #000000;
  --m-text-secondary: #666666;
  --m-text-light: #999999;
  --m-border: #e2e8f0;
  --m-border-light: #edf2f7;
  --m-red: #dc2626;
  --m-green: #059669;
  --m-font: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --m-container: 1320px;
}


/* ═══════════════════════════════════════════
   ROW 1: MAIN BAR (logo + search + actions)
   Height ~60px, white bg, border-bottom
   ═══════════════════════════════════════════ */
.xh-main {
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  border-bottom: none;
  position: relative;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.xh-main__inner {
  max-width: var(--m-container);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

/* Search centered between logo and actions */
.xh-main__search {
  margin: 0 auto;
}

/* --- Logo --- */
.xh-main__logo {
  flex-shrink: 0;
}

.xh-logo-h1 {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.xh-logo {
  display: flex;
  align-items: baseline;
  text-decoration: none !important;
  gap: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.xh-logo:hover {
  opacity: 0.8;
  text-decoration: none !important;
}

.xh-logo__x {
  font-size: 1.75rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.03em;
  font-family: var(--m-font);
}

.xh-logo__smart {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1a365d;
  letter-spacing: -0.03em;
  font-family: var(--m-font);
}

.xh-logo__dot {
  font-size: 1.75rem;
  font-weight: 800;
  color: #2563eb;
  font-family: var(--m-font);
}

.xh-logo--sm .xh-logo__x,
.xh-logo--sm .xh-logo__smart,
.xh-logo--sm .xh-logo__dot {
  font-size: 1.35rem;
}


/* --- Search bar --- */
.xh-main__search {
  flex: 1;
  max-width: 520px;
  min-width: 200px;
}

#header .xh-main__search .search-widgets,
#header .xh-main__search #search_widget {
  width: 100%;
  overflow: hidden !important;
}

#header .xh-main__search form {
  position: relative;
  display: flex;
  height: 40px;
  border: 1px solid var(--m-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--m-white);
}

#header .xh-main__search form:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

#header .xh-main__search form:focus-within {
  border-color: var(--m-blue);
}

#header .xh-main__search input[type="text"] {
  flex: 1;
  border: none !important;
  outline: none !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  font-family: var(--m-font) !important;
  color: var(--m-text) !important;
  background: transparent !important;
  height: 100% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#header .xh-main__search input[type="text"]::placeholder {
  color: var(--m-text-light);
  font-weight: 400;
}

/* Search icon -> "Hledat" blue button */
i.material-icons.search,
#header i.material-icons.search,
.xh-main__search i.material-icons.search {
  background: #2563eb !important;
  color: transparent !important;
  border: none !important;
  padding: 0 20px !important;
  cursor: pointer !important;
  border-radius: 0 8px 8px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 80px;
  transition: background 0.15s !important;
  height: 100%;
  position: relative !important;
  right: auto !important;
  top: auto !important;
  left: auto !important;
  font-size: 0 !important;
  line-height: 40px !important;
  order: 3;
  flex-shrink: 0;
  font-family: var(--m-font) !important;
  -webkit-font-smoothing: auto;
}

i.material-icons.search::after,
#header i.material-icons.search::after,
.xh-main__search i.material-icons.search::after {
  content: 'Hledat' !important;
  font-family: var(--m-font) !important;
  font-size: 14px !important;
  font-weight: 600;
  color: #fff !important;
  letter-spacing: 0.01em;
}

i.material-icons.search:hover,
#header i.material-icons.search:hover,
.xh-main__search i.material-icons.search:hover {
  background: #1d4ed8 !important;
}

/* Clear icon */
#header i.material-icons.clear,
.xh-main__search i.material-icons.clear {
  position: absolute !important;
  right: 85px !important;
  top: 50% !important;
  transform: translateY(-50%);
  font-size: 18px !important;
  color: var(--m-text-light) !important;
  cursor: pointer;
  z-index: 2;
  font-family: 'Material Icons' !important;
}

/* Hide autocomplete junk */
#header .xh-main__search .ui-helper-hidden-accessible,
#header .xh-main__search .ui-slider {
  display: none !important;
}


/* --- Actions (user, wishlist, cart) --- */
.xh-main__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.xh-main__actions > div {
  display: flex;
  align-items: center;
}

/* Hide unnecessary PS elements from displayNav1 */
#header .xh-main__actions #_desktop_contact_link,
#header .xh-main__actions .language-selector-wrapper,
#header .xh-main__actions #_desktop_language_selector,
#header .xh-main__actions #_desktop_currency_selector,
#header .xh-main__actions .language-selector,
#header .xh-main__actions .currency-selector {
  display: none !important;
}

/* Action links — mironet style: icon + text, vertical stack */
#header .xh-main__actions a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--m-text) !important;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--m-font);
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}

#header .xh-main__actions a:hover {
  background: rgba(37,99,235,0.08);
  color: #2563eb !important;
}

/* Material Icons in header */
#header .xh-main__actions .material-icons {
  font-family: 'Material Icons' !important;
  font-size: 22px !important;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  vertical-align: middle;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  color: var(--m-text-secondary);
}

#header .xh-main__actions a:hover .material-icons {
  color: var(--m-blue);
}

/* Cart styling */
#header .xh-main__actions .blockcart {
  position: relative;
}

#header .xh-main__actions .blockcart .header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--m-text);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--m-font);
}

#header .xh-main__actions .blockcart .header:hover {
  background: var(--m-blue-lighter);
  color: var(--m-blue);
}

#header .xh-main__actions .blockcart .material-icons.shopping-cart {
  font-size: 22px !important;
  color: var(--m-text-secondary);
}

#header .xh-main__actions .blockcart .header:hover .material-icons.shopping-cart {
  color: var(--m-blue);
}

/* Cart count badge */
#header .xh-main__actions .cart-products-count {
  background: var(--m-red) !important;
  color: var(--m-white) !important;
  font-size: 10px !important;
  font-weight: 700;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  margin-left: -6px;
  margin-top: -10px;
  line-height: 1;
}

/* User info icon */
#header .xh-main__actions .user-info .material-icons,
#header .xh-main__actions .ps_customersignin .material-icons {
  font-size: 22px !important;
  color: var(--m-text-secondary);
}


/* ═══════════════════════════════════════════
   ROW 2: NAVIGATION BAR
   White/light bg, border-bottom, ~40px height
   ═══════════════════════════════════════════ */
.xh-navbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
  z-index: 1000;
}

.xh-navbar__inner {
  max-width: var(--m-container);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  gap: 0;
}

/* --- Nav links (centered) --- */
.xh-navbar__links {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  gap: 0;
}

.xh-navbar__links li {
  height: 100%;
  display: flex;
  align-items: center;
}

.xh-navbar__links a {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 18px;
  color: #374151 !important;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--m-font);
  text-decoration: none !important;
  transition: color 0.15s;
  white-space: nowrap;
}

.xh-navbar__links a svg {
  opacity: 0.5;
  flex-shrink: 0;
  stroke: #374151;
}

.xh-navbar__links a:hover {
  color: #2563eb !important;
}

.xh-navbar__links a:hover svg {
  stroke: #2563eb;
  opacity: 0.8;
}

/* SLEVY link — bold red */
.xh-navbar__sale a {
  color: #dc2626 !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.xh-navbar__sale a svg {
  stroke: #dc2626;
  opacity: 0.8;
}

.xh-navbar__sale a:hover {
  color: #b91c1c !important;
}

/* Hidden PS menu wrapper */
.xh-navbar__ps-menu {
  display: none !important;
}


/* ═══════════════════════════════════════════
   CATALOG BUTTON + MEGA MENU
   ═══════════════════════════════════════════ */
.xh-mega {
  position: relative;
  height: 100%;
  display: none !important;
  align-items: center;
  flex-shrink: 0;
}

/* "Zobrazit katalog" button — blue, rounded */
.xh-mega__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  background: var(--m-blue);
  border: none;
  color: var(--m-white);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--m-font);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}

.xh-mega__trigger:hover {
  background: var(--m-blue-hover);
}

.xh-mega__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Dropdown */
.xh-mega__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 860px;
  background: var(--m-white);
  border: 1px solid var(--m-border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  pointer-events: none;
  margin-top: 5px;
}

/* Show on hover */
.xh-mega:hover .xh-mega__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.xh-mega:hover .xh-mega__chevron {
  transform: rotate(180deg);
}

.xh-mega:hover .xh-mega__trigger {
  background: var(--m-blue-hover);
}

/* Panel layout */
.xh-mega__panel {
  display: flex;
  min-height: 340px;
}

/* Left: category list */
.xh-mega__categories {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  width: 250px;
  min-width: 250px;
  border-right: 1px solid var(--m-border-light);
  background: #fafafa;
  border-radius: 0 0 0 8px;
}

.xh-mega__cat {
  position: relative;
}

.xh-mega__cat > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 18px;
  color: var(--m-text) !important;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--m-font);
  text-decoration: none !important;
  transition: background 0.12s, color 0.12s;
}

.xh-mega__cat > a span {
  flex: 1;
}

.xh-mega__arrow {
  color: var(--m-text-light);
  opacity: 0.5;
  flex-shrink: 0;
  transition: opacity 0.12s, color 0.12s;
}

/* Hover state */
.xh-mega__cat:hover > a {
  background: var(--m-white);
  color: var(--m-blue) !important;
}

.xh-mega__cat:hover > a .xh-mega__arrow {
  opacity: 1;
  color: var(--m-blue);
}

/* Active indicator */
.xh-mega__cat:hover > a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--m-blue);
  border-radius: 0 2px 2px 0;
}

/* Right: subcategory panel */
.xh-mega__sub {
  position: absolute;
  top: 0;
  left: 100%;
  width: 610px;
  min-height: 100%;
  background: var(--m-white);
  padding: 20px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
  border-radius: 0 0 8px 0;
}

.xh-mega__cat:hover .xh-mega__sub {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Subcategory grid */
.xh-mega__sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 24px;
}

.xh-mega__sub-col h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--m-text);
  font-family: var(--m-font);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--m-blue);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.xh-mega__sub-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.xh-mega__sub-col li {
  margin: 0;
}

.xh-mega__sub-col a {
  display: block;
  padding: 5px 0;
  color: var(--m-text-secondary) !important;
  font-size: 13px;
  font-weight: 400;
  font-family: var(--m-font);
  text-decoration: none !important;
  transition: color 0.12s;
}

.xh-mega__sub-col a:hover {
  color: var(--m-blue) !important;
}


/* ═══════════════════════════════════════════
   STICKY HEADER
   ═══════════════════════════════════════════ */
.xh-main.xh-sticky,
.xh-navbar.xh-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}

.xh-navbar.xh-sticky {
  top: 60px;
}

.xh-sticky-placeholder {
  display: none;
}

.xh-sticky-placeholder.active {
  display: block;
  height: 102px; /* 60px main + 42px nav */
}

.xh-main.xh-scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.xh-navbar.xh-scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}


/* ═══════════════════════════════════════════
   OVERRIDE OLD PS HEADER STYLES
   ═══════════════════════════════════════════ */
#header .xh-main,
#header .xh-navbar,
#header .xh-mobile {
  display: block;
}

/* Hide old header elements */
#header .header-banner,
#header .header-top:not(.xh-main),
#header .header-nav:not(.xh-navbar) {
  display: none !important;
}

/* Kill old prefixed headers */
#header .xs-strip,
#header .xs-header,
#header .xs-nav:not(.xh-navbar),
#header .xs-mob,
.xs-strip,
.xs-header,
.xs-nav,
.xs-mob {
  display: none !important;
}

/* Hide dark top bar class if present */
.xh-topbar {
  display: none !important;
}

/* Nav bar: hide PS defaults */
#header .xh-navbar #contact-link,
#header .xh-navbar #_desktop_contact_link,
#header .xh-navbar #search_widget,
#header .xh-navbar .search-widgets {
  display: none !important;
}


/* ═══════════════════════════════════════════
   MOBILE HEADER
   ═══════════════════════════════════════════ */
.xh-mobile {
  background: var(--m-white);
  border-bottom: 1px solid var(--m-border);
}

.xh-mobile__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 8px;
}

.xh-mobile__toggle {
  background: none;
  border: none;
  padding: 8px;
  color: var(--m-text);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xh-mobile__toggle:hover {
  background: var(--m-blue-lighter);
}

.xh-mobile__logo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.xh-mobile__icons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.xh-mobile__icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  color: var(--m-text) !important;
  transition: background 0.15s;
}

.xh-mobile__icons a:hover {
  background: var(--m-blue-lighter);
}

/* Mobile search */
.xh-mobile__search {
  padding: 0 12px 10px;
}

#header .xh-mobile__search form {
  display: flex;
  height: 40px;
  border: 1px solid var(--m-border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--m-white);
  transition: border-color 0.15s;
}

#header .xh-mobile__search form:focus-within {
  border-color: var(--m-blue);
}

#header .xh-mobile__search input[type="text"] {
  flex: 1;
  border: none !important;
  outline: none !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  font-family: var(--m-font) !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#header .xh-mobile__search form button[type="submit"],
#header .xh-mobile__search form .btn-primary,
#header .xh-mobile__search form i.material-icons.search {
  background: var(--m-blue) !important;
  color: var(--m-white) !important;
  border: none !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0 !important;
}

/* Mobile menu */
.xh-mobile__menu {
  background: var(--m-white);
  border-top: 1px solid var(--m-border-light);
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.xh-mobile__menu-cats {
  padding: 4px 12px;
}

.xh-mobile__menu-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 10px;
  color: var(--m-text) !important;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--m-font);
  text-decoration: none !important;
  border-bottom: 1px solid var(--m-border-light);
  transition: background 0.15s, color 0.15s;
}

.xh-mobile__menu-cat:last-child {
  border-bottom: none;
}

.xh-mobile__menu-cat:hover {
  background: var(--m-blue-lighter);
  color: var(--m-blue) !important;
}

.xh-mobile__menu-cat--sale {
  color: var(--m-red) !important;
  font-weight: 700;
}

/* PS top menu inside mobile */
.xh-mobile__menu .js-top-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.xh-mobile__menu .js-top-menu li {
  border-bottom: 1px solid var(--m-border-light);
}

.xh-mobile__menu .js-top-menu li:last-child {
  border-bottom: none;
}

.xh-mobile__menu .js-top-menu a {
  display: block;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--m-text-secondary) !important;
  text-decoration: none !important;
  font-family: var(--m-font);
}

.xh-mobile__menu .js-top-menu a:hover {
  color: var(--m-blue) !important;
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991px) {
  .xh-main { display: none !important; }
  .xh-navbar { display: none !important; }
  .xh-mobile { display: block !important; }
}

@media (min-width: 992px) {
  .xh-mobile { display: none !important; }
}

@media (max-width: 767px) {
  .xh-main { display: none !important; }
  .xh-navbar { display: none !important; }
  .xh-mobile { display: block !important; }
}

/* Narrow desktop */
@media (min-width: 992px) and (max-width: 1200px) {
  .xh-main__inner {
    gap: 16px;
  }

  .xh-main__search {
    max-width: 380px;
  }

  .xh-navbar__links a {
    padding: 0 10px;
    font-size: 12px;
  }

  .xh-mega__dropdown {
    min-width: 740px;
  }

  .xh-mega__categories {
    width: 220px;
    min-width: 220px;
  }

  .xh-mega__sub {
    width: 520px;
  }
}


/* ═══════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════ */
@media print {
  .xh-main,
  .xh-navbar,
  .xh-mobile,
  .xh-mega__dropdown {
    display: none !important;
  }
}
