/*
 * Cabecera Versión 3 - Animación extensa de humo en tonos azules,
 * buscador predictivo integrado, botones delineados y barra inferior de categorías con íconos.
 */
.commerce-header {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  background: #fff;
  box-shadow: 0 8px 28px rgba(6, 58, 114, .14);
  position: sticky;
  top: 0;
  z-index: 40;
}

.commerce-header .header-main {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 66px;
  padding: 10px 22px;
  display: grid;
  grid-template-columns: 258px minmax(340px, 1fr) auto;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 30;
  overflow: visible;
  background:
    radial-gradient(ellipse at 78% 72%, #0878aa 0, transparent 62%),
    radial-gradient(ellipse at 45% 20%, #164d90 0, #0c2b58 76%);
}

.commerce-header .header-smoke,
.commerce-header .header-main::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.commerce-header .header-smoke {
  width: 100%;
  height: 100%;
  z-index: 0;
}

.commerce-header .header-main::after {
  content: "";
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(11, 38, 83, .82), rgba(12, 40, 87, .32) 28%, transparent 58%),
    linear-gradient(180deg, rgba(8, 31, 72, .22), rgba(8, 31, 72, .18));
}

.commerce-header .brand.commerce-brand {
  width: auto;
  flex: initial;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.commerce-header .brand.commerce-brand img {
  display: block;
  width: 220px;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  filter: none !important;
}

.commerce-header .search.commerce-search {
  height: 38px;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 3px;
  position: relative;
  z-index: 50;
  overflow: visible;
  border: 1px solid #d6e5f3;
  border-radius: 10px;
  background: #f7fbff;
  box-shadow: 0 3px 10px rgba(4, 23, 51, .15);
  transition: border-color .18s ease, background-color .18s ease;
}

.commerce-header .search.commerce-search .predictive-search {
  z-index: 2000;
}

.commerce-header .search.commerce-search:focus-within {
  border-color: #8dccf9;
  outline: 2px solid #9edbff;
  outline-offset: 2px;
  background-color: #fff;
}

.commerce-header .search.commerce-search input {
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 0;
  flex: 1;
  border: 0 !important;
  border-radius: 7px 0 0 7px !important;
  outline: 0;
  padding: 0 10px;
  background: transparent !important;
  box-shadow: none !important;
  color: #173f6a;
  font-size: 13px;
}

.commerce-header .search.commerce-search input::placeholder {
  color: #5f748c;
  opacity: 1;
}

.commerce-header .search.commerce-search button {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(190, 226, 255, .28);
  border-radius: 7px;
  background-color: #0b5b9c;
  background-image: linear-gradient(180deg, rgba(153, 215, 255, .15), transparent);
  color: #fff;
  cursor: pointer;
  transition: background-color .18s ease;
}

.commerce-header .search.commerce-search button:hover {
  background-color: #074e88;
  color: #fff;
}

.commerce-header .search.commerce-search button:active {
  background-color: #073d6d;
}

.commerce-header .search.commerce-search button:focus-visible {
  outline: 2px solid #164b79;
  outline-offset: 1px;
}

.commerce-header .search.commerce-search svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
}

.commerce-header .actions.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  margin-left: 0;
}

.commerce-header .actions.header-actions .action-btn {
  position: relative;
  height: 38px;
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(213, 235, 255, .28);
  border-radius: 9px;
  background-color: rgba(7, 31, 66, .48);
  box-shadow: inset 0 1px rgba(255, 255, 255, .07);
  color: #f5faff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}

.commerce-header .actions.header-actions .action-btn span:not(.badge) {
  display: inline !important;
}

.commerce-header .actions.header-actions .action-btn:hover {
  background-color: rgba(19, 66, 112, .85);
  border-color: rgba(213, 235, 255, .5);
}

.commerce-header .actions.header-actions .action-btn:focus-visible {
  outline: 2px solid #9edbff;
  outline-offset: 2px;
}

.commerce-header .actions.header-actions .action-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.commerce-header .actions.header-actions .action-btn.whatsapp {
  background-color: #08784d;
  background-image: linear-gradient(180deg, rgba(104, 255, 178, .11), transparent);
  border-color: rgba(157, 255, 207, .38);
  color: #fff;
}

.commerce-header .actions.header-actions .action-btn.whatsapp:hover {
  background-color: #08704b;
  border-color: rgba(157, 255, 207, .63);
}

.commerce-header .actions.header-actions .action-btn span.badge,
.commerce-header .actions.header-actions .badge {
  position: static;
  flex: 0 0 auto;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(151, 214, 255, .2);
  border: 1px solid rgba(190, 226, 255, .24);
  color: #e2f4ff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.commerce-header .actions.header-actions .action-btn span.badge.has-items,
.commerce-header .actions.header-actions .badge.has-items {
  background: linear-gradient(180deg, #ff3b47 0%, #e11d2a 100%);
  border-color: rgba(255, 255, 255, .45);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 47, 59, .48);
}

.commerce-header .actions.header-actions .action-btn.has-quote-items {
  border-color: rgba(255, 120, 128, .55);
}

.commerce-header .category-bar {
  width: 100%;
  display: block !important;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #fff 0%, #f5f9fd 100%);
  border-bottom: 1px solid #dce7f3;
}

.commerce-header .category-strip {
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: .96fr .99fr 1.01fr 1.31fr 1.28fr .83fr 1fr .84fr;
  gap: 4px;
  max-width: 1540px;
  padding: 8px 16px;
  margin-inline: auto;
  background: transparent;
  border-bottom: 0;
  overflow: visible;
}

.commerce-header .category-strip a.category {
  position: relative;
  min-width: 0;
  min-height: 46px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #163e65;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: normal;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.commerce-header .category-strip a.category::after {
  display: none !important;
  content: none !important;
}

.commerce-header .category-strip a.category > span:last-child {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
}

.commerce-header .category-strip .category-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background-color: #e9f2fb;
  color: #176299;
}

.commerce-header .category-strip .category-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.commerce-header .category-strip a.category:hover {
  background-color: #eef6ff;
  border-color: #d8e8f8;
  color: #075795;
}

.commerce-header .category-strip a.category:focus-visible {
  outline: 2px solid #1373bf;
  outline-offset: 2px;
}

.commerce-header .category-strip a.category.active {
  background: linear-gradient(135deg, #e6f2ff, #f4f9ff);
  border-color: #c7dff6;
  color: #074879;
  box-shadow: 0 2px 5px rgba(12, 73, 123, .07);
}

.commerce-header .category-strip a.category.active .category-icon {
  background-color: #0b61a8;
  color: #fff;
}

@media (max-width: 1280px) {
  .commerce-header .header-main {
    grid-template-columns: 240px minmax(280px, 1fr) auto;
    gap: 16px;
    padding-inline: 18px;
  }

  .commerce-header .brand.commerce-brand img {
    width: 206px;
  }

  .commerce-header .actions.header-actions .action-btn {
    padding-inline: 11px;
  }
}

@media (max-width: 1279px) {
  .commerce-header .category-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
  }
}

@media (max-width: 1030px) {
  .commerce-header .header-main {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-areas:
      "brand actions"
      "search search";
    gap: 8px 14px;
    padding-block: 9px;
  }

  .commerce-header .brand.commerce-brand { grid-area: brand; }
  .commerce-header .search.commerce-search { grid-area: search; }
  .commerce-header .actions.header-actions { grid-area: actions; }
}

@media (max-width: 824px) {
  .commerce-header .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
  }

  .commerce-header .category-strip a.category {
    gap: 7px;
    font-size: 12px;
  }

  .commerce-header .category-strip a.category:not(.active, :hover) {
    border-color: #e3edf7;
    background-color: rgba(255, 255, 255, .7);
  }

  .commerce-header .category-strip .category-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
  }

  .commerce-header .category-strip .category-icon svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 720px) {
  .commerce-header {
    position: relative;
  }

  .commerce-header .header-main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "actions";
    gap: 8px;
    padding: 9px 12px;
  }

  .commerce-header .brand.commerce-brand {
    width: auto;
    height: 42px;
    justify-content: center;
  }

  .commerce-header .brand.commerce-brand img {
    width: 185px;
    max-width: 185px;
  }

  .commerce-header .search.commerce-search {
    height: 40px;
  }

  .commerce-header .actions.header-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-left: 0;
  }

  .commerce-header .actions.header-actions .action-btn {
    display: inline-flex !important;
    height: 40px;
    min-height: 40px;
    padding-inline: clamp(6px, 2vw, 11px);
    gap: 6px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .commerce-header .category-strip a.category {
    min-height: 68px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: center;
  }

  .commerce-header .category-strip .category-icon {
    width: 27px;
    flex: 0 0 27px;
  }
}
