/* =========================================================
   Modular Bonito 1.5.9 · Ajustes finales de publicación
   Capa visual y de textos. No altera formularios ni precios.
   ========================================================= */

/* Marca compacta. */
#ubd-modular-bonito .ubd-mod-brand strong,
.ubd-catalog-shell-header .ubd-catalog-shell-brand strong {
    white-space: nowrap !important;
}

/* =========================================================
   HOME · Slides a altura completa y pegados a la derecha
   ========================================================= */
html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-media {
    place-items: stretch end !important;
}

html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-media > a {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
}

html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-media img.ubd-hero-slide {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    display: block !important;
    width: auto !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: right center !important;
    transform: none !important;
}

@media (min-width: 700px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-copy {
        width: min(50%, 650px) !important;
        padding-right: clamp(14px, 2vw, 30px) !important;
    }
}

/* Rotación opcional: slide 2 únicamente si existe. */
#ubd-modular-bonito .ubd-mod-hero-media .ubd-hero-slide {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity .65s ease, visibility .65s ease !important;
}
#ubd-modular-bonito .ubd-mod-hero-media .ubd-hero-slide.is-active {
    opacity: 1 !important;
    visibility: visible !important;
}
@media (prefers-reduced-motion: reduce) {
    #ubd-modular-bonito .ubd-mod-hero-media .ubd-hero-slide { transition: none !important; }
}

@media (max-width: 699px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-media {
        position: relative !important;
        min-height: clamp(280px, 92vw, 500px) !important;
        overflow: hidden !important;
    }
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-media > a {
        position: absolute !important;
        inset: 0 !important;
        min-height: 100% !important;
    }
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-media img.ubd-hero-slide {
        object-position: right bottom !important;
    }
}

/* HOME sencillo: solo se oculta lo solicitado. */
html.ubd-mode-simple #ubd-modular-bonito .ubd-mod-search,
html.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-copy > .ubd-mod-hero-chips > a:first-child,
html.ubd-mode-simple #ubd-modular-bonito .ubd-mod-intro-heading {
    display: none !important;
}
html.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-copy {
    gap: 13px !important;
}

/* =========================================================
   CATEGORÍA · Descripción visible y compacta en modo experto
   ========================================================= */
html.ubd-category-ready body#category {
    overflow-anchor: none !important;
}

html.ubd-category-ready:not(.ubd-catalog-simple) body#category .tv-category-block-wrapper {
    display: grid !important;
    margin-bottom: 12px !important;
    border-radius: 18px !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category #category-description {
    display: block !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category #ubd-simple-category-description {
    display: none !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category .tv-category-cover {
    min-height: 86px !important;
    padding: 12px !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category .tv-category-cover img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category #category-description > article {
    padding: clamp(13px, 2.2vw, 20px) !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category #category-description h1 {
    margin-bottom: 7px !important;
    font-size: clamp(27px, 4.2vw, 42px) !important;
    line-height: .96 !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category #category-description h2 {
    margin: 10px 0 5px !important;
    font-size: 15px !important;
}
html.ubd-category-ready:not(.ubd-catalog-simple) body#category #category-description p {
    margin: 0 0 7px !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
}

/* En sencillo la portada/descripcion de categoría permanece fuera para conservar la vista ligera. */
html.ubd-category-ready.ubd-catalog-simple body#category .tv-category-block-wrapper,
html.ubd-category-ready.ubd-catalog-simple body#category #category-description,
html.ubd-category-ready.ubd-catalog-simple body#category #ubd-simple-category-description {
    display: none !important;
}

html.ubd-category-ready body#category #js-product-list,
html.ubd-category-ready body#category #js-product-list .products {
    overflow-anchor: none !important;
}

/* =========================================================
   CATEGORÍA · Solo queda Ordenar por
   ========================================================= */
html.ubd-category-ready body#category .products-selection {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    min-height: 0 !important;
    padding: 8px !important;
}
html.ubd-category-ready body#category .products-selection.ubd-toolbar-sort-only > * {
    display: none !important;
}
html.ubd-category-ready body#category .products-selection.ubd-toolbar-sort-only > .ubd-sort-column {
    display: block !important;
    width: min(100%, 360px) !important;
    max-width: 360px !important;
    margin-left: auto !important;
}
html.ubd-category-ready body#category .tv-left-search-totle-product,
html.ubd-category-ready body#category .tv_search_filter_wrapper,
html.ubd-category-ready body#category .tv-total-product,
html.ubd-category-ready body#category .tvcmsproduct-grid-list,
html.ubd-category-ready body#category .tvproduct-view,
html.ubd-category-ready body#category #search_filter_toggler,
html.ubd-category-ready body#category .filter-button {
    display: none !important;
}
html.ubd-category-ready body#category .products-selection .sort-by-row {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-end !important;
}
html.ubd-category-ready body#category .products-selection .products-sort-order {
    width: min(100%, 270px) !important;
}

/* =========================================================
   PRODUCTOS NUEVOS · Etiqueta limpia, sin cuadro negro detrás
   ========================================================= */
html.ubd-category-ready body#category #js-product-list .product-flags,
html.ubd-category-ready body#category #js-product-list .product-flags::before,
html.ubd-category-ready body#category #js-product-list .product-flags::after {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    content: none !important;
}
html.ubd-category-ready body#category #js-product-list .product-flag,
html.ubd-category-ready body#category #js-product-list .product-flag.new,
html.ubd-category-ready body#category #js-product-list .product-flag.new-product {
    border: 0 !important;
    outline: 0 !important;
    background: rgba(255,255,255,.92) !important;
    box-shadow: 0 5px 14px rgba(24,51,58,.10) !important;
}
html.ubd-category-ready body#category #js-product-list .product-flag::before,
html.ubd-category-ready body#category #js-product-list .product-flag::after,
html.ubd-category-ready body#category #js-product-list .product-flag.new::before,
html.ubd-category-ready body#category #js-product-list .product-flag.new::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* =========================================================
   PRODUCTO SENCILLO · Descripción plegada por defecto
   ========================================================= */
html.ubd-product-ready.ubd-catalog-simple body#product #ubd-simple-product-description {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden !important;
}
html.ubd-product-ready.ubd-catalog-simple body#product #ubd-simple-product-description summary {
    display: flex !important;
}
html.ubd-product-ready:not(.ubd-catalog-simple) body#product #ubd-simple-product-description {
    display: none !important;
}

/* Textos fiscales retirados por JS sin tocar el precio. */
.ubd-tax-copy-hidden {
    display: none !important;
}

/* Popup carrito: contraste correcto; conserva los href originales. */
#blockcart-modal .cart-content-btn a:first-child,
#blockcart-modal .cart-content-btn .btn-secondary,
.blockcart-modal .cart-content-btn a:first-child,
.blockcart-modal .cart-content-btn .btn-secondary {
    background: var(--mb-orange, #E7923C) !important;
    border-color: transparent !important;
    color: #fff !important;
    opacity: 1 !important;
}
#blockcart-modal .cart-content-btn a:first-child:hover,
.blockcart-modal .cart-content-btn a:first-child:hover {
    background: var(--mb-ink, #18333A) !important;
    color: #fff !important;
}

/* =========================================================
   1.5.4 · HOME SENCILLO
   Slide más pequeño, centrado y con aire lateral.
   El modo experto conserva la imagen a altura completa y a la derecha.
   ========================================================= */
html.ubd-modular-ready.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-media {
    place-items: center !important;
    box-sizing: border-box !important;
}

html.ubd-modular-ready.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-media > a {
    top: clamp(18px, 3vw, 34px) !important;
    right: clamp(34px, 7vw, 110px) !important;
    bottom: clamp(18px, 3vw, 34px) !important;
    left: clamp(34px, 7vw, 110px) !important;
    width: auto !important;
    height: auto !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
}

html.ubd-modular-ready.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-media img.ubd-hero-slide {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
}

@media (max-width: 699px) {
    html.ubd-modular-ready.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-media {
        min-height: clamp(230px, 72vw, 370px) !important;
        padding: 0 !important;
    }

    html.ubd-modular-ready.ubd-mode-simple #ubd-modular-bonito .ubd-mod-hero-media > a {
        top: 10px !important;
        right: clamp(22px, 7vw, 42px) !important;
        bottom: 18px !important;
        left: clamp(22px, 7vw, 42px) !important;
    }
}


/* =========================================================
   HOME MÓVIL · Acciones sobre el borde inferior del slide
   Duplicado visual controlado: escritorio conserva los botones originales;
   móvil muestra exclusivamente este bloque encima de la fotografía.
   ========================================================= */
#ubd-modular-bonito .ubd-mod-hero-buttons-mobile {
    display: none !important;
}

@media (max-width: 699px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero {
        position: relative !important;
        isolation: isolate !important;
    }

    /* Los botones originales siguen en el HTML, pero no se muestran en móvil. */
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-copy > .ubd-mod-hero-buttons {
        display: none !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile {
        position: absolute !important;
        right: clamp(18px, 5vw, 28px) !important;
        bottom: clamp(20px, 5vw, 30px) !important;
        left: clamp(18px, 5vw, 28px) !important;
        z-index: 12 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        justify-content: center !important;
        gap: 9px !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        pointer-events: none !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        min-height: 50px !important;
        padding: 10px 9px !important;
        border: 1px solid rgba(255,255,255,.32) !important;
        border-radius: 18px !important;
        box-shadow: 0 12px 26px rgba(24,51,58,.24) !important;
        font-size: clamp(9px, 2.75vw, 11px) !important;
        font-weight: 800 !important;
        line-height: 1.16 !important;
        letter-spacing: .035em !important;
        text-align: center !important;
        text-wrap: balance !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile a:first-child {
        background: rgba(74,151,124,.96) !important;
        color: #fff !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile a:nth-child(2) {
        background: rgba(236,119,73,.96) !important;
        color: #fff !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile a:focus-visible {
        outline: 3px solid #fff !important;
        outline-offset: 2px !important;
    }
}

@media (max-width: 359px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile {
        right: 14px !important;
        left: 14px !important;
        gap: 7px !important;
    }
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile a {
        min-height: 46px !important;
        padding: 8px 6px !important;
        border-radius: 15px !important;
        font-size: 9px !important;
    }
}

/* =========================================================
   HOME MÓVIL · Chips sobre el slide + autocompletado buscador
   1.6.0
   ========================================================= */
#ubd-modular-bonito .ubd-mod-hero-chips-mobile,
#ubd-modular-bonito .ubd-mod-search-suggest {
    display: none !important;
}

#ubd-modular-bonito .ubd-mod-search {
    position: relative !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 40 !important;
    padding: 8px !important;
    border: 1px solid rgba(27,53,60,.09) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 16px 34px rgba(24,51,58,.12) !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest.is-open {
    display: grid !important;
    gap: 6px !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest a,
#ubd-modular-bonito .ubd-mod-search-suggest button {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #1b353c !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    text-decoration: none !important;
    box-shadow: inset 0 0 0 1px rgba(27,53,60,.08) !important;
    cursor: pointer !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest a small,
#ubd-modular-bonito .ubd-mod-search-suggest button small {
    display: block !important;
    color: rgba(27,53,60,.62) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest a strong,
#ubd-modular-bonito .ubd-mod-search-suggest button strong {
    display: block !important;
    color: inherit !important;
    font-size: 13px !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest a::after,
#ubd-modular-bonito .ubd-mod-search-suggest button::after {
    content: '↗' !important;
    color: rgba(27,53,60,.45) !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest a:focus-visible,
#ubd-modular-bonito .ubd-mod-search-suggest button:focus-visible {
    outline: 3px solid rgba(216,147,76,.42) !important;
    outline-offset: 2px !important;
}

#ubd-modular-bonito .ubd-mod-search-suggest .is-empty {
    justify-content: center !important;
    color: rgba(27,53,60,.72) !important;
    font-size: 12px !important;
}

@media (max-width: 699px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-copy > .ubd-mod-hero-chips {
        display: none !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-chips-mobile {
        position: absolute !important;
        right: clamp(16px, 4vw, 24px) !important;
        bottom: clamp(84px, 19vw, 112px) !important;
        left: clamp(16px, 4vw, 24px) !important;
        z-index: 13 !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
        pointer-events: none !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-chips-mobile a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        min-height: 40px !important;
        padding: 8px 8px !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,.95) !important;
        color: #1b353c !important;
        font-size: clamp(9px, 2.55vw, 11px) !important;
        font-weight: 800 !important;
        letter-spacing: .04em !important;
        line-height: 1.08 !important;
        text-align: center !important;
        text-wrap: balance !important;
        text-decoration: none !important;
        box-shadow: 0 10px 24px rgba(24,51,58,.14) !important;
        border: 1px solid rgba(255,255,255,.55) !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-buttons-mobile {
        bottom: clamp(20px, 5vw, 30px) !important;
    }
}

@media (max-width: 389px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-chips-mobile {
        right: 14px !important;
        left: 14px !important;
        gap: 6px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-hero-chips-mobile a {
        min-height: 38px !important;
        padding: 7px 6px !important;
        font-size: 8.5px !important;
        letter-spacing: .03em !important;
    }
}

/* =========================================================
   MÓVIL · Productos más grandes dentro de su ficha
   1.6.1 · Más presencia visual sin recorte, centrados
   ========================================================= */
@media (max-width: 699px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product {
        min-height: 274px !important;
        border-radius: 21px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-stage {
        right: 7px !important;
        bottom: 7px !important;
        left: 7px !important;
        height: 41% !important;
        border-radius: 17px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media {
        inset: 0 !important;
        display: grid !important;
        place-items: center !important;
        min-height: 0 !important;
        padding: 10px 6px 84px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media img {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 182px !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        object-position: center center !important;
        transform: translateY(-4px) !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-meta {
        right: 7px !important;
        bottom: 7px !important;
        left: 7px !important;
        min-height: 78px !important;
        margin: 0 !important;
        padding: 10px 10px 11px !important;
    }
}

@media (max-width: 480px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product {
        min-height: 282px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media {
        padding: 8px 4px 86px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media img {
        max-width: 100% !important;
        max-height: 188px !important;
        transform: translateY(-2px) !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-title {
        font-size: 15px !important;
    }
}

@media (max-width: 390px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product {
        min-height: 272px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media {
        padding: 8px 4px 84px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media img {
        max-height: 178px !important;
    }
}

/* =========================================================
   MÓVIL · Producto casi al límite de la ficha
   1.6.2 · Área útil real, centrado y sin recorte
   ========================================================= */
@media (max-width: 699px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product {
        grid-template-rows: minmax(clamp(220px, 55vw, 300px), 1fr) auto !important;
        min-height: clamp(315px, 76vw, 410px) !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media {
        position: relative !important;
        width: 100% !important;
        min-height: clamp(220px, 55vw, 300px) !important;
        padding: 4px 2px 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media img {
        display: block !important;
        width: calc(100% - 4px) !important;
        height: calc(100% - 4px) !important;
        max-width: none !important;
        max-height: none !important;
        margin: 2px auto 0 !important;
        object-fit: contain !important;
        object-position: center center !important;
        transform: none !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product:hover .ubd-mod-product-media img {
        transform: none !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-meta {
        width: calc(100% - 12px) !important;
        margin: 0 6px 6px !important;
    }
}

@media (max-width: 390px) {
    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product {
        grid-template-rows: minmax(210px, 1fr) auto !important;
        min-height: 304px !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media {
        min-height: 210px !important;
        padding: 3px 1px 0 !important;
    }

    html.ubd-modular-ready #ubd-modular-bonito .ubd-mod-product-media img {
        width: calc(100% - 2px) !important;
        height: calc(100% - 2px) !important;
        margin-top: 1px !important;
    }
}
