/* ======================================
   CAP · Header mixto
   ====================================== */

.cap-header-shell {
  width: 100%;
  overflow: visible !important;
}

.cap-header-shell > .elementor-widget {
  margin-bottom: 0;
}

.cap-header {
  --cap-navy: #08284b;
  --cap-green: #568523;
  --cap-border: #e8edf2;

  position: relative;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--cap-border);
  background: #fff;
  color: var(--cap-navy);
  font-family: inherit;
}

.cap-header,
.cap-header * {
  box-sizing: border-box;
}

.cap-header__inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px 16px;
}

/* Fila superior */

.cap-header__top {
  display: grid;
  grid-template-columns: 175px minmax(200px, 1fr) auto;
  align-items: center;
  gap: 32px;
  min-height: 70px;
}

/* Logo */

.cap-header .cap-header__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
}

.cap-header .cap-header__logo img {
  display: block;
  width: auto;
  max-width: 150px;
  height: 66px;
  margin: 0;
  object-fit: contain;
}

/* Buscador */

.cap-header form.cap-header__search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 650px;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 3px;
  border: 1px solid #e4e8ef;
  border-radius: 30px;
  background: #f7f8fa;
}

.cap-header .cap-header__search input[type="search"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 25px;
  outline: none;
  background: transparent;
  color: var(--cap-navy);
  font-family: inherit;
  font-size: 13px;
  box-shadow: none;
}

.cap-header__search input::placeholder {
  color: #7b8795;
}

.cap-header__search:focus-within {
  outline: 2px solid var(--cap-navy);
  outline-offset: 2px;
}

.cap-header .cap-header__search button {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cap-navy);
  color: #fff;
  cursor: pointer;
}

/* Iconos */

.cap-header svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cap-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.cap-header .cap-header__account,
.cap-header .cap-header__cart {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  color: var(--cap-navy);
  text-decoration: none;
}

.cap-header__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f4f6f8;
}

.cap-header__action-text {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.cap-header__cart-slot {
  min-width: 36px;
}

.cap-header .cap-header__count {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 12px;
  background: var(--cap-green);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

/* Fila inferior */

.cap-header__bottom {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 15px;
}

/* Categorías */

.cap-header__categories {
  position: relative;
  flex: 0 0 175px;
}

.cap-header__categories > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 9px;
  background: var(--cap-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.cap-header__categories > summary::-webkit-details-marker {
  display: none;
}

.cap-header__categories > summary svg {
  width: 17px;
  height: 17px;
}

.cap-header__chevron {
  margin-left: auto;
}

.cap-header__categories[open] .cap-header__chevron {
  transform: rotate(180deg);
}

.cap-header__category-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 100;
  width: 280px;
  max-width: calc(100vw - 40px);
  max-height: 65vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--cap-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(8 40 75 / 12%);
}

.cap-header .cap-header__category-panel a {
  display: block;
  padding: 12px;
  border-radius: 7px;
  color: var(--cap-navy);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.cap-header .cap-header__category-panel a:hover {
  background: #f0f5e9;
}

/* Menú principal */

.cap-header__nav {
  flex: 1;
  min-width: 0;
}

.cap-header .cap-header__nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cap-header .cap-header__nav li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cap-header .cap-header__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cap-navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.cap-header .cap-header__nav a:hover {
  color: var(--cap-green);
}

/* Cotización */

.cap-header a.cap-header__quote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 20px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 9px;
  background: var(--cap-green);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.cap-header a.cap-header__quote:hover {
  background: #426b19;
}

/* Accesibilidad */

.cap-header a:focus-visible,
.cap-header button:focus-visible,
.cap-header summary:focus-visible {
  outline: 2px solid var(--cap-navy);
  outline-offset: 3px;
}

/* Tablet */

@media (max-width: 1100px) {
  .cap-header__top {
    grid-template-columns: 140px minmax(180px, 1fr) auto;
    gap: 20px;
  }

  .cap-header__actions {
    gap: 10px;
  }

  .cap-header__action-text {
    display: none;
  }

  .cap-header__bottom {
    gap: 20px;
  }

  .cap-header .cap-header__nav ul {
    gap: 5px 16px;
  }
}

/* Móvil */

@media (max-width: 767px) {
  .cap-header__inner {
    padding: 10px 16px 12px;
  }

  .cap-header__top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .cap-header .cap-header__logo {
    justify-content: flex-start;
    width: 125px;
  }

  .cap-header .cap-header__logo img {
    max-width: 125px;
    height: 52px;
  }

  .cap-header__actions {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
  }

  .cap-header form.cap-header__search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }

  .cap-header__bottom {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
  }

  .cap-header__categories {
    flex: 0 1 155px;
  }

  .cap-header__categories > summary {
    padding: 10px 12px;
    font-size: 12px;
  }

  .cap-header a.cap-header__quote {
    gap: 10px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .cap-header__nav {
    order: 3;
    flex: 1 1 100%;
    overflow-x: auto;
  }

  .cap-header .cap-header__nav ul {
    flex-wrap: nowrap;
    gap: 22px;
  }

  .cap-header .cap-header__nav a {
    white-space: nowrap;
    font-size: 12px;
  }
}

/* CAP · Resultados rápidos del buscador */

.cap-header__search {
  position: relative;
  overflow: visible;
}

.cap-search-popup[hidden] {
  display: none !important;
}

.cap-search-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 1000;
  min-width: 0;

  background: #fff;
  border: 1px solid #dce5ed;
  border-radius: 14px;
  box-shadow: 0 14px 35px rgb(8 40 75 / 16%);
  overflow: hidden;
  text-align: left;
}

.cap-search-popup__status {
  margin: 0;
  padding: 12px 16px;
  background: #f5f8fb;
  color: #52677d;
  font-size: 12px;
  line-height: 1.5;
}

.cap-search-popup__list {
  max-height: 350px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #568523 #f0f4f8;
}

.cap-search-popup__item {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;

  color: #08284b !important;
  background: #fff;
  border-bottom: 1px solid #edf1f5;
  text-decoration: none !important;
}

.cap-search-popup__item:hover,
.cap-search-popup__item:focus-visible {
  background: #f2f7ed;
}

.cap-search-popup__item:focus-visible {
  outline: 2px solid #568523;
  outline-offset: -2px;
}

.cap-search-popup__item img {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
}

.cap-search-popup__name {
  display: block;
  color: #08284b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cap-search-popup__price {
  display: block;
  margin-top: 5px;
  color: #426b19;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.cap-search-popup__all {
  display: block;
  padding: 14px 16px;
  background: #08284b;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
}

.cap-search-popup__all:hover,
.cap-search-popup__all:focus-visible {
  background: #426b19;
}

@media (max-width: 767px) {
  .cap-header__search input[type="search"] {
    font-size: 16px;
  }

  .cap-search-popup__list {
    max-height: min(300px, 45dvh);
  }

  .cap-search-popup__item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
  }

  .cap-search-popup__item img {
    width: 48px;
    height: 48px;
  }

  .cap-search-popup__name {
    font-size: 13px;
  }
}