/* ── header.css — Rubber Hose Cartoon Header ───────────────────────────── */

/* ── Banda de aviso superior ───────────────────────────────────────────── */
.notice {
  background:    var(--accent);
  color:         var(--on-accent);
  font-family:   var(--font-display);
  font-size:     var(--size-xs);
  letter-spacing: 0.03em;
  text-align:    center;
  padding:       0.45rem var(--gutter);
  border-bottom: var(--border-width) solid var(--line);
  position:      relative;
  z-index:       calc(var(--z-nav) + 1);
}

.notice a {
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: var(--weight-bold);
}

/* ── Header principal ──────────────────────────────────────────────────── */
.header {
  position:         sticky;
  top:              0;
  z-index:          var(--z-nav);
  background:       var(--background);
  border-bottom:    var(--border-width-lg) solid var(--line);
  box-shadow:       0 3px 0 var(--line);
}

.header__inner {
  display:         flex;
  align-items:     center;
  gap:             var(--space-4);
  height:          var(--header-h);
  padding-inline:  var(--gutter);
  max-width:       var(--max-w);
  margin-inline:   auto;
}

/* ── Logo / Nombre de marca ────────────────────────────────────────────── */
.header__logo {
  font-family:    var(--font-display);
  font-size:      clamp(1.3rem, 3vw, 1.75rem);
  font-weight:    var(--weight-regular);
  color:          var(--text);
  line-height:    1;
  text-decoration: none;
  flex-shrink:    0;
  letter-spacing: -0.01em;
  transition:     color var(--dur-fast) var(--ease);
}

.header__logo:hover {
  color: var(--accent);
}

/* El punto final del logo — acento cromático */
.header__logo .banner__dot,
.header__logo-dot {
  color: var(--accent);
}

/* ── Navegación desktop ────────────────────────────────────────────────── */
.header__nav {
  display:     none;
  align-items: center;
  gap:         var(--space-1);
  margin-left: auto;
}

@media (min-width: 768px) {
  .header__nav {
    display: flex;
  }
}

.header__link {
  font-family:    var(--font-body);
  font-size:      var(--size-sm);
  font-weight:    var(--weight-medium);
  color:          var(--text);
  padding:        0.4em 0.75em;
  border-radius:  var(--radius-sm);
  text-decoration: none;
  position:       relative;
  transition:
    color      var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.header__link::after {
  content:        '';
  position:       absolute;
  bottom:         4px;
  left:           0.75em;
  right:          0.75em;
  height:         2.5px;
  background:     var(--accent);
  border-radius:  var(--radius-pill);
  transform:      scaleX(0);
  transform-origin: left center;
  transition:     transform var(--dur-base) var(--ease-out);
}

.header__link:hover,
.header__link.is-active {
  color: var(--accent);
}

.header__link:hover::after,
.header__link.is-active::after {
  transform: scaleX(1);
}

/* ── Lado derecho — carrito, cuenta, burger ────────────────────────────── */
.header__side {
  display:     flex;
  align-items: center;
  gap:         var(--space-2);
  margin-left: auto;
}

@media (min-width: 768px) {
  .header__side {
    margin-left: var(--space-4);
  }
}

/* Botón carrito */
.header__cart {
  position:       relative;
  display:        grid;
  place-items:    center;
  width:          44px;
  height:         44px;
  border:         var(--border-width) solid var(--line);
  border-radius:  var(--radius-sm);
  background:     var(--background);
  color:          var(--text);
  box-shadow:     var(--shadow-xs);
  transition:
    transform  var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
  cursor:         pointer;
}

.header__cart:hover {
  background:  var(--accent);
  color:       var(--on-accent);
  box-shadow:  none;
  transform:   translate(2px, 2px);
}

.header__cart [data-lucide] {
  width:  20px;
  height: 20px;
}

/* Badge del carrito */
.header__cart-badge {
  position:       absolute;
  top:            -6px;
  right:          -6px;
  min-width:      18px;
  height:         18px;
  padding:        0 4px;
  background:     var(--accent-2);
  color:          var(--on-accent-2);
  font-family:    var(--font-mono);
  font-size:      10px;
  font-weight:    var(--weight-bold);
  border:         1.5px solid var(--line);
  border-radius:  var(--radius-pill);
  display:        grid;
  place-items:    center;
  line-height:    1;
}

/* Usuario */
.header__user {
  display:        grid;
  place-items:    center;
  width:          44px;
  height:         44px;
  border:         var(--border-width) solid var(--line);
  border-radius:  var(--radius-sm);
  background:     var(--background);
  color:          var(--muted);
  box-shadow:     var(--shadow-xs);
  text-decoration: none;
  transition:
    transform  var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    color      var(--dur-fast) var(--ease);
}

.header__user:hover {
  color:       var(--text);
  box-shadow:  none;
  transform:   translate(2px, 2px);
}

.header__user [data-lucide] {
  width:  18px;
  height: 18px;
}

/* Burger — solo mobile */
.header__burger {
  display:        grid;
  place-items:    center;
  width:          44px;
  height:         44px;
  border:         var(--border-width) solid var(--line);
  border-radius:  var(--radius-sm);
  background:     var(--background);
  color:          var(--text);
  box-shadow:     var(--shadow-xs);
  cursor:         pointer;
  transition:
    transform  var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.header__burger:hover {
  box-shadow: none;
  transform:  translate(2px, 2px);
}

.header__burger [data-lucide] {
  width:  22px;
  height: 22px;
}

@media (min-width: 768px) {
  .header__burger { display: none; }
}

/* ── Búsqueda ──────────────────────────────────────────────────────────── */
.header-search {
  flex:          1;
  max-width:     320px;
  display:       none;
}

@media (min-width: 1024px) {
  .header-search {
    display: block;
  }
}

.header-search__form {
  display:        flex;
  align-items:    center;
  border:         var(--border-width) solid var(--line);
  border-radius:  var(--radius-md);
  overflow:       hidden;
  background:     var(--surface);
  box-shadow:     var(--shadow-xs);
  transition:
    box-shadow var(--dur-fast) var(--ease),
    transform  var(--dur-fast) var(--ease);
}

.header-search__form:focus-within {
  box-shadow: var(--shadow-sm);
  transform:  translate(-1px, -1px);
}

.header-search__input {
  flex:        1;
  border:      none;
  background:  transparent;
  padding:     0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size:   var(--size-sm);
  color:       var(--text);
  outline:     none;
}

.header-search__input::placeholder {
  color: var(--dim);
}

.header-search__btn {
  padding:    0.5rem 0.75rem;
  color:      var(--muted);
  transition: color var(--dur-fast);
}

.header-search__btn:hover {
  color: var(--accent);
}

.header-search__btn [data-lucide] {
  width:  16px;
  height: 16px;
}