.vs-header,
.vs-header__overlay,
.vs-header__drawer {
  --hdr-bg: #ffffff;
  --hdr-soft: #f7f7f5;
  --hdr-fg: #111111;
  --hdr-muted: #6b6b6b;
  --hdr-border: #e8e8e6;
  --hdr-accent: #111111;
  --hdr-transition: 0.3s ease;
  --hdr-pad: 1rem;
}

.vs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--hdr-border);
}

.vs-header__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem var(--hdr-pad);
}

.vs-header__logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
  color: var(--hdr-fg);
}

.vs-header__logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--hdr-transition);
}

.vs-header__logo:hover .vs-header__logo-text { color: var(--hdr-muted); }

.vs-header__logo-img {
  object-fit: contain;
  max-height: 60px;
  max-width: 100%;
}

.vs-header__nav-desktop { display: none; }

.vs-header__nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vs-header__nav-item { position: relative; }

.vs-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--hdr-fg);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  transition: color var(--hdr-transition);
  white-space: nowrap;
}

.vs-header__nav-link:hover { color: var(--hdr-muted); }

.vs-header__nav-chevron {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.vs-header__submenu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 12rem;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: var(--hdr-bg);
  border: 1px solid var(--hdr-border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hdr-transition), visibility var(--hdr-transition);
  z-index: 60;
}

.vs-header__nav-item:hover .vs-header__submenu,
.vs-header__nav-item:focus-within .vs-header__submenu {
  opacity: 1;
  visibility: visible;
}

.vs-header__submenu a {
  display: block;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--hdr-fg);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--hdr-transition), background-color var(--hdr-transition);
}

.vs-header__submenu a:hover {
  color: var(--hdr-muted);
  background: var(--hdr-soft);
}

.vs-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.vs-header__btn {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hdr-fg);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--hdr-transition);
}

.vs-header__btn:hover { color: var(--hdr-muted); }

/* En móvil, Mi Cuenta y Rastrear viven en el drawer lateral (sin duplicar en el header) */
.vs-header__btn--account,
.vs-header__btn--tracking { display: none; }

.svg-wrapper.vs-header__btn-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.vs-header__burger { display: inline-flex; }

.vs-header__cart-count {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hdr-accent);
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  transform: scale(0);
  transition: transform var(--hdr-transition);
}

.vs-header__cart-count.is-visible { transform: scale(1); }

.vs-header__cart-count.bubble-pop {
  animation: cartBubblePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cartBubblePop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.vs-header__search-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--hdr-bg);
  border-bottom: 1px solid var(--hdr-border);
  z-index: 60;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease,
    visibility 0.35s ease;
}

.vs-header__search-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.vs-header__search-container {
  max-width: var(--page-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem var(--hdr-pad);
}

.vs-header__search-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--hdr-fg);
  padding: 0.5rem 0;
}

.svg-wrapper.vs-header__search-glass {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--hdr-muted);
  flex-shrink: 0;
}

.vs-header__search-input {
  display: block;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--hdr-fg);
  outline: none;
}

.vs-header__search-input:focus {
  outline: none;
}

/* Una sola equis visible: la nativa del navegador se oculta (igual que Dawn
   con su cancel-button). Limpia y cierra con la equis del panel. */
.vs-header__search-input::-webkit-search-cancel-button {
  display: none;
}

.vs-header__search-input[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.vs-header__search-close {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hdr-fg);
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color var(--hdr-transition), background-color var(--hdr-transition), transform 0.3s ease;
}

.vs-header__search-close:hover {
  color: var(--hdr-muted);
  background: var(--hdr-soft);
  transform: rotate(90deg);
}

.vs-header__search-results {
  width: 100%;
}

.vs-header__search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.25rem;
  border-bottom: 1px solid var(--hdr-border);
  text-decoration: none;
  color: var(--hdr-fg);
  transition: color var(--hdr-transition), background-color var(--hdr-transition);
}

.vs-header__search-result:last-child { border-bottom: none; }

.vs-header__search-result:hover {
  color: var(--hdr-muted);
  background: var(--hdr-soft);
}

.vs-header__search-result-thumb {
  width: 2.5rem;
  height: 3rem;
  background: var(--hdr-soft);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-header__search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vs-header__search-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}

.vs-header__search-result-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-header__search-result-sku {
  font-size: 0.6875rem;
  color: var(--hdr-muted);
}

.vs-header__search-result-price {
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: auto;
}

.vs-header__overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hdr-transition), visibility var(--hdr-transition);
}

.vs-header__overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.vs-header__drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  max-width: 20rem;
  display: flex;
  flex-direction: column;
  background: var(--hdr-bg);
  z-index: 101;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.1);
  transform: translateX(-100%);
  transition: transform var(--hdr-transition);
}

.vs-header__drawer.is-open { transform: translateX(0); }

.vs-header__drawer-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hdr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vs-header__drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hdr-fg);
}

.vs-header__drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.vs-header__mobile-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vs-header__mobile-link,
.vs-header__mobile-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 0;
  border: none;
  border-bottom: 1px solid var(--hdr-border);
  font-size: 1rem;
  font-weight: 500;
  color: var(--hdr-fg);
  text-decoration: none;
  text-align: left;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--hdr-transition);
}

.vs-header__mobile-link:hover,
.vs-header__mobile-toggle:hover { color: var(--hdr-muted); }

.vs-header__mobile-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform var(--hdr-transition);
}

.vs-header__mobile-item.is-expanded > .vs-header__mobile-toggle .vs-header__mobile-chevron {
  transform: rotate(180deg);
}

.vs-header__mobile-submenu {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vs-header__mobile-item.is-expanded > .vs-header__mobile-submenu { display: block; }

.vs-header__mobile-submenu .vs-header__mobile-link {
  padding-left: 1rem;
  font-size: 0.9375rem;
  color: var(--hdr-muted);
}

.vs-header__drawer-extra {
  padding: 1.25rem;
  border-top: 1px solid var(--hdr-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vs-header__drawer-extra a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  font-size: 0.9375rem;
  color: var(--hdr-fg);
  text-decoration: none;
  transition: color var(--hdr-transition);
}

.vs-header__drawer-extra a:hover { color: var(--hdr-muted); }

.vs-header__drawer-extra .svg-wrapper.vs-header__btn-icon { flex-shrink: 0; }

@media (min-width: 640px) {
  .vs-header,
  .vs-header__overlay,
  .vs-header__drawer { --hdr-pad: 1.5rem; }
}

@media (min-width: 768px) {
  .vs-header,
  .vs-header__overlay,
  .vs-header__drawer { --hdr-pad: 2rem; }
  .vs-header__inner { padding-top: 1rem; padding-bottom: 1rem; }
  .vs-header__burger { display: none; }
  .vs-header__btn--account,
  .vs-header__btn--tracking { display: inline-flex; }
  .vs-header__nav-desktop {
    display: flex;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
  }
  .vs-header__search-input { font-size: 1.25rem; }
  .vs-header__search-container { gap: 1.5rem; }
}

@media (min-width: 1024px) {
  .vs-header,
  .vs-header__overlay,
  .vs-header__drawer { --hdr-pad: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .vs-header__drawer,
  .vs-header__overlay,
  .vs-header__cart-count,
  .vs-header__mobile-chevron { transition-duration: 0.01ms; }
}
