/* ==========================================================
   ACCIONES DE TARJETA V3
   Ver detalles + Añadir en una misma fila
   ========================================================== */

body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions {
    width: 100% !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns:
        minmax(0, .94fr)
        minmax(0, 1.06fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: auto 0 0 !important;
    padding: 0 !important;
}

/*
 * Neutralizar reglas heredadas que convertían los botones
 * en bloques apilados o círculos.
 */
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions > a.button {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    aspect-ratio: auto !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;

    float: none !important;
    margin: 0 !important;
    padding: 0 13px !important;

    border-radius: 999px !important;
    clip-path: none !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: -.01em !important;
    text-align: center !important;
    text-transform: none !important;

    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;

    transform: none;
}

/*
 * Acción secundaria: entrar en la ficha.
 */
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.costurero-view-product {
    border:
        1px solid
        rgba(140, 48, 71, .38) !important;

    background:
        rgba(255, 255, 255, .96) !important;

    background-image: none !important;

    color:
        var(--premium-wine) !important;

    box-shadow:
        0 7px 17px
        rgba(85, 44, 56, .07) !important;
}

body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.costurero-view-product::after {
    content: "›";
    display: inline-block;
    margin-top: -1px;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.costurero-view-product:hover {
    border-color:
        var(--premium-wine) !important;

    background:
        var(--premium-blush) !important;

    color:
        var(--premium-wine-dark) !important;

    box-shadow:
        0 10px 22px
        rgba(85, 44, 56, .12) !important;

    transform:
        translateY(-1px) !important;
}

/*
 * Acción principal: añadir al carrito.
 */
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.add_to_cart_button,
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.product_type_simple {
    border:
        1px solid
        var(--premium-wine) !important;

    background:
        linear-gradient(
            135deg,
            #9d3650,
            #842d43
        ) !important;

    color: #fff !important;

    box-shadow:
        0 10px 22px
        rgba(140, 48, 71, .19) !important;
}

/*
 * Carrito pequeño, monocromo y discreto.
 */
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.add_to_cart_button::before,
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.product_type_simple::before {
    content: "" !important;
    width: 15px !important;
    min-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    display: inline-block !important;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l2.3 10.1a2 2 0 0 0 2 1.6h7.8a2 2 0 0 0 1.9-1.4L21 7H6'/%3E%3Ccircle cx='10' cy='20' r='1.2'/%3E%3Ccircle cx='18' cy='20' r='1.2'/%3E%3C/svg%3E") !important;

    background-position:
        center !important;

    background-repeat:
        no-repeat !important;

    background-size:
        contain !important;
}

body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.add_to_cart_button:hover,
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.product_type_simple:hover {
    background:
        linear-gradient(
            135deg,
            #a9425a,
            #74263a
        ) !important;

    color: #fff !important;

    box-shadow:
        0 14px 28px
        rgba(140, 48, 71, .27) !important;

    transform:
        translateY(-1px) !important;
}

/*
 * Productos que necesitan entrar en la ficha para elegir opciones.
 */
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.product_type_variable,
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.product_type_grouped,
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.product_type_external {
    border:
        1px solid
        var(--premium-wine) !important;

    background:
        var(--premium-wine) !important;

    color: #fff !important;

    box-shadow:
        0 10px 22px
        rgba(140, 48, 71, .19) !important;
}

/*
 * Confirmación AJAX después de añadir.
 */
body.costurero-premium-v2
ul.products
li.product
.costurero-card-actions
a.added_to_cart {
    grid-column: 1 / -1 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 4px 0 0 !important;
    padding: 4px !important;
    border: 0 !important;
    background: transparent !important;
    color:
        var(--premium-wine) !important;
    box-shadow: none !important;
    font-size: 11px !important;
    text-decoration: underline;
}

/*
 * Mantener la fila incluso con zoom del navegador o portátil.
 */
@media (max-width: 1250px) {
    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions {
        grid-template-columns:
            minmax(0, .92fr)
            minmax(0, 1.08fr) !important;
        gap: 6px !important;
    }

    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions > a.button {
        height: 43px !important;
        min-height: 43px !important;
        max-height: 43px !important;
        padding:
            0 9px !important;
        font-size: 11px !important;
    }

    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions
    a.add_to_cart_button::before,
    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions
    a.product_type_simple::before {
        width: 13px !important;
        min-width: 13px !important;
        height: 13px !important;
        min-height: 13px !important;
    }
}

/*
 * En móvil siguen en la misma fila, sin apelotonarse.
 */
@media (max-width: 600px) {
    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr) !important;
        gap: 5px !important;
    }

    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions > a.button {
        height: 39px !important;
        min-height: 39px !important;
        max-height: 39px !important;
        padding:
            0 6px !important;
        font-size: 10px !important;
    }

    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions
    a.costurero-view-product::after {
        display: none;
    }

    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions
    a.add_to_cart_button::before,
    body.costurero-premium-v2
    ul.products
    li.product
    .costurero-card-actions
    a.product_type_simple::before {
        width: 12px !important;
        min-width: 12px !important;
        height: 12px !important;
        min-height: 12px !important;
    }
}
