/**
 * Ajustes mÃ³viles / PWA.
 * Se carga despuÃ©s de todas las hojas del tema (ver inc/enqueue.php).
 */

.doro-notice-hidden,
body .woocommerce-message.doro-notice-hidden,
body .woocommerce-info.doro-notice-hidden {
    display: none !important;
}

/* CookieYes: botÃ³n "revisar consentimiento" a la derecha para no chocar con el carrito flotante */
.cky-btn-revisit-wrapper {
    left: auto !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ================================================================
   Barra fija de compra (ficha de producto, mÃ³vil)
   ================================================================ */
.doro-mobile-buybar {
    display: none;
}

@media (max-width: 900px) {
    .doro-mobile-buybar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10040;
        display: flex;
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid #ececec;
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
        transform: translateY(110%);
        visibility: hidden;
        transition: transform 0.22s ease, visibility 0s linear 0.22s;
    }

    .doro-mobile-buybar.is-visible {
        transform: translateY(0);
        visibility: visible;
        transition: transform 0.22s ease, visibility 0s;
    }

    .doro-mobile-buybar__btn {
        flex: 1 1 0;
        min-width: 0;
        height: 46px;
        padding: 0 10px;
        border: none;
        border-radius: 999px;
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        cursor: pointer;
    }

    .doro-mobile-buybar__btn--cart {
        background: var(--color-orange, #fa7311);
        color: #fff;
    }

    .doro-mobile-buybar__btn--buy {
        background: var(--color-dark, #111);
        color: #fff;
    }

    body.has-mobile-buybar {
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    }

    body.has-mobile-buybar .site-fab-cart {
        display: none !important;
    }

    body.has-mobile-buybar .cky-btn-revisit-wrapper {
        bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ================================================================
   Tienda y categorÃ­as: filtros en una sola fila deslizable
   ================================================================ */
@media (max-width: 900px) {
    .doro-shop__sidebar,
    .doro-category__filters-card {
        flex-wrap: nowrap !important;
        align-items: center;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        padding: 2px 0 !important;
        margin: 0 0 10px !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .doro-shop__sidebar::-webkit-scrollbar,
    .doro-category__filters-card::-webkit-scrollbar {
        display: none;
    }

    .doro-filter-chip {
        height: 34px;
        background: var(--color-white, #fff);
    }

    .doro-filter-chip.is-active,
    .doro-shop__widget.is-open > .doro-filter-chip,
    .doro-shop__filter-list a.is-active,
    .doro-shop__filter-list a[aria-current="true"] {
        background: #fff5ef;
    }

    .doro-shop__toolbar {
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 10px !important;
        margin-bottom: 10px;
    }

    .doro-shop__toolbar .woocommerce-result-count {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0 !important;
        font-size: 12px;
        line-height: 1.3;
    }

    .doro-shop__toolbar .woocommerce-ordering {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 55%;
        margin: 0 !important;
    }

    .doro-shop__toolbar .woocommerce-ordering select {
        width: 100%;
        height: 38px;
        padding: 0 28px 0 10px;
        border-radius: 8px;
        text-overflow: ellipsis;
    }
}

/* ================================================================
   Formularios: 16px evita el zoom automÃ¡tico de iOS / PWA al enfocar
   ================================================================ */
@media (max-width: 900px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    input:not([type]),
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ================================================================
   Generales mÃ³vil
   ================================================================ */
@media (max-width: 768px) {
    /* Carrito flotante con margen de zona segura */
    .site-fab-cart {
        left: 14px !important;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        width: 50px;
        height: 50px;
    }

    .site-fab-cart__count {
        top: 4px;
        right: 4px;
    }

    body:has(.site-fab-cart) .doro-geo-banner {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    /* Objetivos tÃ¡ctiles de cabecera (cÃ¡mara + lupa en el pill unificado) */
    .site-header__visual-search {
        display: flex !important;
        visibility: visible !important;
        position: static;
        right: auto;
        opacity: 1 !important;
    }

    .site-header__visual-search-btn {
        display: inline-flex !important;
        visibility: visible !important;
    }

    .site-header__search-submit {
        position: static;
        right: auto;
    }

    .site-header__utility--cart {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
        position: relative;
    }

    .site-header__utility--cart .site-header__cart-count {
        position: absolute !important;
        top: -10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: transparent !important;
        background-color: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        color: #fa7311 !important;
        font-size: 14px !important;
        border-radius: 0 !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    .site-header__utility-btn {
        min-width: 40px;
        min-height: 40px;
    }

    /* Puntos y flechas de carruseles: Ã¡rea tÃ¡ctil mayor sin cambiar el aspecto */
    .home-hero__dot,
    .home-categories__dot,
    .doro-related-carousel__dot {
        position: relative;
    }

    .home-hero__dot::after,
    .home-categories__dot::after,
    .doro-related-carousel__dot::after {
        content: "";
        position: absolute;
        inset: -10px -5px;
    }

    .home-categories--nav-circle .home-categories__arrow {
        width: 34px;
        height: 34px;
    }

    /* CÃ©ntimos del precio legibles */
    .woocommerce-Price-cents,
    del .woocommerce-Price-cents {
        font-size: max(0.62em, 9px) !important;
    }

    /* Avisos WooCommerce: icono en lÃ­nea con el texto */
    .single-product .woocommerce-message,
    .woocommerce-checkout .woocommerce-message,
    .woocommerce-checkout .woocommerce-info,
    .woocommerce-cart .woocommerce-message,
    .woocommerce-cart .woocommerce-info {
        display: grid !important;
        grid-template-columns: 28px minmax(0, 1fr);
        align-items: center;
        gap: 8px 10px !important;
        padding: 12px !important;
        font-size: 14px;
        line-height: 1.4;
    }

    .single-product .woocommerce-message a.button,
    .single-product .woocommerce-message a.wc-forward,
    .woocommerce-checkout .woocommerce-message a.button,
    .woocommerce-cart .woocommerce-message a.button {
        grid-column: 1 / -1;
        justify-self: stretch;
        margin: 0 !important;
        float: none !important;
    }

    /* Pie: enlaces con altura tÃ¡ctil y sin desbordar */
    .site-footer__links a {
        margin-bottom: 0;
        padding: 7px 0;
    }

    .site-footer__domains-list a {
        display: inline-block;
        padding: 6px 0;
    }

    .site-footer__copy,
    .site-footer__legal {
        max-width: 100%;
        flex-wrap: wrap;
        overflow-wrap: anywhere;
    }

    .site-footer__legal a {
        display: inline-block;
        padding: 6px 0;
    }

    .site-footer {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    /* Ficha de producto */
    .doro-product__breadcrumb,
    .single-product .woocommerce-breadcrumb {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
    }

    /* Cesta */
    .doro-cesta-coupon {
        flex: 0 0 auto !important;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    .doro-cesta-coupon .input-text {
        width: auto;
    }

    .doro-cesta-actions {
        padding: 10px;
    }

    .doro-cesta__main {
        padding: 12px;
    }

    /* PÃ¡ginas, cesta y checkout: menos mÃ¡rgenes laterales anidados */
    .doro-page__container,
    .woocommerce-checkout .doro-page__container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .doro-checkout-card {
        padding: 16px 14px;
    }

    .woocommerce-checkout #payment ul.payment_methods {
        padding: 0;
    }

    .woocommerce-checkout #payment ul.payment_methods li.wc_payment_method {
        padding: 12px;
    }

    .doro-checkout-helpers {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 8px;
    }

    .doro-checkout-products tr.cart_item {
        grid-template-columns: 64px minmax(0, 1fr) auto;
        grid-template-areas: "thumb name total";
        align-items: center;
    }

    .doro-checkout-products .product-thumbnail img,
    .doro-checkout-products .product-thumbnail .attachment-thumbnail,
    .doro-checkout-products .product-thumbnail .wp-post-image {
        width: 64px !important;
        margin: 0;
        border-radius: 8px;
    }
}

@media (max-width: 400px) {
    .site-header__search input,
    .site-header__search-input {
        padding-right: 44px;
    }
}
