/* Shared header/footer parity across every public page. */
header .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding-block: .9rem;
}
header .brand img {
  display: block;
  height: auto;
  max-height: 68px;
  max-width: min(34vw, 320px);
  width: auto;
  border-radius: 0;
}
header .header-search {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: .35rem;
  flex: 0 1 340px;
  max-width: 340px;
  min-width: 280px;
  position: relative;
}
header .header-search input {
  width: 100%;
  height: 44px !important;
  padding: .7rem 3rem .7rem 1rem;
  font-size: .95rem;
}
footer nav a {
  padding: .5rem .1rem;
  line-height: 1.5;
}
header nav { margin-left: auto; }

footer {
  padding: 1.4rem 0 2.5rem;
  font-size: .88rem;
  line-height: 1.5;
}
footer .footer-shell {
  display: grid;
  gap: 1rem;
  justify-items: center;
}
footer .social-block {
  display: flex;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
footer .footer-about-links {
  display: grid;
  grid-auto-flow: column;
  gap: .45rem 1rem;
  justify-content: start;
  align-items: center;
  width: min(100%, 46rem);
  margin: 0 auto;
}
footer .footer-bottom {
  display: grid;
  justify-items: center;
  gap: .75rem;
}
footer .footer-legal {
  display: grid;
  grid-auto-flow: column;
  gap: .45rem 1rem;
  justify-content: start;
  align-items: center;
  width: min(100%, 46rem);
  margin: 0 auto;
}
footer .footer-copy {
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 860px) {
  header .nav {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) auto !important;
    align-items: center;
    column-gap: .55rem;
    row-gap: .7rem;
    min-height: auto;
    padding: .7rem .95rem;
    position: relative;
  }
  header .brand {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
  }
  header .brand img {
    height: auto !important;
    max-height: 46px !important;
    max-width: min(42vw, 170px) !important;
  }
  header .header-search {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: block;
    min-width: 0;
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    justify-self: stretch;
  }
  header .header-search input {
    width: 100%;
    height: 36px !important;
    min-height: 0 !important;
    padding: .55rem .8rem !important;
    font-size: .78rem !important;
  }
  header .header-search button { display: none !important; }
  header .menu-toggle {
    display: inline-flex !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end;
    position: relative !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  header .menu-toggle-line { width: 15px !important; }
  header nav {
    grid-column: 1 / -1 !important;
    width: 100%;
    margin: 0;
    display: none;
  }
  header .nav.menu-open nav { display: block; }
  header nav ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .45rem;
    padding: .45rem 0 .1rem;
  }
  header nav a { display: block; padding: .8rem .1rem; }
}

@media (max-width: 680px) {
  header .nav { grid-template-columns: 28px minmax(0, 1fr) 36px !important; padding-block: .72rem; }
  header .brand img { max-height: 54px !important; max-width: min(52vw, 240px) !important; }
  header .header-search input { height: 38px !important; padding: .6rem .9rem !important; font-size: .82rem !important; }
  header .menu-toggle { width: 36px !important; height: 36px !important; border-radius: 12px !important; }
  header .menu-toggle-line { width: 15px !important; }
}

@media (max-width: 420px) {
  header .nav { grid-template-columns: 48px minmax(0, 1fr) 32px !important; column-gap: .42rem; padding-left: .8rem; padding-right: .8rem; }
  header .brand img { max-height: 40px !important; max-width: min(43vw, 150px) !important; }
  header .header-search input { height: 34px !important; padding: .5rem .68rem !important; font-size: .74rem !important; }
  header .menu-toggle { width: 32px !important; height: 32px !important; border-radius: 10px !important; }
  header .menu-toggle-line { width: 13px !important; }
}

@media (max-width: 720px) {
  footer nav a { padding: .7rem .1rem; }
  footer .footer-shell { gap: .7rem; }
  footer .footer-about { text-align: center; }
  footer .footer-about-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    width: 100%;
  }
  footer .footer-bottom { gap: .55rem; }
  footer .footer-copy { white-space: normal; text-align: center; }
  footer .footer-legal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2rem .65rem;
    width: 100%;
  }
}

/* Mobile header: keep logo, search and menu on one line. */
@media (max-width: 860px) {
  header .nav {
    grid-template-columns: 48px minmax(0, 1fr) 36px !important;
    grid-template-rows: 1fr !important;
    row-gap: .7rem !important;
  }
  header .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  header .menu-toggle {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }
  header .header-search {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 420px) {
  header .nav {
    grid-template-columns: 48px minmax(0, 1fr) 32px !important;
  }
}

/* Mobile: remove carousel arrows from featured, catalog and authors. */
@media (max-width: 860px) {
  .novedad .shelf-controls,
  .catalog-section-home .shelf-controls,
  .authors .shelf-controls {
    display: none !important;
  }
}

/* Desktop: keep featured and authors controls aligned to their carousels. */
@media (min-width: 861px) {
  .catalog-section-home .shelf-controls {
    display: none !important;
  }
  .novedad .shelf-controls,
  .authors .shelf-controls {
    display: flex !important;
    position: absolute !important;
    inset: 50% 0 auto 0 !important;
    transform: translateY(-50%) !important;
    z-index: 3;
  }
  .novedad .shelf-button:first-child,
  .authors .shelf-button:first-child {
    transform: translate(-16px, -50%) !important;
  }
  .novedad .shelf-button:last-child,
  .authors .shelf-button:last-child {
    transform: translate(16px, -50%) !important;
  }
}
