/* =====================================================================
   HEADER: layout (móvil 2 líneas / escritorio 1 línea) + dropdown overlay
   ===================================================================== */

.header{
  position:sticky;
  top:0;
  z-index:1000;
  background:linear-gradient(180deg,var(--accent) 0%,var(--accent2) 100%);
  color:#fff;
}

.header-inner{
  display:grid;
  align-items:center;
  gap:12px;
  padding:8px 16px;
}

/* MOBILE: 2 líneas (arriba: hamburguesa+título+acciones, abajo: buscador) */
@media (max-width:980px){
  .header-inner{
    grid-template-columns:auto 1fr auto;
    grid-template-areas:
      "brand brand actions"
      "search search search";
    row-gap:8px;
    padding:8px 12px;
  }
}

/* DESKTOP: 1 línea (hamburguesa+título, buscador, acciones) */
@media (min-width:981px){
  .header-inner{
    grid-template-columns:auto minmax(280px,1fr) auto;
    grid-template-areas:"brand search actions";
    height:80px;
    padding:0 16px;
  }
}

.brand-row{grid-area:brand;display:flex;align-items:center;gap:12px;min-width:0}
.searchbox{grid-area:search;min-width:0}
.top-actions{grid-area:actions}

/* Densidad/centrado dentro del header */
.header .top-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:nowrap;
  gap:12px;
}
.header .icon-link{padding:6px 8px}

/* Marca (solo dentro del header) */
.header .brand-link{font-size:44px;line-height:1;display:inline-block}
@media (max-width:980px){.header .brand-link{font-size:36px}}
.header .brand-tag{display:none}

/* Botón hamburguesa */
.cats-toggle{
  width:42px;
  height:42px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.16);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
}
.cats-toggle:hover{background:rgba(255,255,255,.24)}

.cats-toggle .bars{
  position:relative;
  width:22px;
  height:2px;
  background:currentColor;

/* =====================================================================
   CATNAV — barra de categorías (solo visible en home y subcat)
   ===================================================================== */

.catnav {
  background: linear-gradient(180deg,#55a7ff 0%,#1d7fd7 100%);
  border-top: 1px solid rgba(255,255,255,.1);
  display: block;
  width: calc(100% + 48px);
  margin-left: -24px;
  margin-right: -24px;
}

.catnav-inner {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
  justify-content: space-around;
  width: 100%;
}
.catnav-inner::-webkit-scrollbar { display: none; }

.catnav-item,
.catnav-item:link,
.catnav-item:visited,
.catnav-item:hover,
.catnav-item:active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 14px 8px;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background .15s, border-color .15s;
  flex: 1;
  max-width: 120px;
  cursor: pointer;
}
.catnav-item:hover {
  background: rgba(255,255,255,.08);
  border-bottom-color: #fff;
}

.catnav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.catnav-icon svg {
  display: block;
  width: 16px !important;
  height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  flex-shrink: 0;
}

.catnav-label {
  text-align: center;
  max-width: 80px;
  white-space: normal;
  word-break: keep-all;
}

/* TABLET: scroll horizontal, iconos más pequeños */
@media (max-width: 980px) {
  .catnav {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
  .catnav-inner {
    justify-content: flex-start;
    overflow-x: auto;
  }
  .catnav-item {
    flex: 0 0 auto;
    padding: 8px 12px 7px;
    font-size: 11px;
    max-width: none;
  }
}

/* MÓVIL: más compacto */
@media (max-width: 620px) {
  .catnav-item {
    padding: 7px 9px 6px;
    font-size: 10px;
    gap: 3px;
  }
  .catnav-icon,
  .catnav-icon svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px;
    max-height: 14px;
  }
  .catnav-label { max-width: 60px; }
}}
@media(max-width:620px){.header .icon-big{display:none!important}}