/* ArteBianco 0.6.2 - BARRA INFERIOR MOVIL PUBLICA
 * En ordenador: se conserva exactamente el comportamiento 0.5.0.
 * No se modifica el footer legal ni su contenido.
 */
#abcr-bottom-nav[hidden], #abcr-search-preview-panel[hidden] { display: none !important; }
#abcr-bottom-nav, #abcr-search-preview-panel { display: none !important; }

@media screen and (max-width: 778px) {
  /* Scroll hasta el final incluso con la barra fija; incluye zona segura iOS. */
  body.abcr-bottom-active {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Solo desaparecen el buscador y carrito ORIGINALES de la cabecera The7.
     No ocultamos la cabecera, el logo ni la hamburguesa. */
  body.abcr-bottom-active .abcr-original-search-hide,
  body.abcr-bottom-active .mobile-header-bar .mini-search,
  body.abcr-bottom-active .mobile-header .mini-search,
  body.abcr-bottom-active .mobile-header-bar .wc-ico-cart,
  body.abcr-bottom-active .mobile-header .wc-ico-cart {
    display: none !important;
  }

  /* Joinchat sigue cargado y su enlace #whatsapp sigue funcionando.
     Ocultamos SOLO su boton flotante para evitar doble acceso. */
  body.abcr-bottom-active .joinchat__button,
  body.abcr-bottom-active .joinchat__button-wrapper {
    display: none !important;
  }

  /* Buscador superior siempre visible, inmediatamente debajo de la cabecera. */
  body.abcr-bottom-active #abcr-search-preview-panel:not([hidden]) {
    display: block !important;
    position: relative;
    z-index: 13;
    width: 100%;
    margin: 0;
    padding: 9px 14px 10px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #ededf0;
  }
  #abcr-search-preview-panel form {
    display: flex;
    width: 100%;
    height: 46px;
    margin: 0;
    align-items: center;
    border: 1px solid #d9dce2;
    border-radius: 13px;
    overflow: hidden;
    background: #f8f8f9;
  }
  #abcr-search-preview-panel .abcr-search-preview-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  #abcr-search-preview-panel input[type="search"] {
    width: 1%;
    min-width: 0;
    flex: 1 1 auto;
    height: 100%;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #26282c !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  #abcr-search-preview-panel input[type="search"]::placeholder {
    color: #858992;
    opacity: 1;
  }
  #abcr-search-preview-panel .abcr-search-preview-submit {
    flex: 0 0 48px;
    width: 48px;
    height: 100%;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #bd1469 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  #abcr-search-preview-panel .abcr-search-preview-submit:focus-visible {
    outline: 2px solid #bd1469;
    outline-offset: -3px;
  }

  /* Barra inferior independiente del footer tradicional de WordPress. */
  body.abcr-bottom-active #abcr-bottom-nav:not([hidden]) {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding: 3px 12px calc(3px + env(safe-area-inset-bottom, 0px));
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    box-sizing: border-box;
    background: #fff;
    border-top: 1px solid #e7e7eb;
    box-shadow: 0 -3px 14px rgba(0,0,0,.07);
    z-index: 10005;
  }
  #abcr-bottom-nav *, #abcr-bottom-nav *::before,
  #abcr-bottom-nav *::after { box-sizing: border-box; }
  #abcr-bottom-nav .abcr-bottom-action {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 6px;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    border-radius: 12px;
    box-shadow: none !important;
    color: #161616 !important;
    text-decoration: none !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  #abcr-bottom-nav .abcr-bottom-action:focus-visible {
    outline: 2px solid #bd1469;
    outline-offset: -2px;
  }
  #abcr-bottom-nav .abcr-bottom-action > svg,
  #abcr-bottom-nav .abcr-cart-wrap > svg {
    display: block;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    stroke: currentColor;
    fill: none;
  }
  #abcr-bottom-nav .abcr-cart-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #abcr-bottom-nav .abcr-bottom-count {
    position: absolute;
    top: -8px;
    right: -12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    background: #111;
    color: #fff !important;
    border-radius: 99px;
    font: 600 11px/1 Arial,sans-serif;
    white-space: nowrap;
  }
  #abcr-bottom-nav .abcr-bottom-count.is-empty { display: none; }

  /* Mientras se escribe con el teclado virtual, no tapar formularios/pago. */
  body.abcr-bottom-keyboard #abcr-bottom-nav { display: none !important; }
  body.abcr-bottom-keyboard { padding-bottom: 0 !important; }
}

/* ArteBianco 0.6.3: verde oficial SOLO para el icono WhatsApp inferior. */
@media screen and (max-width: 778px) {
  body.abcr-bottom-active #abcr-bottom-nav .abcr-bottom-action.abcr-joinchat {
    color: #25D366 !important;
  }
}
