/* =============================================================================
   FICHA DE PRODUCTO (templates/single-product.html). Foto a la izquierda; a la derecha categoría,
   nombre, marcas, precio, stock, el formulario de WooCommerce (cantidad o peso) y lo que pasa después:
   envío, retiro, pago y la consulta por WhatsApp. Abajo «También te puede servir» con la tarjeta de la
   tienda (tienda.css) y, en el teléfono, la barra de compra fija (producto.js).
   Todo cuelga de `.producto-v2` (clase del body) para ganarle a las reglas viejas de style.css.
   ============================================================================= */

.producto-v2 main.producto-page {
    box-sizing: border-box;
    max-width: 1160px;
    margin: 0 auto;
    padding: 18px 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: var(--f-body);
    color: var(--s-ink);
}
.producto-v2 .producto-page > *,
.producto-v2 .producto-page .pd > *,
.producto-v2 .producto-page .pd-buy > * {
    margin: 0;
}

/* ---------- foto y columna de compra ---------- */
.producto-v2 .pd {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.producto-v2 .pd-gal {
    position: sticky;
    top: calc(var(--sticky-header-h, 0px) + 16px);
    min-width: 0;
}
.producto-v2 .pd-gal .wp-block-woocommerce-product-image-gallery,
.producto-v2 .pd-gal .woocommerce-product-gallery {
    width: 100%;
    margin: 0;
    float: none;
    position: relative;
}
.producto-v2 .pd-gal .woocommerce-product-gallery__wrapper {
    margin: 0;
}
.producto-v2 .pd-gal .woocommerce-product-gallery__image,
.producto-v2 .pd-gal .woocommerce-product-gallery__image--placeholder.pd-nofoto {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 0;
    background: #fff;
    border: 1px solid var(--s-line);
    border-radius: 20px;
    overflow: hidden;
}
.producto-v2 .pd-gal .woocommerce-product-gallery__image > a {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
.producto-v2 .pd-gal .woocommerce-product-gallery__image img.wp-post-image {
    width: 78% !important;
    height: 78% !important;
    max-width: none;
    object-fit: contain;
    border-radius: 0;
    margin: 0;
}
.producto-v2 .pd-gal .pd-nofoto {
    flex-direction: column;
    align-content: center;
    gap: 10px;
    color: #B9AF9C;
}
.producto-v2 .pd-gal .pd-nofoto svg {
    width: 72px;
    height: 72px;
}
.producto-v2 .pd-gal .pd-nofoto span {
    font: 500 20px var(--f-display, "Cormorant Garamond", Georgia, serif);
    color: #A79C86;
}
.producto-v2 .pd-gal .woocommerce-product-gallery__trigger {
    top: 14px;
    right: 14px;
    z-index: 2;
}
.producto-v2 .pd-gal .flex-control-thumbs {
    display: flex;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}
.producto-v2 .pd-gal .flex-control-thumbs li {
    width: 64px;
    margin: 0;
}
.producto-v2 .pd-gal .flex-control-thumbs img {
    border: 1px solid var(--s-line);
    border-radius: 10px;
    background: #fff;
}

.producto-v2 .pd-buy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    min-width: 0;
}
.producto-v2 .pd-cat {
    align-self: flex-start;
    font-size: 13px;
    font-weight: 800;
    color: var(--s-forest);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.producto-v2 .pd-name {
    margin: 0;
    font: 800 24px/1.25 var(--f-body);
    letter-spacing: .01em;
    text-transform: none;
    color: var(--s-deep);
    text-wrap: balance;
}
.producto-v2 .pd-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.producto-v2 .pd-badges .bd {
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--s-sage);
    font-size: 11px;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--s-forest);
}
.producto-v2 .pd-badges .bd.tacc { background: #F3E6C4; color: #6E5418; }
.producto-v2 .pd-badges .bd.gr { background: #EDE6DA; color: #5C4E35; }
.producto-v2 .pd-pr {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.producto-v2 .pd-big {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    font: 800 34px/1 var(--f-body);
    color: var(--s-deep);
    font-variant-numeric: tabular-nums;
}
.producto-v2 .pd-big small {
    font-size: 15px;
    font-weight: 700;
    color: var(--s-muted);
}
.producto-v2 .pd-big del {
    font-size: 16px;
    font-weight: 600;
    color: var(--s-muted);
}
.producto-v2 .pd-unit {
    font-size: 14px;
    color: var(--s-muted);
    font-variant-numeric: tabular-nums;
}
.producto-v2 .pd-stk {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--s-forest);
}
.producto-v2 .pd-stk i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.producto-v2 .pd-stk.is-low { color: var(--s-gold-ink); }
.producto-v2 .pd-stk.is-low i { background: var(--s-gold); }
.producto-v2 .pd-stk.is-out { color: var(--s-muted); }

/* ---------- formulario: cantidad y botón ---------- */
.producto-v2 .pd-buy .pd-form {
    margin: 0;
}
.producto-v2 .pd-buy .pd-form .stock,
.producto-v2 .pd-buy .pd-form .almacen-peso-reassurance {
    display: none;
}
.producto-v2 .pd-buy .pd-form form.cart {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    margin: 0;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity {
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 50px;
    margin: 0;
    border: 1px solid #DCD3C2;
    border-radius: 12px;
    background: var(--s-paper);
    overflow: hidden;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity input.qty {
    width: 44px;
    min-height: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font: 800 16px var(--f-body);
    color: var(--s-ink);
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity input.qty::-webkit-outer-spin-button,
.producto-v2 .pd-buy .pd-form form.cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.producto-v2 .pd-buy .pd-form .pd-q {
    width: 44px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font: 700 20px/1 var(--f-body);
    color: var(--s-forest);
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.producto-v2 .pd-buy .pd-form .pd-q:hover {
    background: #F4F7F1;
}
.producto-v2 .pd-buy .pd-form .pd-q:disabled {
    color: #B8C2AE;
    cursor: default;
    background: transparent;
}
.producto-v2 .pd-buy .pd-form form.cart .single_add_to_cart_button {
    flex: 1 1 auto;
    height: 50px;
    min-height: 0;
    margin: 0;
    padding: 0 20px !important;
    border: 0;
    border-radius: 12px;
    background: var(--s-forest);
    font: 500 16px/1 var(--f-body);
    letter-spacing: normal;
    text-transform: none;
    color: var(--s-paper);
    box-shadow: none;
    transform: none;
}
.producto-v2 .pd-buy .pd-form form.cart .single_add_to_cart_button:hover {
    background: var(--s-deep);
    color: var(--s-paper);
    box-shadow: none;
    transform: none;
}

/* Granel: el peso arriba, el total y el botón a todo el ancho. */
.producto-v2 .pd-buy .pd-form form.cart:has(.almacen-peso-choose) {
    flex-direction: column;
    gap: 10px;
}
.producto-v2 .pd-buy .pd-form form.cart:has(.almacen-peso-choose) .quantity {
    display: none;
}
.producto-v2 .pd-buy .pd-form form.cart:has(.almacen-peso-choose) .single_add_to_cart_button {
    flex: none;
    width: 100%;
    margin-top: 6px;
}
.producto-v2 .pd-buy .almacen-peso-choose {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}
.producto-v2 .pd-buy .almacen-peso-choose .almacen-peso-hint {
    margin: 0;
    font: 800 11.5px/1.4 var(--f-body);
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: left;
    color: var(--s-muted);
}
.producto-v2 .pd-buy .almacen-peso-choose .almacen-peso-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.producto-v2 .pd-buy .almacen-peso-choose .almacen-peso-pill {
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0 6px;
    border: 1px solid #DCD3C2;
    border-radius: 10px;
    background: var(--s-paper);
    font: 700 14px var(--f-body);
    color: var(--s-ink);
    box-shadow: none;
}
.producto-v2 .pd-buy .almacen-peso-choose .almacen-peso-pill[aria-checked="true"] {
    background: var(--s-forest);
    border-color: var(--s-forest);
    color: var(--s-paper);
}
.producto-v2 .pd-buy .almacen-peso-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: #EDE6D8;
    font-size: 14px;
}
.producto-v2 .pd-buy .almacen-peso-total__label {
    font: 400 14px var(--f-body);
    color: var(--s-ink);
}
.producto-v2 .pd-buy .almacen-peso-total__value {
    font: 800 18px var(--f-body);
    color: var(--s-ink);
    font-variant-numeric: tabular-nums;
}

/* ---------- después del botón ---------- */
.producto-v2 .pd-done {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #F4F7F1;
    font-size: 14px;
    font-weight: 700;
    color: var(--s-forest);
}
.producto-v2 .pd-done svg {
    width: 16px;
    height: 16px;
    flex: none;
}
.producto-v2 .pd-done a {
    margin-left: auto;
    color: var(--s-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.producto-v2 .pd-info {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--s-line);
    border-radius: 14px;
    background: var(--s-paper);
}
.producto-v2 .pd-info > div {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
}
.producto-v2 .pd-info > div + div {
    border-top: 1px solid var(--s-line);
}
.producto-v2 .pd-info svg {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--s-forest);
}
.producto-v2 .pd-info p {
    margin: 0;
}
.producto-v2 .pd-info b {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--s-ink);
}
.producto-v2 .pd-info span {
    font-size: 13px;
    color: var(--s-muted);
}
.producto-v2 .pd-ask {
    display: flex;
    align-items: center;
    gap: 12px;
}
.producto-v2 .pd-wa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--s-forest);
    border-radius: 10px;
    font: 500 14px var(--f-body);
    color: var(--s-forest);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease;
}
.producto-v2 .pd-wa:hover {
    background: var(--s-sage);
    color: var(--s-forest);
}
.producto-v2 .pd-wa svg {
    width: 18px;
    height: 18px;
}
.producto-v2 .pd-ask p {
    margin: 0;
    font-size: 13px;
    color: var(--s-muted);
}
.producto-v2 .pd-sku {
    font-size: 12.5px;
    color: var(--s-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- descripción (sólo si hay) ---------- */
.producto-v2 .pd-desc {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 70ch;
    padding-top: 12px;
}
.producto-v2 .pd-desc h2 {
    margin: 0;
    font: 600 26px/1.1 var(--f-display, "Cormorant Garamond", Georgia, serif);
    color: var(--s-deep);
}
.producto-v2 .pd-desc-b {
    font-size: 15px;
    line-height: 1.6;
}
.producto-v2 .pd-desc-b p {
    margin: 0 0 10px;
}

/* ---------- También te puede servir ---------- */
.producto-v2 .pd-rel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 12px;
}
.producto-v2 .pd-rel:not(:has(.wc-block-product-template > li)) {
    display: none;
}
.producto-v2 .pd-rel > * {
    margin: 0;
}
.producto-v2 .pd-rel-h {
    margin: 0;
    font: 600 30px/1.1 var(--f-display, "Cormorant Garamond", Georgia, serif);
    letter-spacing: 0;
    color: var(--s-deep);
}
.producto-v2 .pd-collection .wc-block-product-template {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
/* Tarjetas anchas: precio y botón en el mismo renglón, como en la home. */
.producto-v2 .pd-collection .pc-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.producto-v2 .pd-collection .pc-foot .wp-block-button__link {
    width: auto !important;
}

/* ---------- barra de compra (teléfono) ---------- */
.pd-bar {
    display: none;
}

@media (max-width: 1080px) {
    .producto-v2 .pd-collection .pc-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .producto-v2 .pd-collection .pc-foot .wp-block-button__link {
        width: 100% !important;
    }
}

@media (max-width: 781px) {
    .producto-v2 main.producto-page {
        padding: 12px 16px 32px;
        gap: 14px;
    }
    .producto-v2 .pd {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .producto-v2 .pd-gal {
        position: relative;
        top: auto;
    }
    .producto-v2 .pd-gal .woocommerce-product-gallery__image,
    .producto-v2 .pd-gal .woocommerce-product-gallery__image--placeholder.pd-nofoto {
        aspect-ratio: auto;
        height: 260px;
        border-radius: 16px;
    }
    .producto-v2 .pd-gal .woocommerce-product-gallery__image img.wp-post-image {
        width: auto !important;
        height: 84% !important;
        max-width: 84%;
    }
    .producto-v2 .pd-buy {
        gap: 14px;
        max-width: none;
    }
    .producto-v2 .pd-name {
        font-size: 20px;
    }
    .producto-v2 .pd-big {
        font-size: 30px;
    }
    .producto-v2 .pd-ask {
        flex-direction: column;
        align-items: stretch;
    }
    .producto-v2 .pd-wa {
        justify-content: center;
    }
    .producto-v2 .pd-rel-h {
        font-size: 26px;
    }
    .producto-v2 .pd-collection .wc-block-product-template {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 10px !important;
        margin: 0 -16px;
        padding: 0 16px 4px;
        scrollbar-width: none;
    }
    .producto-v2 .pd-collection .wc-block-product-template::-webkit-scrollbar {
        display: none;
    }
    .producto-v2 .pd-collection .wc-block-product-template > li {
        flex: 0 0 44%;
        scroll-snap-align: start;
    }
    .producto-v2 .pd-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--s-paper);
        border-top: 1px solid var(--s-line);
        box-shadow: 0 -6px 18px rgba(44, 62, 45, .08);
        font-family: var(--f-body);
        transform: translateY(100%);
        visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
    }
    .producto-v2 .pd-bar.is-on {
        transform: none;
        visibility: visible;
        transition: transform .2s ease;
    }
    .producto-v2 .pd-bar-t {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
    }
    .producto-v2 .pd-bar-t span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        color: var(--s-muted);
    }
    .producto-v2 .pd-bar-t b {
        font-size: 18px;
        font-weight: 800;
        color: var(--s-deep);
        font-variant-numeric: tabular-nums;
    }
    .producto-v2 .pd-bar-b {
        flex: none;
        height: 46px;
        margin: 0;
        padding: 0 20px;
        border: 0;
        border-radius: 12px;
        background: var(--s-forest);
        font: 500 15px var(--f-body);
        color: var(--s-paper);
        cursor: pointer;
    }
}
@media (prefers-reduced-motion: reduce) {
    .producto-v2 .pd-bar,
    .producto-v2 .pd-bar.is-on {
        transition: none;
    }
}

/* ---------- lo que style.css le pone a cualquier precio o imagen de la ficha ---------- */
/* .single-product …product-price:not(.shop-product-price) (precio grande con raya dorada) y la sombra
   de las imágenes de la galería alcanzan también a las tarjetas de abajo. */
.producto-v2 .pd-collection .wp-block-woocommerce-product-price.price {
    position: static;
    margin: 0;
    padding: 0;
}
.producto-v2 .pd-collection .wp-block-woocommerce-product-price.price::after {
    content: none;
}
.producto-v2 .pd-collection .wp-block-woocommerce-product-price.price .woocommerce-Price-amount {
    font: inherit;
    color: inherit;
}
.producto-v2 .pd-collection .pc-img img,
.producto-v2 .pd-gal .woocommerce-product-gallery__image img {
    border-radius: 0;
    box-shadow: none;
}
.producto-v2 .producto-page .pd-rel h2.pd-rel-h {
    margin: 0;
    font: 600 30px/1.1 var(--f-display, "Cormorant Garamond", Georgia, serif);
    letter-spacing: 0;
    color: var(--s-deep);
}
@media (max-width: 781px) {
    .producto-v2 .producto-page .pd-rel h2.pd-rel-h {
        font-size: 26px;
    }
}
.producto-v2 .pd-collection .wp-block-woocommerce-product-price.price ins {
    font-size: inherit;
    font-weight: inherit;
}
.producto-v2 .pd-collection .wp-block-woocommerce-product-price.price del {
    font-size: 12.5px;
}
.producto-v2 .pd-buy .almacen-peso-choose .almacen-peso-options {
    max-width: none;
    width: 100%;
}
.producto-v2 .pd-bar-t b .woocommerce-Price-amount {
    font: inherit;
    color: inherit;
}
/* El clearfix de WooCommerce (form.cart::before/::after) cuenta como un hijo más del flex y corría
   la cantidad 10px. */
.producto-v2 .pd-buy .pd-form form.cart::before,
.producto-v2 .pd-buy .pd-form form.cart::after {
    content: none;
    display: none;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity,
.producto-v2 .pd-wa {
    box-sizing: border-box;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity input.qty {
    width: 30px;
}
.producto-v2 .pd-info p {
    font-size: 15px;
    line-height: 1.5;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity {
    gap: 0;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity .screen-reader-text {
    position: absolute;
}
.producto-v2 .pd-buy .pd-form form.cart .quantity input.qty {
    margin: 0;
    flex: none;
}
