/**
 * product-single.css — Mallorkinas Child Theme
 * Producto individual: galería, precio, variaciones (Woo Variation Swatches),
 * botón add to cart, wishlist, descripción corta, texto extra, productos relacionados.
 */

/* =========================================================
   LAYOUT PRODUCTO INDIVIDUAL
   ========================================================= */

.woocommerce div.product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.woocommerce div.product .woocommerce-product-gallery {
    grid-column: 1;
}

.woocommerce div.product .summary {
    grid-column: 2;
    position: sticky;
    top: 100px;
}

@media (max-width: 768px) {
    .woocommerce div.product {
        grid-template-columns: 1fr;
    }

    .woocommerce div.product .summary {
        position: static;
    }
}

/* =========================================================
   GALERÍA
   ========================================================= */

.woocommerce-product-gallery {
    position: relative;
    border-radius: var(--mk-radius-card);
    overflow: hidden;
}

.woocommerce-product-gallery__image img {
    width: 100%;
    border-radius: var(--mk-radius-card);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}

/* Thumbnails */
.woocommerce-product-gallery__wrapper.flex-viewport {
    border-radius: var(--mk-radius-card);
    overflow: hidden;
}

ol.flex-control-thumbs {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
    overflow-x: auto;
}

ol.flex-control-thumbs li img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--mk-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--mk-transition);
}

ol.flex-control-thumbs li img.flex-active,
ol.flex-control-thumbs li img:hover {
    border-color: var(--mk-color-primary);
}

/* =========================================================
   SUMMARY (panel derecho)
   ========================================================= */

.woocommerce div.product .summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Categoría / breadcrumb en producto */
.posted_in,
.woocommerce div.product .product_meta {
    font-size: var(--mk-font-size-xs);
    color: var(--mk-text-muted);
}

.posted_in a,
.product_meta a {
    color: var(--mk-text-muted);
    text-decoration: none;
}

.posted_in a:hover,
.product_meta a:hover {
    color: var(--mk-color-primary);
}

/* Título */
.woocommerce div.product h1.product_title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--mk-text-main);
    margin-bottom: 8px;
}

/* =========================================================
   DESCRIPCIÓN CORTA (.descripcion-corta-estilizada)
   Clase usada por el snippet "form compra"
   ========================================================= */

.descripcion-corta-estilizada {
    font-size: var(--mk-font-size-sm);
    color: var(--mk-text-muted);
    line-height: 1.7;
    padding: 14px 16px;
    background: var(--mk-bg-section);
    border-radius: var(--mk-radius-md);
    border-left: 3px solid var(--mk-color-primary);
    margin-bottom: 8px;
}

.descripcion-corta-estilizada p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   VARIACIONES — WOO VARIATION SWATCHES
   ========================================================= */

/* Contenedor de atributo */
.variations_form .variations {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

/* Label del atributo */
.variations_form .variations .label label {
    font-size: var(--mk-font-size-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mk-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Swatches de color */
.wvs-swatches-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Swatch de color */
.wvs-term-color,
[class*="wvs-type-color"] span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--mk-transition), transform var(--mk-transition);
}

[class*="wvs-type-color"] span:hover,
[class*="wvs-type-color"].selected span {
    border-color: var(--mk-color-primary);
    transform: scale(1.1);
}

/* Swatch de talla (texto) */
[class*="wvs-type-label"] span,
.wvs-term-label span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: var(--mk-radius-sm);
    border: 1px solid var(--mk-border-color);
    background: var(--mk-bg-card);
    font-size: var(--mk-font-size-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--mk-transition);
}

[class*="wvs-type-label"]:hover span,
[class*="wvs-type-label"].selected span {
    border-color: var(--mk-color-primary);
    background: var(--mk-color-primary);
    color: #fff;
}

/* Swatch deshabilitado */
[class*="wvs-type-"]:not(.enabled) span {
    opacity: 0.35;
    cursor: not-allowed;
    position: relative;
}

/* =========================================================
   BOTÓN AÑADIR AL CARRITO (producto individual)
   ========================================================= */

.woocommerce div.product form.cart {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    flex: 1;
    min-width: 180px;
    font-size: var(--mk-font-size-base);
    padding: 14px 24px;
}

/* =========================================================
   TEXTO EXTRA PRODUCTO ([texto_extra_producto])
   ========================================================= */

.mk-product-extra-text {
    font-size: var(--mk-font-size-sm);
    color: var(--mk-text-muted);
    line-height: 1.7;
    padding: 12px 16px;
    border: 1px solid var(--mk-border-color);
    border-radius: var(--mk-radius-md);
}

.mk-product-extra-text p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   PRODUCTOS RELACIONADOS
   ========================================================= */

.related.products,
.upsells.products {
    margin-top: 60px;
}

.related.products h2,
.upsells.products h2 {
    font-size: var(--mk-font-size-h3);
    margin-bottom: 24px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    .woocommerce div.product form.cart {
        flex-direction: column;
        align-items: stretch;
    }

    .woocommerce div.product form.cart .single_add_to_cart_button {
        width: 100%;
    }
}
