/* IM_HELP_CHROME_FIXED_UNIFIED_V4_START
   Header/footer fijo unificado para ayuda.
   Instalación segura: HTML al final del body.
   No toca legal-pages.css.
*/

body {
  --im-help-v4-top-space: 88px;
  --im-help-v4-bottom-space: 86px;
  padding-top: calc(var(--im-help-v4-top-space) + env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(var(--im-help-v4-bottom-space) + env(safe-area-inset-bottom, 0px)) !important;
}

/* Ocultamos cromos antiguos solo en ayuda porque este CSS solo carga en ayuda */
.im-help-topic-topbar,
.im-help-hero__top.im-help-topbar,
header.im-help-topbar,
.im-help-topic-footer,
.im-help-footer {
  display: none !important;
}

/* Header */
.im-help-fixed-v4-header {
  position: fixed !important;
  top: max(12px, env(safe-area-inset-top, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 7000 !important;

  width: min(calc(100vw - 32px), 1180px) !important;
  min-height: 62px !important;
  padding: 10px 12px !important;

  display: grid !important;
  grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;

  border-radius: 24px !important;
  border: 1px solid rgba(226, 232, 240, .95) !important;
  background:
    radial-gradient(circle at 5% 30%, rgba(255, 87, 51, .10), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.95)) !important;
  box-shadow:
    0 20px 54px rgba(15, 23, 42, .13),
    0 1px 0 rgba(255,255,255,.92) inset !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  box-sizing: border-box !important;
}

.im-help-fixed-v4-brand,
.im-help-fixed-v4-footer-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  color: #0f172a !important;
  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: -.018em !important;
  white-space: nowrap !important;
}

.im-help-fixed-v4-logo {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 16px !important;
  color: #ff5733 !important;
  background:
    radial-gradient(circle at 30% 20%, #fff, #fff3ee),
    linear-gradient(135deg, rgba(255,87,51,.14), rgba(255,87,51,.04)) !important;
  border: 1px solid rgba(255,87,51,.20) !important;
  box-shadow: 0 12px 26px rgba(255,87,51,.12) !important;
}

.im-help-fixed-v4-logo svg {
  width: 22px !important;
  height: 22px !important;
}

.im-help-fixed-v4-nav,
.im-help-fixed-v4-actions,
.im-help-fixed-v4-footer-links {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

.im-help-fixed-v4-nav {
  justify-content: center !important;
}

.im-help-fixed-v4-actions {
  justify-content: flex-end !important;
}

.im-help-fixed-v4-nav::-webkit-scrollbar,
.im-help-fixed-v4-actions::-webkit-scrollbar,
.im-help-fixed-v4-footer-links::-webkit-scrollbar {
  display: none !important;
}

.im-help-fixed-v4-nav a,
.im-help-fixed-v4-actions a,
.im-help-fixed-v4-footer-links a {
  min-height: 38px !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 999px !important;
  color: #0f766e !important;
  background: rgba(15,118,110,.065) !important;
  border: 1px solid rgba(15,118,110,.14) !important;

  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.im-help-fixed-v4-nav a:hover,
.im-help-fixed-v4-actions a:hover,
.im-help-fixed-v4-footer-links a:hover {
  color: #0b5f59 !important;
  background: rgba(15,118,110,.105) !important;
  border-color: rgba(15,118,110,.24) !important;
}

.im-help-fixed-v4-actions a:last-child {
  color: #fff !important;
  background: linear-gradient(135deg, #ff6a3d, #ff3f32) !important;
  border-color: rgba(255,87,51,.42) !important;
  box-shadow: 0 14px 28px rgba(255,87,51,.18) !important;
}

/* Footer */
.im-help-fixed-v4-footer {
  position: fixed !important;
  left: 50% !important;
  bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
  transform: translateX(-50%) !important;
  z-index: 6990 !important;

  width: min(calc(100vw - 32px), 1180px) !important;
  min-height: 60px !important;
  padding: 10px 12px !important;

  display: grid !important;
  grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;

  border-radius: 24px !important;
  border: 1px solid rgba(226,232,240,.95) !important;
  background:
    radial-gradient(circle at 5% 50%, rgba(255,87,51,.075), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.95)) !important;
  box-shadow:
    0 -18px 48px rgba(15,23,42,.11),
    0 1px 0 rgba(255,255,255,.92) inset !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  box-sizing: border-box !important;
}

.im-help-fixed-v4-footer-links {
  justify-content: center !important;
}

.im-help-fixed-v4-copy {
  color: #64748b !important;
  font-size: 12.5px !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
}

/* Botón IA por encima del footer */
.im-help-assistant-launcher,
.im-help-assistant-button,
[data-help-assistant-launcher] {
  bottom: 104px !important;
}

/* Responsive */
@media (max-width: 900px) {
  body {
    --im-help-v4-top-space: 126px;
    --im-help-v4-bottom-space: 96px;
  }

  .im-help-fixed-v4-header {
    width: min(calc(100vw - 18px), 1180px) !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 8px !important;
    border-radius: 22px !important;
  }

  .im-help-fixed-v4-nav,
  .im-help-fixed-v4-actions {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .im-help-fixed-v4-footer {
    width: min(calc(100vw - 18px), 1180px) !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    border-radius: 22px !important;
  }

  .im-help-fixed-v4-footer-brand,
  .im-help-fixed-v4-copy {
    display: none !important;
  }

  .im-help-fixed-v4-footer-links {
    width: 100% !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 520px) {
  body {
    --im-help-v4-top-space: 132px;
    --im-help-v4-bottom-space: 86px;
  }

  .im-help-fixed-v4-brand {
    font-size: 14px !important;
  }

  .im-help-fixed-v4-logo {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  .im-help-fixed-v4-nav a,
  .im-help-fixed-v4-actions a,
  .im-help-fixed-v4-footer-links a {
    min-height: 34px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }
}

/* IM_HELP_CHROME_FIXED_UNIFIED_V4_END */


/* IM_HELP_CHROME_FULL_WIDTH_V4B_START
   Header y footer de ayuda a pantalla completa.
   Arriba y abajo pegados al borde, sin formato de pastilla flotante.
*/
body {
  --im-help-v4-top-space: 68px !important;
  --im-help-v4-bottom-space: 66px !important;
}

/* Header full width */
.im-help-fixed-v4-header {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;

  width: 100vw !important;
  max-width: none !important;
  min-height: 66px !important;
  height: 66px !important;

  padding: 0 max(24px, calc((100vw - 1180px) / 2)) !important;

  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;

  background:
    radial-gradient(circle at 4% 45%, rgba(255, 87, 51, .09), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.985), rgba(248,250,252,.965)) !important;

  box-shadow:
    0 10px 30px rgba(15, 23, 42, .10),
    0 1px 0 rgba(255,255,255,.92) inset !important;
}

/* Footer full width */
.im-help-fixed-v4-footer {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: none !important;

  width: 100vw !important;
  max-width: none !important;
  min-height: 64px !important;
  height: 64px !important;

  padding: 0 max(24px, calc((100vw - 1180px) / 2)) !important;

  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;

  background:
    radial-gradient(circle at 4% 50%, rgba(255, 87, 51, .07), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.985), rgba(248,250,252,.965)) !important;

  box-shadow:
    0 -10px 30px rgba(15, 23, 42, .09),
    0 1px 0 rgba(255,255,255,.92) inset !important;
}

/* Contenido interno más limpio */
.im-help-fixed-v4-header,
.im-help-fixed-v4-footer {
  grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto !important;
  gap: 18px !important;
}

.im-help-fixed-v4-nav,
.im-help-fixed-v4-footer-links {
  justify-content: center !important;
}

.im-help-fixed-v4-actions {
  justify-content: flex-end !important;
}

/* Botones más finos para barra completa */
.im-help-fixed-v4-nav a,
.im-help-fixed-v4-actions a,
.im-help-fixed-v4-footer-links a {
  min-height: 34px !important;
  padding: 0 13px !important;
  font-size: 12.5px !important;
}

.im-help-fixed-v4-logo {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 14px !important;
}

/* Ajuste del botón IA flotante para no tapar footer */
.im-help-assistant-launcher,
.im-help-assistant-button,
[data-help-assistant-launcher] {
  bottom: 84px !important;
}

/* Tablet/móvil: también full width, pero con scroll horizontal en nav */
@media (max-width: 900px) {
  body {
    --im-help-v4-top-space: 112px !important;
    --im-help-v4-bottom-space: 82px !important;
  }

  .im-help-fixed-v4-header {
    width: 100vw !important;
    height: auto !important;
    min-height: 104px !important;
    padding: 10px 14px !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    border-radius: 0 !important;
  }

  .im-help-fixed-v4-footer {
    width: 100vw !important;
    height: auto !important;
    min-height: 74px !important;
    padding: 10px 14px !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    border-radius: 0 !important;
  }

  .im-help-fixed-v4-nav,
  .im-help-fixed-v4-actions,
  .im-help-fixed-v4-footer-links {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .im-help-fixed-v4-footer-brand,
  .im-help-fixed-v4-copy {
    display: none !important;
  }
}

@media (max-width: 520px) {
  body {
    --im-help-v4-top-space: 118px !important;
    --im-help-v4-bottom-space: 76px !important;
  }

  .im-help-fixed-v4-header,
  .im-help-fixed-v4-footer {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .im-help-fixed-v4-nav a,
  .im-help-fixed-v4-actions a,
  .im-help-fixed-v4-footer-links a {
    min-height: 32px !important;
    padding: 0 9px !important;
    font-size: 12px !important;
  }
}
/* IM_HELP_CHROME_FULL_WIDTH_V4B_END */


/* IM_HELP_HEADER_MOBILE_HAMBURGER_V4C_START
   En móvil se muestra solo "IslaMarket ayuda" + hamburguesa.
   El resto del menú queda oculto hasta tocar el botón.
*/

.im-help-fixed-v4-menu-btn {
  display: none !important;
}

/* Desktop: todo visible, sin hamburguesa */
@media (min-width: 901px) {
  .im-help-fixed-v4-header {
    height: 66px !important;
    min-height: 66px !important;
  }

  .im-help-fixed-v4-nav,
  .im-help-fixed-v4-actions {
    display: inline-flex !important;
  }
}

/* Mobile/tablet */
@media (max-width: 900px) {
  body {
    --im-help-v4-top-space: 72px !important;
  }

  .im-help-fixed-v4-header {
    height: 64px !important;
    min-height: 64px !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    grid-template-areas:
      "brand menu"
      "nav nav"
      "actions actions" !important;

    align-items: center !important;
    gap: 0 !important;
    padding: 8px 12px !important;
    overflow: visible !important;
  }

  .im-help-fixed-v4-brand {
    grid-area: brand !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .im-help-fixed-v4-brand span:last-child {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .im-help-fixed-v4-menu-btn {
    grid-area: menu !important;

    width: 42px !important;
    height: 42px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;

    justify-self: end !important;

    border-radius: 15px !important;
    border: 1px solid rgba(15, 118, 110, .16) !important;
    background: rgba(15, 118, 110, .065) !important;
    color: #0f766e !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .06) !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .im-help-fixed-v4-menu-btn span {
    width: 18px !important;
    height: 2px !important;
    display: block !important;
    border-radius: 999px !important;
    background: currentColor !important;
    transition: transform .18s ease, opacity .18s ease !important;
  }

  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-menu-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }

  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-menu-btn span:nth-child(2) {
    opacity: 0 !important;
  }

  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-menu-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* Oculto por defecto en móvil */
  .im-help-fixed-v4-nav,
  .im-help-fixed-v4-actions {
    display: none !important;
  }

  /* Desplegado */
  .im-help-fixed-v4-header.is-menu-open {
    height: auto !important;
    min-height: 64px !important;
    padding-bottom: 12px !important;
    box-shadow:
      0 22px 60px rgba(15, 23, 42, .16),
      0 1px 0 rgba(255,255,255,.92) inset !important;
  }

  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-nav {
    grid-area: nav !important;
    margin-top: 10px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(226, 232, 240, .9) !important;

    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow-x: auto !important;
  }

  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-actions {
    grid-area: actions !important;
    margin-top: 8px !important;

    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow-x: auto !important;
  }

  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-nav a,
  .im-help-fixed-v4-header.is-menu-open .im-help-fixed-v4-actions a {
    min-height: 36px !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
  }
}

@media (max-width: 520px) {
  body {
    --im-help-v4-top-space: 70px !important;
  }

  .im-help-fixed-v4-header {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .im-help-fixed-v4-logo {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
  }

  .im-help-fixed-v4-brand {
    font-size: 14px !important;
  }
}

/* IM_HELP_HEADER_MOBILE_HAMBURGER_V4C_END */


/* IM_HELP_HIDE_PUBLIC_CHROME_V4E_START
   En ayuda.islamarket.es solo debe verse el nuevo header/footer V4.
   Oculta header/footer público de la web si alguna página como /contacto o /privacidad los trae.
   No toca legal-pages.css.
*/

/* Header/footer público directo del layout */
body > header:not(.im-help-fixed-v4-header),
body > footer:not(.im-help-fixed-v4-footer) {
  display: none !important;
}

/* Headers/footers públicos habituales */
.site-header,
.site-footer,
.im-site-header,
.im-site-footer,
.public-header,
.public-footer,
.main-header,
.main-footer,
.app-header,
.app-footer,
.cn-site-header,
.cn-site-footer,
.isla-site-header,
.isla-site-footer,
.islamarket-site-header,
.islamarket-site-footer,
.layout-header,
.layout-footer,
.web-header,
.web-footer,
#site-header,
#site-footer,
#main-header,
#main-footer {
  display: none !important;
}

/* Barras/nav públicos que no deben convivir con el header de ayuda */
.public-fixed-nav,
.public-fixed-nav-force,
.im-public-nav,
.im-main-nav,
.site-nav,
.main-nav,
.web-nav,
.navbar:not(.im-help-fixed-v4-nav),
.header-nav:not(.im-help-fixed-v4-nav) {
  display: none !important;
}

/* Mantener visibles los elementos del nuevo chrome */
.im-help-fixed-v4-header,
.im-help-fixed-v4-header *,
.im-help-fixed-v4-footer,
.im-help-fixed-v4-footer * {
  visibility: visible !important;
}

/* Si alguna página pública dejó margen por su header antiguo, lo normalizamos */
body {
  scroll-padding-top: 84px !important;
}

/* IM_HELP_HIDE_PUBLIC_CHROME_V4E_END */


/* IM_HELP_FOOTER_X_SOCIAL_V4G_START
   Red social X en el lado derecho del footer de ayuda.
*/
.im-help-fixed-v4-social-right {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
}

.im-help-fixed-v4-social-right .im-help-fixed-v4-copy {
  color: #64748b !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.im-help-fixed-v4-x {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 999px !important;
  color: #0f172a !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.94)) !important;
  border: 1px solid rgba(203, 213, 225, .95) !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, .08),
    0 1px 0 rgba(255,255,255,.92) inset !important;

  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1 !important;

  transition:
    transform .16s ease,
    color .16s ease,
    border-color .16s ease,
    background-color .16s ease,
    box-shadow .16s ease !important;
}

.im-help-fixed-v4-x:hover {
  transform: translateY(-1px) !important;
  color: #ffffff !important;
  background: #0f172a !important;
  border-color: rgba(15, 23, 42, .9) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .16) !important;
}

/* Mantenerlo en el lado derecho en desktop */
@media (min-width: 901px) {
  .im-help-fixed-v4-footer {
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr) minmax(110px, auto) !important;
  }

  .im-help-fixed-v4-social-right {
    justify-self: end !important;
  }
}

/* En móvil no saturamos el footer: dejamos solo enlaces principales */
@media (max-width: 900px) {
  .im-help-fixed-v4-social-right {
    display: none !important;
  }
}
/* IM_HELP_FOOTER_X_SOCIAL_V4G_END */


/* IM_HELP_FOOTER_X_MOBILE_V4H_START
   Mostrar X también en móvil, compacto a la derecha del footer.
*/
@media (max-width: 900px) {
  body {
    --im-help-v4-bottom-space: 82px !important;
  }

  .im-help-fixed-v4-footer {
    height: 68px !important;
    min-height: 68px !important;
    padding: 8px 10px !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    grid-template-areas: "links social" !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .im-help-fixed-v4-footer-links {
    grid-area: links !important;
    width: 100% !important;
    min-width: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;

    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .im-help-fixed-v4-footer-links::-webkit-scrollbar {
    display: none !important;
  }

  .im-help-fixed-v4-footer-links a {
    min-height: 34px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .im-help-fixed-v4-social-right {
    grid-area: social !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 42px !important;
    min-width: 42px !important;
    gap: 0 !important;
  }

  .im-help-fixed-v4-social-right .im-help-fixed-v4-copy {
    display: none !important;
  }

  .im-help-fixed-v4-x {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    font-size: 15px !important;
  }
}

@media (max-width: 420px) {
  .im-help-fixed-v4-footer {
    grid-template-columns: minmax(0, 1fr) 40px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .im-help-fixed-v4-footer-links a {
    min-height: 32px !important;
    padding: 0 9px !important;
    font-size: 11.5px !important;
  }

  .im-help-fixed-v4-social-right {
    width: 40px !important;
    min-width: 40px !important;
  }

  .im-help-fixed-v4-x {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
  }
}
/* IM_HELP_FOOTER_X_MOBILE_V4H_END */

