:root {
    --rm-bg: #ffffff;
    --rm-text-primary: #1a1a1a;
    --rm-text-secondary: #666666;
    --rm-text-muted: #9b9b9b;
    --rm-orange: #FF6B00;
    --rm-orange-dark: #e55a00;
    --rm-orange-soft: #fff5ed;
    --rm-green: #2eaa55;
}

/* ===== Grid limpio: sin líneas, separación con espacio en blanco ===== */
.JS_productsList {
    position: relative;
    margin-bottom: 35px;
}
.JS_productsList .product-list.JSproductListItems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin: 0;
}
.JS_productsList .product-list.JSproductListItems > div {
    padding: 0;
    margin: 0;
}
.wrapProdGrid2 {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
}
.wrapProdGrid2 > .prodGrid2 { flex: 1 1 auto; width: 100%; }
/* Nombre arriba, antes de la imagen */
.prodGrid2 .name,
.prodGrid2 .JSproductName { order: -1; }

/* ===== Tarjeta ===== */
.prodGrid2 {
    position: relative;
    background: var(--rm-bg);
    text-align: left;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    overflow: visible;
    padding: 16px;
    min-height: 410px;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: box-shadow 0.25s ease;
}
.prodGrid2:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.prodGrid2 img {
    border: none !important;
}

/* ===== Imagen ===== */
.prodGrid2 .prod_img {
    position: relative;
    display: block;
    margin: 0 0 14px;
    padding: 0;
}
.prodGrid2 .prod_img > a {
    display: block;
    position: relative;
    aspect-ratio: 1;
    text-align: center;
    overflow: hidden;
}
.prodGrid2 .prod_img > a > img.foo {
    width: 100%;
    height: 100%;
    opacity: 0;
}
.prodGrid2 .wrapImg2 {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}
.prodGrid2 .wrapImg2 img {
    position: relative;
    z-index: 2;
    background: transparent;
    padding: 0;
    width: 90% !important;
    height: 90% !important;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.prodGrid2:hover .wrapImg2 img {
    transform: scale(1.05);
}

/* ===== Nombre ===== */
.prodGrid2 .name,
.prodGrid2 .caption .name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    min-height: 38px;
    margin: 0 0 4px !important;
    padding: 0;
    font-family: 'SamsungSharpSans', Arial, sans-serif;
    font-size: 16.86px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
    text-align: left !important;
    color: #000;
    text-decoration: none;
    transition: color 0.2s ease;
}
.prodGrid2:hover .name,
.prodGrid2 .caption .name:hover,
.prodGrid2 .name:hover,
.prodGrid2 .name:focus {
    color: var(--rm-orange);
    text-decoration: none;
}

/* ===== Caption / cuerpo ===== */
.prodGrid2 .caption {
    border: none;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.prodGrid2 .caption > .row {
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ===== Combinaciones ===== */
.prodGrid2 .wrapCombinations {
    height: auto;
    padding: 0;
    margin: 4px 0;
}
.prodGrid2 .wrapCombinations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.prodGrid2 .wrapCombinations li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 13px;
}
.prodGrid2 .wrapCombinations label {
    line-height: 1.2;
    cursor: pointer;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--rm-text-secondary);
}
.prodGrid2 .wrapCombinations .wrapPrices {
    position: absolute;
    right: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-text-primary);
}
.prodGrid2 .wrapCombinations .wrapPrices .priceOld {
    display: inline-block;
    margin-right: 7px;
    color: var(--rm-text-muted);
    font-weight: 400;
    text-decoration: line-through;
}
.prodGrid2 .wrapCombinations input[type=radio] {
    --active: var(--rm-orange);
    --border: #c9c9c9;
    --border-hover: var(--rm-orange);
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    outline: none;
    display: inline-block;
    vertical-align: top;
    position: relative;
    margin: 0;
    cursor: pointer;
    border: 1px solid var(--bc, var(--border));
    background: var(--b, #fff);
    transition: background 0.2s, border-color 0.2s;
}
.prodGrid2 .wrapCombinations input[type=radio]:checked {
    --b: var(--active);
    --bc: var(--active);
}

/* ===== Flash sale stock bar ===== */
.prodGrid2 .stockAvailable {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    background: #ededed;
    border-radius: 4px;
    margin: 0 0 8px;
    height: 16px;
    overflow: hidden;
    font-size: 11px;
}
.prodGrid2 .colorBar {
    max-width: 100%;
    min-width: 25%;
    height: 100%;
    color: #fff;
    padding-left: 6px;
    left: 0;
    position: absolute;
    line-height: 16px;
    border-radius: 4px;
}
.prodGrid2 .colorBar.green  { background: var(--rm-green); }
.prodGrid2 .colorBar.red    { background: #d63031; }
.prodGrid2 .colorBar.orange { background: var(--rm-orange); }

/* ===== Precio ===== */
.prodGrid2 .caption .wrapPrice {
    text-align: left !important;
    padding: 8px 0 0;
    margin: 10px 0 0 !important;
    height: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.prodGrid2 .caption .priceOld {
    order: 1;
    display: inline-block;
    position: static;
    top: auto;
    margin: 0 0 2px;
    font-size: 13px !important;
    font-weight: 400;
    color: var(--rm-text-muted);
    text-decoration: line-through;
    white-space: nowrap;
}
.prodGrid2 .caption .price,
.prodGrid2 .caption .JSprice.price {
    order: 2;
    float: none;
    position: static;
    padding: 0;
    margin: 0;
    height: auto;
    min-width: 0;
    font-family: 'SamsungOne', Arial, sans-serif;
    font-size: 15.18px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
    color: #000;
    text-shadow: none;
}
.prodGrid2 .caption .price .decimal {
    font-family: 'SamsungOne', Arial, sans-serif;
    font-size: 15.18px;
    font-weight: 900;
    color: #000;
    top: 0;
    position: relative;
}
.prodGrid2 .percentDiscount {
    order: 3;
    position: static;
    display: inline-block;
    margin-top: 6px;
    bottom: auto;
    left: auto;
    width: auto;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--rm-orange-soft);
    color: var(--rm-orange);
}
.prodGrid2 .percentDiscount:after {
    content: none;
}
.prodGrid2 .reference {
    order: 4;
    position: static;
    bottom: auto;
    left: auto;
    width: auto;
    margin-top: 6px;
    font-size: 11px;
    color: var(--rm-text-muted);
}

/* ===== Botón comprar / acciones ===== */
.prodGrid2 .wrapBtnAddCart {
    width: 100%;
    height: auto;
    position: relative;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--rm-line, #E6E8EC);
    display: flex;
    align-items: stretch;
    gap: 0;
    order: 99;
}
.prodGrid2 .wrapBtnAddCart .JS_productForm,
.prodGrid2 .wrapBtnAddCart form.prod_form {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}
.prodGrid2 .wrapBtnAddCart .plusMinus {
    border-right: 1px solid var(--rm-line, #E6E8EC);
    padding-right: 12px;
    margin-right: 12px;
}
.prodGrid2 .plusMinus {
    position: static;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ececec;
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
}
.prodGrid2 .plusMinus button {
    background: #fff;
    border: none;
    padding: 0;
    width: 30px;
    color: var(--rm-text-primary);
    cursor: pointer;
}
.prodGrid2 .plusMinus input {
    border: none;
    border-left: 1px solid #ececec;
    border-right: 1px solid #ececec;
    border-radius: 0;
    float: none;
    font-weight: 600;
    height: auto;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 34px;
    font-family: 'Inter', 'Open Sans', sans-serif;
}
.prodGrid2 .plusMinus .icon {
    font-size: inherit;
    font-style: normal;
    position: static;
}
.prodGrid2 .btnAddCart {
    overflow: hidden;
    position: relative;
    flex: 1;
    width: auto;
    float: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #E63312;
    color: #fff;
    text-transform: none;
    padding: 11px 14px;
    text-align: center;
    border-radius: 8px;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.prodGrid2 .btnAddCart:hover {
    text-decoration: none;
    background: #C72A0E;
    color: #fff;
}
.prodGrid2 .btnAddCart:hover:after {
    content: none;
}
.prodGrid2 .btnAddCart i {
    color: #fff;
    margin: 0;
    position: static;
    left: auto;
    display: inline-block;
}
.prodGrid2 .preCompra {
    background: var(--rm-text-primary);
    flex: 1;
}
.prodGrid2 .preCompra:hover {
    background: #000;
}
.prodGrid2 .black-button-link {
    color: var(--rm-text-secondary);
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 11px;
    height: auto;
    display: block;
    width: 100%;
    text-align: center;
    cursor: not-allowed;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    clear: both;
    text-decoration: none;
}
.prodGrid2 .dateDelivery {
    color: var(--rm-text-muted);
    position: static;
    bottom: auto;
    text-align: left;
    width: 100%;
    font-size: 11px;
    display: block;
    margin-top: 6px;
}
.prodGrid2 .b2bcustomer {
    margin: 0;
    width: 100%;
    text-align: center;
    background: var(--rm-orange-soft);
    border-left: 3px solid var(--rm-orange);
    color: var(--rm-text-secondary);
    padding: 11px;
    border-radius: 8px;
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
}
.prodGrid2 .b2bcustomer a {
    color: var(--rm-orange);
    font-weight: 600;
}
.prodGrid2 .stock {
    position: relative;
    line-height: 1.2;
    text-align: left;
    display: block;
    width: 100%;
    font-weight: 600;
    color: var(--rm-green);
    font-size: 11px;
    height: auto;
    margin-top: 6px;
}
.prodGrid2 .deliveryDate {
    text-align: left;
    color: var(--rm-green);
    font-family: 'Inter', 'Open Sans', sans-serif;
    font-size: 11px;
    position: relative;
    top: 0;
    margin: 4px 0 0;
    line-height: 1.3;
    height: auto;
    overflow: hidden;
    display: none;
}
.prodGrid2 .deliveryDate a { color: var(--rm-orange); }
.prodGrid2 .deliveryDate strong { font-weight: 700; font-size: 12px; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .JS_productsList .product-list.JSproductListItems {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    .prodGrid2 {
        padding: 10px;
        min-height: 340px;
    }
    .prodGrid2 .caption .price,
    .prodGrid2 .caption .JSprice.price {
        font-size: 20px;
    }
    .prodGrid2 .name,
    .prodGrid2 .caption .name {
        font-size: 13px;
        padding: 0;
    }
    .prodGrid2 .wrapCombinations .priceOld {
        display: none !important;
    }
    .prodGrid2 .wrapBtnAddCart {
        flex-wrap: wrap;
    }
}

/* ===== Variantes / niche (sin cambios de comportamiento) ===== */
.cros:before, .cros:after {
    content: "";
    position: absolute;
    background: #b7b7b7;
}
.cros:before { left: 50%; width: 2px; height: 100%; margin-left: -1px; }
.cros:after { top: 50%; height: 2px; margin-top: -1px; width: 100%; left: 0; }

.forceHorizontal {
    width: 100% !important;
    overflow: hidden;
    border-right-color: #fff !important;
}
.forceHorizontal .prodGrid2 { overflow: hidden; }
.forceHorizontal .prodGrid2 .prod_img { width: 30%; float: left; }
.forceHorizontal .prodGrid2 .caption { padding-top: 0; }
.forceHorizontal .prodGrid2 .wrapBtnAddCart { position: static; }
.forceHorizontal .prodGrid2 .caption .name { width: 100%; }
.forceHorizontal .prodGrid2 .caption .wrapPrice { float: none; position: relative; width: auto; }

.prodGrid2 .hoverLayer {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    height: 100%;
    background: rgba(255, 255, 255, 1);
    text-align: center;
    padding-top: 53px;
}
.prodGrid2 .hoverLayer > .camion { margin-bottom: 10px; width: auto !important; }
.prodGrid2 .hoverLayer .stockInfo { font-weight: normal; }
.prodGrid2 .hoverLayer .stockInfo.green { color: #84c045; }
.prodGrid2 .hoverLayer .stockInfo.red { color: #e53a52; }
.prodGrid2 .JStoggleHoverLayer {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    z-index: 99;
}
.prodGrid2 .buttonActions {
    position: relative;
    top: 0;
    text-align: center;
    width: 100%;
}
.prodGrid2 .buttonActions .circleButton {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
}
.prodGrid2 .buttonActions .circleButton a {
    background: #fff;
    border-radius: 100%;
    width: 37px;
    height: 37px;
    padding: 0;
    display: inline-block;
    line-height: 37px;
    transition: all 0.2s ease-in-out;
}
.prodGrid2 .buttonActions .circleButton a i { color: #aaa; margin: 0; }
.prodGrid2 .buttonActions .circleButton:hover a {
    color: #fff;
    background: var(--rm-orange);
    width: 45px;
    line-height: 45px;
    height: 45px;
}
.prodGrid2 .buttonActions .circleButton:hover a i { color: #fff; }

/* Override de reglas legacy inyectadas por el panel admin
   (.home .JS_productsList .product-list>div{display:inline-block;float:none}
    #cmsPage .wrapProdGrid2{display:inline-block;float:none})
   Restauran el grid moderno para que las cards alineen igual en home/CMS que en /listado. */
.home .JS_productsList .product-list > .wrapProdGrid2,
#cmsPage .JS_productsList .product-list > .wrapProdGrid2,
#cmsPage .wrapProdGrid2 {
    display: flex !important;
    float: none !important;
}
.home .JS_productsList > .row,
.home .JS_productsList .product-list,
#cmsPage .product-list {
    text-align: left !important;
}

/* Bloque de colección en la home (widget multipleList "Destacados / Win/offi"):
   centrar las cards cuando son menos que columnas disponibles, manteniendo
   altura uniforme (botón "Añadir" al fondo) igual que en /destacados. */
#JS_multipleList .product-list.JSproductListItems {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 8px;
}
#JS_multipleList .product-list.JSproductListItems > .wrapProdGrid2 {
    flex: 0 0 280px !important;
    max-width: 280px !important;
    height: auto !important;
    align-self: stretch !important;
}
