:root {
    --primary-color: #3D3D3C;
    --secondary-color: #45b8b1;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --white: #fff;
    --black: #000;
    --highlight: #3498db;
}

/* ===== ESTILOS GENERALES ===== */
#detalleProducto {
    max-width: 1296px;
    margin: 110px auto 0 auto;
    padding: 20px;
    font-family: 'Arial', sans-serif;
}

.breadcrumb {
    margin: 10px 0 20px 0;
    clear: both;
}

/* ===== TÍTULOS RESPONSIVE ===== */
/* Título móvil - Solo visible en móviles */
.titulo-movil {
    display: none;
    margin-bottom: 20px;
}

.nombre-producto-movil {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin-bottom: 5px;
}

.referencia-producto-movil {
    font-size: 14px;
    color: #666;
}

/* Título desktop - Oculto en móviles */
.nombre-producto {
    font-size: 24px;
    margin-bottom: 5px;
    color: #000;
}

.referencia-producto {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ===== SISTEMA DE MENSAJES ===== */
.contenedor-mensajes {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
    position: relative;
    z-index: 100;
}

.mensaje-exito, 
.mensaje-error {
    position: relative;
    width: 100%;
    padding: 15px 50px 15px 15px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideInFromTop 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mensaje-exito {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 5px solid #28a745;
}

.mensaje-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 5px solid #dc3545;
}

.icono-mensaje {
    font-size: 20px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.cerrar-mensaje {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.cerrar-mensaje:hover {
    opacity: 1;
}

/* ===== LAYOUT PRINCIPAL ===== */
.contenedor-superior {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

/* ===== COLUMNA IZQUIERDA - IMÁGENES Y DESCRIPCIÓN ===== */
.contenedor-imagen {
    flex: 1;
}

.imagen-principal-container {
    position: relative;
    margin-bottom: 30px;
}

.imagen-principal {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.imagen-principal.loading {
    opacity: 0.5;
}

.imagen-principal.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* ===== MINIATURAS DE COLORES Y VARIANTES ===== */
.miniaturas-colores {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.miniaturas-colores h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
}

/* Galería de variantes - estilo ligeramente diferente */
.galeria-variantes {
    background-color: #f0fffd;
    border-left: 4px solid #45b8b1;
}

.galeria-variantes h4 {
    color: #45b8b1;
}

.miniaturas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.miniatura-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: white;
    border: 2px solid transparent;
    min-width: 80px;
    position: relative;
}

.miniatura-item:hover {
    background-color: #e9ecef;
    border-color: #45b8b1;
    transform: translateY(-2px);
}

/* Estados para colores */
.miniatura-item.selected {
    border-color: #46b8b0;
    background-color: #d4edeb;
}

.miniatura-item.selected::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #46b8b0;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Estados para variantes */
.miniatura-item.active {
    border-color: #45b8b1;
    background-color: #e3f2fd;
}

.miniatura-item.active::after {
    content: '●';
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #45b8b1;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}

.miniatura {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.miniatura-item:hover .miniatura {
    transform: scale(1.05);
}

.miniatura-label {
    margin-top: 5px;
    font-size: 11px;
    text-align: center;
    font-weight: 500;
    color: #666;
    line-height: 1.2;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Compatibilidad con el nombre anterior */
.color-label {
    margin-top: 5px;
    font-size: 11px;
    text-align: center;
    font-weight: 500;
    color: #666;
    line-height: 1.2;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== DESCRIPCIÓN DEL PRODUCTO ===== */
.descripcion-producto {
    margin-top: 20px;
}

.descripcion-producto h2 {
    font-size: 22px;
    color: #000;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.descripcion-producto p {
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.especificaciones-lista {
    list-style-type: none;
    padding: 0;
}

.especificaciones-lista li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: #000;
}

.especificaciones-lista li:before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* ===== COLUMNA DERECHA - CALCULADORA ===== */
.contenedor-calculadora {
    width: 400px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ===== PRECIOS ===== */
.precios-container {
    margin: 20px 0;
}

.precios-container h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.precio {
    color: #46b8b0;
    font-weight: bold;
    font-size: 2rem;
    display: block;
}

.impuestos-nota {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

/* ===== FORMULARIO ===== */
#formPresupuesto {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.btn-presupuesto {
    width: 100%;
    padding: 15px;
    background-color: #46b8b0;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-presupuesto:hover:not(:disabled) {
    background-color: #46b8b0;
    transform: translateY(-1px);
}

.btn-presupuesto:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contacto-alternativo {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.contacto-alternativo a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contacto-alternativo a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ===== ANIMACIONES ===== */
@keyframes slideInFromTop {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.mensaje-saliendo {
    animation: fadeOut 0.3s ease-out forwards;
}

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

/* Tablets */
@media (max-width: 900px) {
    .contenedor-superior {
        flex-direction: column;
        gap: 20px;
    }
    
    .contenedor-calculadora {
        width: 100%;
        margin-top: 20px;
    }
    
    .imagen-principal {
        max-height: 400px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    #detalleProducto {
        margin-top: 105px;
        padding: 20px;
    }

     .intro-section {
        flex-direction: column;
    }
    
    
    /* Mostrar título móvil, ocultar título desktop */
    .titulo-movil {
        display: block;
    }
    
    .nombre-producto,
    .referencia-producto {
        display: none;
    }
    
    /* Ajustar mensajes */
    .contenedor-mensajes {
        padding: 0 10px;
    }
    
    .mensaje-exito, 
    .mensaje-error {
        padding: 12px 40px 12px 12px;
        font-size: 14px;
    }
    
    .icono-mensaje {
        font-size: 16px;
    }
    
    /* Ajustar calculadora */
    .contenedor-calculadora {
        padding: 15px;
    }
    
    /* Ajustar miniaturas */
    .miniaturas-grid {
        justify-content: center;
    }
    
    .miniatura-item {
        min-width: 70px;
    }
    
    .miniatura {
        width: 50px;
        height: 50px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    #detalleProducto {
        padding: 10px;
    }
    
    .contenedor-superior {
        gap: 15px;
    }
    
    .nombre-producto-movil {
        font-size: 18px;
    }
    
    .contenedor-calculadora {
        padding: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Sección introductoria */
.intro-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.search-container {
    flex: 1;
    min-width: 300px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-form input:focus {
    border-color: var(--highlight);
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.search-button {
    padding: 12px 15px;
    background-color: #000;
    color: var(--white);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: var(--secondary-color);
}

.clear-search {
    margin-left: 15px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.clear-search:hover {
    text-decoration: underline;
}
