/* ==================================================
   ORDENACIÓN + FILTROS EN MÓVIL
   ================================================== */

@media (max-width: 767.98px) {

    /* Contenedor */
    #js-product-list-top .sort-by-row {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    /* Ocultamos el texto original del tema */
    #js-product-list-top .sort-by {
        display: none !important;
    }

    /* ORDENAR ocupa una fila completa */
    #js-product-list-top .products-sort-order {
        position: relative !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 12px !important;
        order: 1;
    }

    /* Título ORDENAR POR */
    #js-product-list-top .products-sort-order::before {
        content: "ORDENAR POR";
        display: block;
        width: 100%;
        margin-bottom: 7px;
        font-weight: 700;
        font-size: 14px;
    }

    /* Botón de ordenación */
    #js-product-list-top .products-sort-order .select-title {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Menú desplegable: siempre dentro de pantalla */
    #js-product-list-top .products-sort-order .dropdown-menu {
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* FILTRO ocupa la siguiente fila */
    #js-product-list-top .filter-button {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        order: 2;
    }

    #js-product-list-top #search_filter_toggler {
        width: 100% !important;
    }
}

.hero-dermopiedra img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1920 / 650;
}


/* DermoPiedra - bloque de beneficios */
.dp-benefits-widget {
  width: 100%;
}

.dp-benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  background: #fff;
}

.dp-benefit {
  position: relative;
  text-align: center;
  padding: 28px 18px 24px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dp-benefit:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 0;
  width: 1px;
  height: 60%;
  background: #d71920;
}

.dp-benefit-icon {
  width: 84px;
  height: 84px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #004b2f;
}

.dp-benefit-icon svg {
  width: 84px;
  height: 84px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dp-benefit-years {
  border: 4px solid #d71920;
  border-left-color: #004b2f;
  border-bottom-color: #004b2f;
  border-radius: 50%;
  font-weight: 700;
}

.dp-benefit-years span {
  font-size: 30px;
  line-height: 1;
  color: #d71920;
}

.dp-benefit-title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: #004b2f;
  margin-bottom: 4px;
}

.dp-benefit-text {
  font-size: 18px;
  line-height: 1.25;
  color: #222;
}

/* Tablet */
@media (max-width: 991px) {
  .dp-benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dp-benefit {
    min-height: 200px;
  }

  .dp-benefit:nth-child(2)::after {
    display: none;
  }

  .dp-benefit:nth-child(-n+2) {
    border-bottom: 1px solid #e5e5e5;
  }
}

/* Móvil */
@media (max-width: 575px) {
  .dp-benefits {
    grid-template-columns: 1fr;
  }

  .dp-benefit {
    min-height: 170px;
    padding: 22px 14px;
    border-bottom: 1px solid #e5e5e5;
  }

  .dp-benefit:last-child {
    border-bottom: 0;
  }

  .dp-benefit::after {
    display: none !important;
  }

  .dp-benefit-icon,
  .dp-benefit-icon svg {
    width: 72px;
    height: 72px;
  }

  .dp-benefit-title {
    font-size: 18px;
  }

  .dp-benefit-text {
    font-size: 16px;
  }
}

/* Flechas del menú principal sin FontAwesome */
.leo-megamenu .nav-link.dropdown-toggle.has-category::after {
    content: "";
    font-family: inherit;
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    vertical-align: 3px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
}


/* =========================================================
   HOME: evitar FontAwesome en elementos auxiliares
   ========================================================= */

/* Breadcrumb Inicio: en la home está oculto */
body#index .breadcrumb li::after,
body#index .breadcrumb li > a::before {
    content: none !important;
    font-family: inherit !important;
}

/* Loaders Leo: spinner CSS puro */
body#index .leoproductsearch-loading.cssload-speeding-wheel::before,
body#index .leo-dropdown-cssload-speeding-wheel::before,
body#index .leo-modal-wishlist-loading.cssload-speeding-wheel::before {
    content: "" !important;
    font-family: inherit !important;
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: dp-spin .8s linear infinite;
}

@keyframes dp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Botón volver arriba */
body#index #back-top.progress-wrap::before {
    content: "↑" !important;
    font-family: Arial, sans-serif !important;
}

/* Mostrar / ocultar contraseña */
body#index .fa-eye-slash::before {
    content: "visibility_off" !important;
    font-family: "Material Icons" !important;
    font-feature-settings: "liga";
}

body#index .fa-eye::before {
    content: "visibility" !important;
    font-family: "Material Icons" !important;
    font-feature-settings: "liga";
}

/* DermoPiedra - Product Comments */
#product-comments-list-header {
    justify-content: flex-start !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

#product-comments-list-header .comments-note {
    display: flex;
    align-items: center;
    margin: 0 !important;
}

/* Ocultar el texto "Calificación" y dejar solo las estrellas */
#product-comments-list-header .comments-note > span {
    display: none;
}

#product-comments-list-header .comments-note .grade-stars {
    margin: 0;
}

#product-comments-list-header .comments-note .grade-stars .star-content {
    top: 0;
}


/* At_Movic / Ap Products List Builder - imágenes de producto 1:1 */
.plist-autoparts .product-image {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

.plist-autoparts .product-image .product-thumbnail {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
}

.plist-autoparts .product-image .product-thumbnail picture {
    display: block;
    width: 100%;
    height: 100%;
}

.plist-autoparts .product-image .product-thumbnail img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
}

/* Banner panorámico de categorías */
body#category .block-category #category-description + .category-cover {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    float: none !important;
    margin: 25px 0 30px 0 !important;
}

body#category .block-category .category-cover picture {
    display: block;
    width: 100%;
}

body#category .block-category .category-cover img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}


/* ==========================================================
   DERMOPIEDRA - GRID DE MATERIALES
   ========================================================== */

.dp-material-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 30px 0 45px;
}

.dp-material-card {
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.dp-material-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,.10);
    border-color: #c8c8c8;
}

.dp-material-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 650 / 220;
    object-fit: cover;
}

.dp-material-card span {
    display: block;
    padding: 14px 10px 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #252525;
}

.dp-material-card:hover span {
    color: #111;
}


/* ¿No sabes qué material tienes? */

.dp-material-help {
    margin: 35px 0 20px;
    padding: 28px 30px;
    background: #f7f7f5;
    border-radius: 10px;
    text-align: center;
}

.dp-material-help h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.dp-material-help p {
    max-width: 760px;
    margin: 0 auto 20px;
}

.dp-material-help__button {
    display: inline-block;
    padding: 12px 22px;
    background: #333;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 4px;
    transition: background .2s ease;
}

.dp-material-help__button:hover {
    background: #111;
}


/* Tablet */

@media (max-width: 991px) {

    .dp-material-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}


/* Móvil */

@media (max-width: 767px) {

    .dp-material-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 20px 0 30px;
    }

    .dp-material-card {
        border-radius: 7px;
    }

    .dp-material-card span {
        padding: 10px 6px 11px;
        font-size: 14px;
    }

    .dp-material-help {
        padding: 22px 16px;
    }

    .dp-material-help__button {
        display: block;
        width: 100%;
    }
}

/* Centrar la última tarjeta cuando el grid de Materiales tiene 13 elementos */
@media (min-width: 992px) {
    .dp-material-grid .dp-material-card:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc((100% - 60px) / 4);
    }
}

/* Menú fijo limpio en tablet horizontal y escritorio */


@media (min-width: 992px) {

    body#index #page {
        overflow-x: clip !important;
    }

    #header {
        position: sticky !important;
        top: 0 !important;
        z-index: 9999;
        width: 100%;
        background: #fff;
    }
}

/* LISTADOS Y COMPARACIÓN:
   CTA neutro en reposo, rojo al interactuar */

.product-miniature button[data-button-action="add-to-cart"]:not(:disabled),
#product_comparison button[data-button-action="add-to-cart"]:not(:disabled),
.leo-productscompare-item button[data-button-action="add-to-cart"]:not(:disabled) {
    background: #eeeeee !important;
    border-color: #eeeeee !important;
    color: #777 !important;
}

.product-miniature button[data-button-action="add-to-cart"]:not(:disabled) i,
.product-miniature button[data-button-action="add-to-cart"]:not(:disabled) span,
#product_comparison button[data-button-action="add-to-cart"]:not(:disabled) i,
#product_comparison button[data-button-action="add-to-cart"]:not(:disabled) span,
.leo-productscompare-item button[data-button-action="add-to-cart"]:not(:disabled) i,
.leo-productscompare-item button[data-button-action="add-to-cart"]:not(:disabled) span {
    color: inherit !important;
}

/* Hover */
.product-miniature button[data-button-action="add-to-cart"]:not(:disabled):hover,
#product_comparison button[data-button-action="add-to-cart"]:not(:disabled):hover,
.leo-productscompare-item button[data-button-action="add-to-cart"]:not(:disabled):hover {
    background: #ed1717 !important;
    border-color: #ed1717 !important;
    color: #fff !important;
}


/* =========================================================
   CTA PRINCIPALES DERMO PIEDRA
   Reposo: gris claro / Hover: rojo corporativo
   ========================================================= */

/* Estado normal:
   - Selector técnico de la home
   - Enviar consulta
   - Inicio de sesión
   - Registro / Guardar
   - Popups Leo de acceso y registro */
body#index a[href*="/selector-tecnico"],
.pcf-shell .pcf-submit,
#login-form button[type="submit"],
#login-form .form-control-submit,
#customer-form button[type="submit"],
#customer-form .form-control-submit,
.leo-quicklogin-modal button[type="submit"],
.leo-quicklogin-modal .form-control-submit {
    background: #eeeeee !important;
    border-color: #eeeeee !important;
    color: #777 !important;
    transition:
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease !important;
}

/* Hover / foco */
body#index a[href*="/selector-tecnico"]:hover,
body#index a[href*="/selector-tecnico"]:focus,
.pcf-shell .pcf-submit:hover,
.pcf-shell .pcf-submit:focus,
#login-form button[type="submit"]:hover,
#login-form button[type="submit"]:focus,
#login-form .form-control-submit:hover,
#login-form .form-control-submit:focus,
#customer-form button[type="submit"]:hover,
#customer-form button[type="submit"]:focus,
#customer-form .form-control-submit:hover,
#customer-form .form-control-submit:focus,
.leo-quicklogin-modal button[type="submit"]:hover,
.leo-quicklogin-modal button[type="submit"]:focus,
.leo-quicklogin-modal .form-control-submit:hover,
.leo-quicklogin-modal .form-control-submit:focus {
    background: #ed1717 !important;
    border-color: #ed1717 !important;
    color: #fff !important;
}

/* Texto e iconos interiores: heredan el color del botón */
body#index a[href*="/selector-tecnico"] *,
.pcf-shell .pcf-submit *,
#login-form button[type="submit"] *,
#login-form .form-control-submit *,
#customer-form button[type="submit"] *,
#customer-form .form-control-submit *,
.leo-quicklogin-modal button[type="submit"] *,
.leo-quicklogin-modal .form-control-submit * {
    color: inherit !important;
}


/* =========================================================
   REGISTRO - CENTRADO RECAPTCHA
   ========================================================= */
/* Centrado del reCAPTCHA de registro */
#customer-form .pscaptcha-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

#customer-form .pscaptcha-target {
    width: 304px;
    flex: 0 0 304px;
}

/* =========================================================
   FOOTER - SUSCRIPCIÓN AL BOLETÍN
   ========================================================= */

.block_newsletter input[type="email"],
.block_newsletter input[type="text"] {
    background: #f5f5f3 !important;
    border: 1px solid #e2e2df !important;
    border-radius: 4px !important;
    padding: 12px 45px 12px 14px !important;
    min-height: 44px;
    transition:
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

/* Al entrar en el campo */
.block_newsletter input[type="email"]:focus,
.block_newsletter input[type="text"]:focus {
    background: #fff !important;
    border-color: #ed1717 !important;
    box-shadow: 0 0 0 2px rgba(237, 23, 23, .08);
    outline: none !important;
}

/* =========================================================
   ACCIONES SOBRE PRODUCTO
   Vista rápida · Lista de deseos · Comparar
   Neutros en reposo -> rojo solo en hover
   ========================================================= */

.product-miniature .quick-view,
.product-miniature .leo-wishlist-button,
.product-miniature .leo-compare-button {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
    color: #222 !important;
}

/* Iconos/texto */
.product-miniature .quick-view i,
.product-miniature .quick-view span,
.product-miniature .leo-wishlist-button i,
.product-miniature .leo-wishlist-button span,
.product-miniature .leo-compare-button i,
.product-miniature .leo-compare-button span {
    color: inherit !important;
}

/* Solo el botón que recibe hover/focus pasa a rojo */
.product-miniature .quick-view:hover,
.product-miniature .quick-view:focus,
.product-miniature .leo-wishlist-button:hover,
.product-miniature .leo-wishlist-button:focus,
.product-miniature .leo-compare-button:hover,
.product-miniature .leo-compare-button:focus {
    background: #ed1717 !important;
    border-color: #ed1717 !important;
    color: #fff !important;
}

body.product-id-manufacturer-1 .product-minimal-quantity {
    margin-top: 14px;
    padding: 10px 12px;
    background: #f5f5f3;
    border-left: 3px solid #ed1717;
    color: #555;
    font-size: 13px;
}