/* ===== PRODUCTOS.CSS - ESTILOS COMPLETOS DE PRODUCTOS.PHP ===== */

/* =========================================
   RESET Y CONFIGURACIÓN BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f8ff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   HEADER
   ========================================= */
header {
    background-color: #19376D !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid #0d2a55 !important;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #333;
    padding: 15px 0;
    display: block;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
main {
    padding: 40px 0;
}

h1 {
    text-align: center;
    color: #19376D;
    margin-bottom: 40px;
    font-size: 32px;
    font-weight: 700;
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #d32f2f;
    margin: 15px auto 0;
    border-radius: 2px;
}

/* =========================================
   MENSAJE DE ERROR
   ========================================= */
.mensaje-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    text-align: center;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid #d32f2f;
}

/* =========================================
   DROPDOWNS NATIVOS (Categorías/Marcas)
   ========================================= */
.categoria-menu, .filtro-marca {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 30px 0;
}

details summary {
    list-style: none;
    cursor: pointer;
    padding: 12px;
    background: #f0f8ff;
    color: #19376D;
    border-radius: 6px;
    font-weight: 600;
    outline: none;
    user-select: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::after {
    content: "▼";
    float: right;
    font-size: 12px;
    transition: transform 0.3s;
}

details[open] summary::after {
    transform: rotate(180deg);
}

details summary:focus {
    outline: 2px solid #19376D;
}

details div a {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f8ff;
    color: #19376D;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
    margin: 5px 5px 5px 0;
}

details div a:hover,
details div a[style*="background:#19376D"] {
    background: #19376D;
    color: white;
}

/* =========================================
   CONTENEDOR DE PRODUCTOS
   ========================================= */
.productos-contenedor {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

/* =========================================
   TARJETA DE PRODUCTO
   ========================================= */
.producto-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow:
        0 4px 15px rgba(0,0,0,0.12),
        0 0 20px rgba(114, 47, 55, 0.35),
        0 0 35px rgba(114, 47, 55, 0.25);
    transition: all 0.3s ease;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 10px 25px rgba(0,0,0,0.18),
        0 0 30px rgba(114, 47, 55, 0.5),
        0 0 45px rgba(114, 47, 55, 0.35);
}

.producto-imagen {
    height: 180px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.producto-imagen img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.producto-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-info h3 {
    color: #19376D;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
}

.producto-marca {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}

.descripcion-accesorio {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    margin: 12px 0;
    font-style: normal;
}

.medida-construccion {
    background: #e8f5e9;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
}

.stock-info {
    margin: 12px 0;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.stock-disponible {
    background: #e8f5e9;
    color: #2e7d32;
}

.stock-agotado {
    background: #ffebee;
    color: #c62828;
}

.precio {
    font-size: 20px;
    font-weight: 700;
    color: #d32f2f;
    margin: 15px 0;
}

/* =========================================
   FORMULARIO DE COMPRA
   ========================================= */
.form-compra {
    margin-top: auto;
}

.form-group {
    margin: 12px 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #19376D;
}

/* =========================================
   BOTONES
   ========================================= */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #d32f2f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    background: #b71c1c;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =========================================
   WHATSAPP FLOTANTE
   ========================================= */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    text-decoration: none;
}

.whatsapp-float i {
    margin-top: 16px;
}

/* =========================================
   CARRITO FLOTANTE
   ========================================= */
.carrito-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #d32f2f;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: 24px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carrito-float:hover {
    background-color: #b71c1c;
    transform: scale(1.1);
}

.carrito-float i {
    margin: 0;
}

.contador-carrito {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #FFD700;
    color: #19376D;
    font-weight: bold;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* =========================================
   BADGES DE CONFIANZA
   ========================================= */
.badges-confianza {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.badge {
    background: #f0f8ff;
    color: #19376D;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* =========================================
   SELECTOR DE COLORES
   ========================================= */
.selector-color {
    margin: 15px 0;
}

.buscador-colores {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin: 10px 0;
}

.contenedor-colores {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.colores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    background: #fafafa;
    border: 2px solid transparent;
}

.color-item:hover {
    background: #e3f2fd;
}

.color-item input[type="radio"]:checked + .color-preview {
    border-color: #19376D;
    transform: scale(1.1);
}

.color-preview {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #ddd;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.color-nombre {
    font-size: 11px;
    color: #333;
    font-weight: 500;
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================
   SELECTOR POR FAMILIAS (TONALIDADES)
   ========================================= */
.color-base-item {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-base-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(114, 47, 55, 0.4);
}

.color-base-item.selected {
    border-color: #19376D !important;
    background: #e3f2fd !important;
}

.tonalidades-container {
    background: white;
    border: 2px solid #19376D;
    border-radius: 12px;
    padding: 15px;
    animation: slideDown 0.3s ease;
    margin-top: 10px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-cerrar-tonalidades {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-cerrar-tonalidades:hover {
    background: #ffebee;
}

#grid-tonalidades .color-item {
    padding: 6px;
}

#grid-tonalidades .color-preview {
    width: 40px;
    height: 40px;
}

#grid-tonalidades .color-nombre {
    font-size: 10px;
    max-width: 75px;
}

.color-item input[type="radio"]:checked + .color-preview {
    border: 3px solid #19376D;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #19376D;
}

/* =========================================
   INPUT DE CANTIDAD CON VALIDACIÓN
   ========================================= */
.cantidad-input {
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cantidad-input:invalid {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* =========================================
   BOTÓN VER MÁS (PINTURAS)
   ========================================= */
.btn-ver-mas {
    background: #19376D;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    margin-top: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ver-mas:hover {
    background: #0d2a55;
}

.info-oculta {
    display: none;
    animation: slideDown 0.3s ease;
}

.info-oculta.visible {
    display: block;
}

.producto-card.expandida .info-oculta {
    display: block;
}

.btn-ver-mas .icono {
    transition: transform 0.3s;
}

.producto-card.expandida .btn-ver-mas .icono {
    transform: rotate(180deg);
}

/* =========================================
   PAGINACIÓN
   ========================================= */
.paginacion-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagina-info {
    background: #19376D;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    margin-right: 15px;
}

.paginacion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: white;
    color: #19376D;
    border: 2px solid #19376D;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.paginacion-btn:hover {
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 55, 109, 0.3);
}

.paginacion-btn.activa {
    background: #19376D;
    color: white;
    cursor: default;
}

.paginacion-btn.activa:hover {
    transform: none;
    box-shadow: none;
}

.paginacion-btn.deshabilitado {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: #19376D;
    color: white;
    padding: 40px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-info {
    text-align: center;
    flex: 1;
    min-width: 250px;
}

.footer-info h3 {
    margin: 0 0 20px;
    font-size: 22px;
    color: white;
    font-weight: 600;
}

.footer-item {
    margin: 12px 0;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    padding-left: 25px;
}

.footer-item span {
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 18px;
}

.footer-item .gold { color: #FFD700; }
.footer-item .green { color: #25D366; }

.footer-divider {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 25px 0;
}

.footer-copyright {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.footer-copyright p {
    margin: 5px 0;
}

/* =========================================
   MENÚ Y NAVEGACIÓN
   ========================================= */
.menu {
    display: flex;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.menu li a:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.menu-toggle {
    display: none;
    font-size: 28px;
    color: white;
    padding: 10px;
    cursor: pointer;
    background: #1e3c72;
    border-radius: 4px;
}

/* =========================================
   BOTÓN HAMBURGUESA
   ========================================= */
.navToggle {
    display: none !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    margin-left: auto;
}

.navToggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navToggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navToggle.active span:nth-child(2) {
    opacity: 0;
}

.navToggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* =========================================
   SCROLL PERSONALIZADO
   ========================================= */
.contenedor-colores::-webkit-scrollbar {
    width: 6px;
}

.contenedor-colores::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 3px;
}

.contenedor-colores::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav a {
        padding: 12px 20px;
        margin: 5px 0;
        display: block;
    }
    
    .productos-contenedor {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    details div a {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-logo {
        text-align: center !important;
        margin: 10px 0;
    }
    
    .colores-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
    }
    
    .color-preview {
        width: 35px !important;
        height: 35px !important;
    }
    
    .paginacion-container {
        flex-wrap: wrap;
    }
    
    .pagina-info {
        width: 100%;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .menu {
        flex-direction: column;
        display: none;
        background: #1e3c72;
        width: 100%;
    }
    
    .menu li {
        text-align: center;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .menu.active {
        display: flex;
    }
    
    .navToggle {
        display: flex !important;
    }
    
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #19376D;
        flex-direction: column;
        padding: 25px 20px;
        gap: 10px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
    }
    
    .nav.active {
        transform: translateX(0);
    }
    
    body.menu-open {
        overflow: hidden;
    }
}

nav ul li a:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* =========================================
   PREVENIR DESBORDAMIENTO
   ========================================= */
* {
    max-width: 100%;
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}
