/* Clasitrónicos Header Design V1
   --------------------------------
   Independent, compact marketplace header. It deliberately does not derive
   its width from the 1/2/3/4-column results grid. */

:root {
  --clx-header-height: 78px;
  --clx-header-border: #dfe6e8;
  --clx-header-text: #263537;
  --clx-header-muted: #647478;
  --clx-header-teal: #147d7e;
  --clx-header-teal-dark: #0f6264;
  --clx-header-soft: #eef7f6;
  --clx-header-coral: #e65d70;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  box-sizing: border-box !important;
  position: relative;
  z-index: 900;
  display: block !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 / span 2 !important;
  width: 100% !important;
  min-height: var(--clx-header-height);
  padding: 0 !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--clx-header-border);
  box-shadow: 0 3px 16px rgba(28, 43, 41, 0.08) !important;
}

.site-header-inner {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 28px));
  min-height: var(--clx-header-height);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(145px, 176px) minmax(220px, 1fr) auto auto auto auto auto;
  gap: 12px;
  align-items: center;
}

.site-header .logo-publish-container {
  box-sizing: border-box;
  display: block !important;
  grid-column: auto !important;
  grid-row: auto !important;
  width: 100%;
  overflow: visible;
}

.site-header .logo {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

.site-header .logo > img:first-child,
.site-header .menu .logo img {
  min-width: 0 !important;
  width: 100% !important;
  max-height: 35px !important;
}

.header-search {
  box-sizing: border-box;
  display: flex !important;
  width: 100% !important;
  height: 42px;
  margin: 0 !important;
  padding: 0 4px 0 14px !important;
  align-items: center;
  justify-content: stretch !important;
  background: #f7f9fa;
  border: 1px solid #cfdadd;
  border-radius: 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.header-search:focus-within {
  background: #ffffff;
  border-color: var(--clx-header-teal);
  box-shadow: 0 0 0 3px rgba(20, 125, 126, 0.11);
}

.header-search input[type="search"] {
  box-sizing: border-box;
  min-width: 0;
  width: 100% !important;
  height: 40px;
  padding: 0 8px 0 0 !important;
  background: transparent !important;
  color: var(--clx-header-text) !important;
  border: 0 !important;
  outline: 0 !important;
  opacity: 1 !important;
  font: 500 14px/1.2 Roboto, Arial, sans-serif;
}

.header-search input::placeholder {
  color: #849195;
  opacity: 1;
}

.header-search button {
  box-sizing: border-box;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 !important;
  background: var(--clx-header-teal) !important;
  color: #ffffff !important;
  border: 0;
  border-radius: 8px;
}

.header-search button:hover {
  background: var(--clx-header-teal-dark) !important;
}

.header-search button svg,
.header-menu-toggle svg,
.header-categories-trigger svg,
.header-mobile-search svg {
  width: 20px;
  height: 20px;
}

.header-country-chip,
.header-categories-trigger,
.header-language,
.header-account > summary {
  box-sizing: border-box;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--clx-header-text) !important;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 9px;
  font: 600 12px/1 Montserrat, Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  opacity: 1 !important;
}

.header-country-chip {
  background: #f8fafb;
  border-color: var(--clx-header-border);
}

.header-country-chip:hover,
.header-categories-trigger:hover,
.header-language:hover,
.header-account > summary:hover {
  color: var(--clx-header-teal-dark) !important;
  background: var(--clx-header-soft);
  border-color: rgba(20, 125, 126, 0.25);
}

.header-country-flag {
  width: 24px !important;
  height: 16px !important;
  object-fit: cover !important;
  border: 1px solid #d8e1e3;
  border-radius: 3px;
}

.header-categories-trigger::after {
  content: none !important;
}

.header-categories-trigger svg {
  width: 17px;
  height: 17px;
}

.header-account {
  position: relative;
}

.header-account > summary {
  list-style: none;
}

.header-account > summary::-webkit-details-marker {
  display: none;
}

.header-account > summary svg {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}

.header-account[open] > summary svg {
  transform: rotate(180deg);
}

.header-account-menu {
  box-sizing: border-box;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1100;
  width: 176px;
  padding: 7px;
  display: grid;
  gap: 3px;
  background: #ffffff;
  border: 1px solid var(--clx-header-border);
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(28, 43, 41, 0.16);
}

.header-account-menu a {
  box-sizing: border-box;
  padding: 10px 11px;
  color: var(--clx-header-text);
  border-radius: 7px;
  font: 500 12px/1.2 Montserrat, Arial, sans-serif;
}

.header-account-menu a:hover {
  color: var(--clx-header-teal-dark);
  background: var(--clx-header-soft);
}

.site-header .publicar.header-publish {
  box-sizing: border-box;
  grid-column: auto !important;
  grid-row: auto !important;
  flex: 0 0 126px !important;
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  justify-self: end !important;
  align-self: center !important;
  white-space: nowrap;
  background: var(--clx-header-coral) !important;
  color: #ffffff !important;
  border: 0;
  border-radius: 9px !important;
  font: 700 12px/1 Montserrat, Arial, sans-serif;
  text-transform: none;
  box-shadow: 0 3px 9px rgba(230, 93, 112, 0.20);
}

.site-header .publicar.header-publish:hover {
  opacity: 1 !important;
  background: #d94e62 !important;
  transform: translateY(-1px);
}

.header-publish-narrow {
  display: none;
}

.header-menu-toggle,
.header-mobile-search {
  box-sizing: border-box;
  display: none;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  place-items: center;
  background: transparent !important;
  color: var(--clx-header-text) !important;
  border: 1px solid var(--clx-header-border) !important;
  border-radius: 9px;
}

/* The category panel remains the established functional menu, but it now
   anchors to the independent header rather than the card grid. */
.site-header > .categories {
  box-sizing: border-box;
  z-index: 1000;
}

@media only screen and (min-width: 1100px) {
  .site-header > .categories {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: calc(100vh - var(--clx-header-height));
    margin: 0 !important;
    padding: 22px max(24px, calc((100% - 1180px) / 2)) 26px !important;
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px;
    overflow-y: auto !important;
    background: #ffffff !important;
    border-top: 1px solid var(--clx-header-border);
    box-shadow: 0 18px 30px rgba(28, 43, 41, 0.15);
  }

  .site-header > .categories.showMenu,
  .site-header > .categories.showMenuDsktp {
    display: grid !important;
  }

  .site-header > .categories > .category-item {
    box-sizing: border-box;
    width: auto !important;
    padding: 8px 14px 15px !important;
    align-items: stretch !important;
    background: #f8fafb !important;
    border: 1px solid var(--clx-header-border);
    border-radius: 11px;
  }

  .site-header > .categories .category {
    margin: 0 0 6px !important;
    padding-bottom: 8px;
    color: var(--clx-header-teal-dark) !important;
    border-bottom: 1px solid rgba(20, 125, 126, 0.22);
    font-size: 13px;
  }

  .site-header > .categories .subcategories {
    display: flex !important;
    margin: 0 !important;
  }

  .site-header > .categories .subcategory {
    padding: 7px 4px !important;
    font-size: 12px;
  }

  .site-header > .categories .tablet-onboarding,
  .site-header > .categories .mobile-only {
    display: none !important;
  }
}

/* Tablet header: retain the visible search bar, simplify the actions. */
@media only screen and (min-width: 700px) and (max-width: 1099px) {
  /* Explicit grid areas prevent the legacy menu classes from creating a
     second row or reserving an invisible flexible track beside Publicar. */
  .site-header-inner {
    display: grid !important;
    grid-template-columns: 42px minmax(118px, 150px) minmax(0, 1fr) 104px !important;
    grid-template-areas: "menu logo search publish" !important;
    grid-template-rows: minmax(46px, 1fr) !important;
    grid-auto-flow: row !important;
    grid-auto-rows: 0 !important;
    gap: 9px;
    align-items: center;
  }

  .site-header-inner > * {
    min-width: 0;
  }

  .header-menu-toggle {
    display: grid !important;
    grid-area: menu !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
  }

  .site-header .logo-publish-container {
    grid-area: logo !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    align-self: center !important;
    justify-self: stretch !important;
  }

  .header-search {
    grid-area: search !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch !important;
  }

  .header-country-chip,
  .header-categories-trigger,
  .header-account,
  .header-language,
  .header-mobile-search {
    display: none !important;
  }

  .site-header .publicar.header-publish {
    grid-area: publish !important;
    grid-column: 4 !important;
    grid-row: 1 !important;
    flex: 0 0 104px !important;
    flex-basis: 104px !important;
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    margin: 0 !important;
    padding-inline: 8px !important;
    align-self: center !important;
    justify-self: end !important;
  }

  .header-publish-wide {
    display: none;
  }

  .header-publish-narrow {
    display: inline;
  }

  .site-header > .categories {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: min(86vw, 390px) !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 88px 0 28px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    box-shadow: 8px 0 28px rgba(28, 43, 41, 0.20);
    transition: left 180ms ease !important;
  }

  .site-header > .categories.showMenu {
    left: 0 !important;
    display: flex !important;
  }
}

/* Phone: logo, menu, publish, and search fit on one compact row. */
@media only screen and (max-width: 699px) {
  :root {
    --clx-header-height: 66px;
  }

  .site-header-inner {
    width: calc(100% - 16px);
    grid-template-columns: 40px minmax(102px, 1fr) auto 40px;
    gap: 7px;
  }

  .header-menu-toggle,
  .header-mobile-search {
    display: grid !important;
  }

  .header-search,
  .header-country-chip,
  .header-categories-trigger,
  .header-account,
  .header-language {
    display: none !important;
  }

  .site-header .logo > img:first-child,
  .site-header .menu .logo img {
    max-height: 29px !important;
  }

  .site-header .publicar.header-publish {
    flex-basis: 82px !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    height: 38px !important;
    padding-inline: 8px !important;
    font-size: 11px;
  }

  .header-publish-wide {
    display: none;
  }

  .header-publish-narrow {
    display: inline;
  }

  .site-header > .categories {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: min(88vw, 360px) !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 78px 0 28px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    box-shadow: 8px 0 28px rgba(28, 43, 41, 0.20);
    transition: left 180ms ease !important;
  }

  .site-header > .categories.showMenu {
    left: 0 !important;
    display: flex !important;
  }

  .site-header > .categories .category-item {
    width: 100% !important;
  }

  .site-header > .categories .header-mobile-secondary {
    padding-block: 16px !important;
  }

  #popup-searchbar {
    box-sizing: border-box;
    position: fixed !important;
    z-index: 1200;
    top: calc(32px + var(--clx-header-height));
    left: 0;
    right: 0;
    width: 100% !important;
    height: auto !important;
    padding: 10px 9px !important;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--clx-header-border);
    box-shadow: 0 10px 20px rgba(28, 43, 41, 0.12);
  }

  #popup-searchbar .popup-search {
    box-sizing: border-box;
    width: min(100%, 620px) !important;
    height: 44px !important;
    margin: 0 auto !important;
    padding: 0 5px 0 12px !important;
    background: #f7f9fa;
    border: 1px solid #cfdadd;
    border-radius: 10px;
  }

  #popup-searchbar form {
    box-sizing: border-box;
    height: 100%;
    padding: 0 !important;
  }

  #popup-searchbar input {
    height: 100%;
    padding: 0 8px !important;
    color: var(--clx-header-text);
    opacity: 1 !important;
  }

  #popup-searchbar button {
    width: 36px;
    height: 36px;
    color: #ffffff !important;
    background: var(--clx-header-teal) !important;
    border-radius: 8px;
  }
}

.site-footer {
  box-sizing: border-box;
  min-height: 72px;
  padding: 20px max(18px, calc((100% - 1180px) / 2));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  color: var(--clx-header-muted);
  font-size: 11px;
}

.site-footer a:hover {
  color: var(--clx-header-teal-dark);
}
