/* Modal de Detalles del Producto */
#product-details-modal .modal-content {
    max-width: 820px; /* ampliado para más espacio horizontal */
    width: 50%; /* antes 40% */
    min-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
}

.product-details-container {
    display: grid;
    /* Más espacio para la imagen (izquierda) y columna de info compacta a la derecha */
    grid-template-columns: 1.35fr 0.95fr; /* ligeramente más ancho a la derecha */
    gap: 2rem; /* mayor separación horizontal */
    padding: 0.4rem;
    align-items: stretch; /* asegura alturas iguales en columnas */
}

.product-details-images {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    height: 100%;
    padding-right: 0.4rem; /* empuja un poco más a la izquierda respecto a la info */
}

.detail-main-img {
    width: 100%;
    /* Imagen más prominente */
    height: 340px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.35s ease, filter 0.35s ease;
    cursor: zoom-in;
    transform-origin: center center;
}

/* Estado zoom (x2) */
.detail-main-img.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

/* Arrastre activo */
.detail-main-img.zoomed.dragging {
    cursor: grabbing;
}

/* Contenedor para ocultar overflow al hacer zoom */
.product-details-images {
    overflow: hidden;
    position: relative;
}

.detail-thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: auto; /* alinea al fondo para coincidir con el botón de la derecha */
}

.detail-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.detail-thumbnail:hover {
    border-color: var(--highlight);
    transform: scale(1.05);
}

.detail-thumbnail.active {
    border-color: var(--accent);
}

.product-details-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem; /* más compacto */
    height: 100%;
}
.product-details-info h2 {
    font-size: 1.35rem;
    color: var(--light);
    margin: 0;
    font-weight: 700;
}

.detail-price {
    font-size: 1.3rem;
    color: var(--highlight);
    font-weight: 700;
}

.detail-description {
    color: #333333;
    line-height: 1.5;
    font-size: 0.9rem;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.detail-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--light);
}

.size-selector {
    display: flex;
    gap: 0.8rem;
}

.size-btn {
    width: 42px;
    height: 42px;
    border: 2px solid #e6e6e6;
    background: white;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    color: var(--light);
    padding: 0;
}

.size-btn:hover {
    border-color: var(--highlight);
    color: var(--highlight);
}

.size-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.color-selector {
    display: flex;
    gap: 0.8rem;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.color-btn[data-color="Intel"] {
    background-color: #0071c5;
}

.color-btn[data-color="AMD"] {
    background-color: #ed1c24;
}

.color-btn[data-color="NVIDIA"] {
    background-color: #76b900;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: #999;
}

.color-btn.selected {
    border-color: var(--accent);
    border-width: 3px;
}

.color-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.detail-stock {
    color: #28a745;
    font-weight: 600;
    font-size: 0.85rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: fit-content;
}

.qty-btn {
    width: 34px;
    height: 34px;
    border: 2px solid var(--accent);
    background: white;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--accent);
    color: white;
}

#detail-quantity {
    width: 48px;
    height: 34px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid #eee;
    border-radius: 8px;
    color: var(--light);
}

.detail-add-btn {
    margin-top: auto; /* empuja el botón al fondo para alinear con miniaturas */
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 992px) {
    #product-details-modal .modal-content {
        width: 60%;
        min-width: 350px;
    }
}

@media (max-width: 768px) {
    #product-details-modal .modal-content {
        width: 90%;
        min-width: unset;
        max-height: 90vh;
    }

    .product-details-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-main-img {
        height: 220px;
    }

    .product-details-info h2 {
        font-size: 1.3rem;
    }

    .detail-price {
        font-size: 1.3rem;
    }

    .detail-description {
        font-size: 0.85rem;
    }

    /* En mobile, thumbnails inmediatamente debajo de la imagen */
    .detail-thumbnails {
        margin-top: 0.5rem;
    }

    .detail-add-btn {
        margin-top: 0.75rem;
    }

    .size-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .qty-btn {
        width: 32px;
        height: 32px;
    }

    #detail-quantity {
        width: 45px;
        height: 32px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    #product-details-modal .modal-content {
        width: 95%;
        padding: 1.5rem 1rem;
    }

    .detail-main-img {
        height: 180px;
    }

    .product-details-info h2 {
        font-size: 1.1rem;
    }

    .detail-price {
        font-size: 1.2rem;
    }

    .size-selector {
        gap: 0.6rem;
    }

    .size-btn {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}
