/*
 * Variantes y galería de productos - INSUMOS PRO PTY
 * Este archivo complementa estilos.css y puede mantenerse de forma independiente.
 */

/* Evita que cualquier imagen de producto se salga de su contenedor. */
.product-card img,
.product-image img,
.item-icon img,
.detail-image img,
.product-thumbnail img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* La imagen principal mantiene un área estable aun con fotografías muy grandes. */
.product-gallery {
    min-width: 0;
}

.detail-image {
    overflow: hidden;
    min-height: 420px;
    max-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.detail-image img {
    max-height: 470px;
}

/* Miniaturas de imágenes adicionales. */
.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.product-thumbnail {
    height: 78px;
    padding: 6px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.product-thumbnail:hover,
.product-thumbnail.active {
    border-color: var(--primary, #168bd2);
    box-shadow: 0 0 0 2px rgba(22, 139, 210, .12);
}

/* Selector de color. */
.product-variants {
    margin: 20px 0;
}

.product-variants label {
    display: block;
    margin-bottom: 7px;
}

.product-variants select {
    max-width: 340px;
}

.variant-help {
    display: block;
    margin-top: 6px;
    color: #6c757d;
}

/* Color seleccionado visible en carrito y cotización. */
.selected-variant {
    display: block;
    margin-top: 3px;
    color: #526273;
}

/* En pantallas pequeñas reducimos la altura para aprovechar el espacio. */
@media (max-width: 767.98px) {
    .detail-image {
        min-height: 300px;
        max-height: 380px;
        padding: 16px;
    }

    .detail-image img {
        max-height: 340px;
    }
}
