/* Tarjeta de producto RLabs.
 * Selectores con doble clase/ancestro para ganarle a Astra y a WooCommerce. */

.rlsw-card {
    --rlsw-loop-btn-bg: var(--rlsw-card-btn, #2b2b2b);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    box-sizing: border-box;
    padding: 10px;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: var(--rlsw-card-radius, 12px);
    text-align: left;
}

.rlsw-card *,
.rlsw-card *::before,
.rlsw-card *::after { box-sizing: border-box; }

/* Imagen */
.rlsw-card .rlsw-card__media {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--rlsw-card-radius, 12px) - 4px);
    line-height: 0;
}

.rlsw-card .rlsw-card__image { display: block; }

.rlsw-card .rlsw-card__image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.rlsw-card .rlsw-card__badge {
    position: absolute;
    top: 10px;
    left: 0;
    padding: 3px 9px;
    background: var(--rlsw-card-accent, #3aa65a);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 0 4px 4px 0;
}

.rlsw-card .rlsw-card__plus {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--rlsw-card-accent, #3aa65a);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .15s ease;
    /* ahora es un <button>: anular los estilos del botón "pill" y del tema */
    padding: 0;
    margin: 0;
    border: 0;
    font-family: inherit;
    font-weight: 400;
    cursor: pointer;
}

.rlsw-card .rlsw-card__plus:hover { color: #fff; transform: scale(1.1); opacity: 1; }
.rlsw-card .rlsw-card__plus.rlsw-loading { opacity: .6; pointer-events: none; transform: none; }

/* Título, precio y valoración */
.rlsw-card .rlsw-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.rlsw-card .rlsw-card__info { min-width: 0; }

.rlsw-card .rlsw-card__title {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.rlsw-card .rlsw-card__title a { color: inherit; text-decoration: none; }

.rlsw-card .rlsw-card__price {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: inherit;
}

.rlsw-card .rlsw-card__price ins { text-decoration: none; }

.rlsw-card .rlsw-card__rating {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.2;
}

.rlsw-card .rlsw-card__rating .star-rating {
    display: inline-block;
    float: none;
    margin: 0;
    font-size: 11px;
}

.rlsw-card .rlsw-card__reviews {
    display: block;
    font-size: 10px;
    color: #555;
}

/* Swatches dentro de la tarjeta */
.rlsw-card .rlsw-loop,
.rlsw-card .rlsw-link-group--loop { margin: 0; }

.rlsw-card .rlsw-loop { gap: 8px; }

/* Etiquetas (pills) */
.rlsw-card .rlsw-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rlsw-card .rlsw-card__tag {
    padding: 1px 9px;
    border: 1px solid #333;
    border-radius: 999px;
    color: #222;
    font-size: 10px;
    line-height: 1.5;
    text-decoration: none;
}

.rlsw-card .rlsw-card__tag:hover { background: #222; color: #fff; }

/* Botón: siempre al final, para alinear tarjetas de distinta altura */
.rlsw-card .rlsw-card__action { margin-top: auto; padding-top: 2px; }

.rlsw-card .rlsw-card__add {
    display: inline-block;
    padding: 7px 16px;
    background: var(--rlsw-card-btn, #2b2b2b);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}

.rlsw-card .rlsw-card__add:hover { color: #fff; opacity: .85; }
.rlsw-card .rlsw-card__add.rlsw-loading { opacity: .55; pointer-events: none; }
.rlsw-card .rlsw-card__add--disabled { background: #bdbdbd; cursor: not-allowed; }

/* El tema (Astra) centra textos y añade márgenes en li.product */
.woocommerce ul.products li.product .rlsw-card,
.woocommerce-page ul.products li.product .rlsw-card { text-align: left; }

.woocommerce ul.products li.product:has(> .rlsw-card) {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
