/**
 * Viewix Factory - Navigation & Header Styles
 * Responsive desktop navigation, sticky behavior & mobile 390px drawer.
 */

.wp-site-blocks > header {
  position: sticky;
  top: 0;
  z-index: 1000;
}
.wp-site-blocks > header + * { margin-block-start: 0; }
.vx-header > .vx-container {
  max-width: var(--vx-container-width);
  padding-inline: var(--vx-container-gutter);
  margin-block-start: 0;
}
.vx-mobile-drawer, .vx-mobile-drawer-backdrop { margin-block-start: 0; }
.vx-mobile-drawer-backdrop { width: 100%; }
.vx-header-actions > .vx-btn { font-size: 13px; padding: 12px 16px; }

.vx-header {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #ffffff;
  border-bottom: 1px solid var(--vx-color-border);
  transition: var(--vx-transition);
}

.vx-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.vx-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--vx-header-height);
}

/* Brand Logo */
.vx-header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* WooCommerce's `.woocommerce img` rule is more specific than a bare class
 * selector and otherwise expands this square source asset into the header.
 * Crop the padded source into the intended wordmark dimensions. */
.vx-header-inner .vx-header-logo-img {
  width: 145px;
  max-width: none;
  height: 38px;
  object-fit: cover;
  object-position: center;
}

.vx-mobile-drawer-header .vx-header-logo-img {
  width: 120px;
  max-width: none;
  height: 32px;
  object-fit: cover;
  object-position: center;
}

/* Desktop Navigation */
.vx-nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.vx-nav-list {
  display: flex;
  align-items: center;
  gap:24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.vx-nav-link {
  font-size:15px;
  font-weight: 600;
  color: var(--vx-color-text-main);
  padding: 0.5rem 0;
  position: relative;
  transition: var(--vx-transition);
}

.vx-nav-link:hover, .vx-nav-link.active {
  color: var(--vx-color-primary);
}

.vx-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--vx-color-primary);
  transition: width 0.2s ease-in-out;
}

.vx-nav-link:hover::after, .vx-nav-link.active::after {
  width: 100%;
}

/* Products category cards */
.vx-products-nav { display: flex; align-items: center; gap: 3px; }
.vx-products-toggle { display: grid; place-items: center; padding: 8px 2px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.vx-products-menu { position: absolute; top: calc(100% + 24px); left: clamp(24px,28%,calc(100% - 784px)); width: 760px; padding: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: #fff; border: 1px solid #c4c7c7; border-radius: 14px; box-shadow: 0 12px 32px #0000001a; z-index: 1020; }
.vx-products-menu[hidden] { display: none; }
.vx-products-menu::before { content: ''; position: absolute; inset: -32px 0 auto; height: 32px; }
.vx-products-card { display: flex; flex-direction: column; gap: 12px; padding: 0 0 14px; border-radius: 10px; color: #000; min-width: 0; text-decoration: none; }
.vx-products-card:hover,.vx-products-card:focus-visible { padding: 16px; background: #f1f4fa; color: #000; }
.vx-products-menu .vx-products-card img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border: 1px solid #c4c7c7; border-radius: 8px; }
.vx-products-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 18px; font-weight: 600; line-height: 27px; }
.vx-products-card p { margin: 0; font-size: 14px; font-weight: 400; line-height: 21px; color: #444748; }
.vx-products-toggle:focus-visible,.vx-products-card:focus-visible { outline: 2px solid #0054d9; outline-offset: 3px; }

.vx-solutions-menu { display: flex; flex-direction: column; gap: 15px; padding: 24px; border-color: #e5e7eb; border-radius: 12px; box-shadow: 0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a; }
.vx-solutions-menu-heading { padding-top: 6.5px; }
.vx-solutions-menu-heading strong { display: block; font-size: 10px; line-height: 15px; letter-spacing: 2px; color: #004ac6; }
.vx-solutions-menu-heading p { margin: 6.5px 0 0; font-size: 12px; line-height: 16px; color: #000; }
.vx-solutions-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.vx-solution-menu-card { display: flex; flex-direction: column; color: #111827; border-radius: 8px; text-decoration: none; }
.vx-solutions-menu .vx-solution-menu-card img { width: 100%; height: auto; aspect-ratio: 341/164; object-fit: cover; border: 1px solid #f3f4f6; border-bottom: 15px solid #f3f4f6; border-radius: 8px; }
.vx-solution-menu-category { margin-top: 4px; font-size: 12px; font-weight: 700; line-height: 18px; color: #2563eb; }
.vx-solution-menu-card h3 { margin: 3px 0 4px; font-size: 18px; font-weight: 700; line-height: 24px; }
.vx-solution-menu-card h3 span { font-weight: 400; color: #000; }
.vx-solution-menu-card p { margin: 0 0 7px; color: #6b7280; font-size: 12px; line-height: 20px; }
.vx-solution-menu-cta { margin-top: auto; font-size: 12px; line-height: 20px; font-weight: 600; }
.vx-solutions-menu-all { padding-top: 14px; border-top: 1px solid #f3f4f6; font-size: 12px; line-height: 20px; font-weight: 700; color: #004ac6; }
.vx-solution-menu-card:hover .vx-solution-menu-cta { color: #004ac6; }
.vx-solution-menu-card:focus-visible,.vx-solutions-menu-all:focus-visible { outline: 2px solid #0054d9; outline-offset: 4px; }

/* Header Actions */
.vx-header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Language Selector */
.vx-lang-selector {
  position: relative;
}

.vx-lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--vx-color-text-main);
  background: transparent;
  border: 1px solid var(--vx-color-border);
  padding: 0.35rem 0.65rem;
  border-radius: var(--vx-radius-sm);
  cursor: pointer;
  transition: var(--vx-transition);
}

.vx-lang-btn:hover {
  border-color: var(--vx-color-primary);
  color: var(--vx-color-primary);
}

.vx-lang-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--vx-color-border);
  border-radius: var(--vx-radius-md);
  box-shadow: var(--vx-shadow-card);
  padding: 0.5rem 0;
  min-width: 120px;
  display: none;
  z-index: 1010;
}

.vx-lang-dropdown.open {
  display: block;
}

.vx-lang-item {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--vx-color-text-main);
}

.vx-lang-item:hover, .vx-lang-item.active {
  background: var(--vx-color-tint);
  color: var(--vx-color-primary);
}

/* Mobile Toggle Hamburger */
.vx-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--vx-color-text-main);
}

.vx-mobile-toggle svg {
  width: 28px;
  height: 28px;
}

/* Mobile Drawer Overlay & Menu */
.vx-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 340px;
  height: 100vh;
  background: #ffffff;
  z-index: 1100;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

/* Keep the closed fixed panel out of the document's scrollable overflow. */
.vx-mobile-drawer:not(.open) {
  display: none;
}

.vx-mobile-drawer.open {
  display: flex;
  transform: translateX(0);
}

.vx-mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 16, 21, 0.6);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.vx-mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.vx-mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--vx-color-border);
}

.vx-mobile-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--vx-color-text-main);
}

.vx-mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.vx-mobile-nav-link {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--vx-color-text-main);
  display: block;
}

.vx-mobile-nav-link:hover, .vx-mobile-nav-link.active {
  color: var(--vx-color-primary);
}

/* Global Footer Layout */
.vx-footer {
  background-color: var(--vx-color-dark);
  color: #ffffff;
  padding-top: 5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--vx-color-border-dark);
}

.vx-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.vx-footer-brand p {
  color: #a0aec0;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-top: 1.25rem;
  max-width: 340px;
}

.vx-footer-brand > a {
  display: block;
  width: 145px;
  height: 38px;
  overflow: hidden;
}

.vx-footer-brand > a img {
  width: 145px;
  max-width: none;
  height: 38px;
  object-fit: cover;
  object-position: center;
}

.vx-footer-title {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.vx-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.vx-footer-link {
  color: #a0aec0;
  font-size: 0.9375rem;
  transition: var(--vx-transition);
}

.vx-footer-link:hover {
  color: #ffffff;
  padding-left: 4px;
}

.vx-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #718096;
  font-size: 0.875rem;
}

/* Responsive Navigation Adjustments */
@media (max-width: 1024px) {
  .vx-nav-desktop {
    display: none;
  }
  .vx-mobile-toggle {
    display: block;
  }
  .vx-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  .vx-header-inner .vx-header-logo-img {
    width: 120px;
    height: 32px;
  }
  .vx-header-actions {
    gap: 0.5rem;
  }
  /* The same CTA remains available in the mobile drawer; hiding the desktop
   * copy prevents the compact header from overflowing on 390px screens. */
  .vx-header-actions > .vx-btn-primary {
    display: none;
  }
  .vx-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .vx-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .vx-header > .vx-container {
    max-width: none;
    padding-inline: 20px;
  }
}
