/* Componentes compartidos del Modulo 1.
   Duplica este archivo para una nueva marca solo cuando cambie el sistema visual global. */

.store-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 240, 232, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.top-bar {
  background: var(--black);
  color: var(--cream);
  text-align: center;
  padding: 9px 16px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.nav-container {
  position: relative;
  width: min(100% - 32px, var(--max-width));
  min-height: 78px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  flex-shrink: 0;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-logo::after {
  content: ".";
  color: var(--gold);
}

.store-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 0.92rem;
  font-weight: 750;
}

.store-nav a {
  position: relative;
  color: var(--text);
}

.store-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.25s ease;
}

.store-nav a:hover::after,
.store-nav a:focus-visible::after {
  width: 100%;
}

.store-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--text);
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  width: 210px;
  height: 44px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  outline: none;
  transition:
    width 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.search-bar input::placeholder {
  color: var(--muted);
}

.search-bar input:focus {
  width: 260px;
  background: var(--white);
  border-color: rgba(199, 169, 107, 0.65);
  box-shadow: 0 0 0 4px rgba(199, 169, 107, 0.14);
}

.search-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.icon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 255, 255, 0.82);
  color: var(--gold);
  transform: translateY(-2px);
}

.action-icon {
  width: 21px;
  height: 21px;
}

.bag-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--black);
  font-size: 0.7rem;
  font-weight: 900;
}

.header-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.header-cta:hover,
.header-cta:focus-visible {
  background: var(--soft-black);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--black);
  border-radius: 999px;
  transition: 0.25s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1100px) {
  .store-nav {
    gap: 18px;
  }

  .search-bar input {
    width: 170px;
  }
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-flex;
  }

  .store-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 100;
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(246, 240, 232, 0.98);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: 0.25s ease;
  }

  .store-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .store-nav a {
    padding: 12px 10px;
    border-radius: 12px;
    font-weight: 800;
  }

  .store-nav a::after {
    display: none;
  }

  .store-nav a:hover,
  .store-nav a:focus-visible {
    background: rgba(199, 169, 107, 0.14);
  }
}

@media (max-width: 760px) {
  .nav-container {
    min-height: 72px;
    gap: 10px;
  }

  .brand-logo {
    font-size: 1.25rem;
  }

  .store-actions {
    margin-left: auto;
    gap: 8px;
  }

  .search-bar,
  .header-cta {
    display: none;
  }

  .icon-actions {
    gap: 6px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .action-icon {
    width: 20px;
    height: 20px;
  }
}
