/* Variables de Color */
:root {
    --rojo: #D32F2F;
    --gris-oscuro: #333333;
    --gris-medio: #666666;
    --gris-claro: #f4f4f4;
    --blanco: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }

body { line-height: 1.6; color: var(--gris-oscuro); scroll-behavior: smooth; }

/* Navegación */
header { background: var(--gris-oscuro); color: white; padding: 1rem 0; position: fixed; width: 100%; top: 0; z-index: 1000; }
.navbar { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: auto; padding: 0 20px; }
.logo { height: 30px; }
.hamburger { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.nav-links { list-style: none; display: flex; }
.nav-links li a { color: white; text-decoration: none; margin-left: 20px; transition: 0.3s; }
.nav-links li a:hover { color: var(--rojo); }

@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--gris-oscuro); flex-direction: column; padding: 10px 0; }
    .nav-links.open { display: flex; }
    .nav-links li { text-align: center; }
    .nav-links li a { margin: 10px 0; }
}

/* Hero */
.hero { height: 80vh; background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('images/hero.jpg'); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; text-align: center; color: white; margin-top: 60px; }
.hero h1 { font-size: 3rem; }
.text-red { color: var(--rojo); }
.btn-main { background: var(--rojo); color: white; padding: 10px 25px; text-decoration: none; border-radius: 5px; display: inline-block; margin-top: 20px; border: none; cursor: pointer; }

/* Secciones Generales */
.container { max-width: 1100px; margin: auto; padding: 60px 20px; }
.flex-container { display: flex; gap: 20px; }
.section-title { text-align: center; margin-bottom: 40px; font-size: 2rem; border-bottom: 3px solid var(--rojo); display: inline-block; left: 50%; position: relative; transform: translateX(-50%); }
.bg-light { background: var(--gris-claro); }
.section-title.no-border { border: none; transform: none; left: 0; text-align: left; display: block; margin-bottom: 12px; }

/* Servicios */
.service-section { padding-top: 20px; }
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.service-image img { width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); object-fit: cover; }
.service-content { display: flex; flex-direction: column; gap: 14px; }
.service-badge { display: inline-block; background: rgba(211,47,47,0.1); color: var(--rojo); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.2px; }
.service-list { margin-left: 18px; color: var(--gris-oscuro); line-height: 1.6; }
.service-list li { margin-bottom: 6px; }

@media (max-width: 900px) {
    .service-grid { grid-template-columns: 1fr; }
    .section-title.no-border { text-align: center; }
    .service-content { align-items: center; text-align: center; }
    .service-list { text-align: left; }
}

/* Sidebar */
.sidebar { width: 200px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.sidebar h3 { margin-bottom: 15px; color: var(--gris-oscuro); }
.filter-btn { display: block; width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ddd; background: white; cursor: pointer; border-radius: 5px; transition: 0.3s; }
.filter-btn:hover, .filter-btn.active { background: var(--rojo); color: white; }

/* Products Main */
.products-main { flex: 1; }

/* Productos */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.product-card { background: white; border: 1px solid #ddd; padding: 15px; border-radius: 8px; text-align: center; transition: 0.3s; cursor: pointer; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.product-card img { max-width: 100%; height: 200px; object-fit: cover; }
.card-price { color: var(--rojo); font-weight: 700; margin: 4px 0; }

/* Featured Grid */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; }

/* Modal */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); }
.modal-content { background: white; margin: 5% auto; padding: 20px; width: 95%; max-width: 900px; border-radius: 8px; position: relative; }
.close-modal { position: absolute; right: 20px; top: 10px; font-size: 2rem; cursor: pointer; }
.modal-body { display: flex; gap: 20px; align-items: flex-start; max-height: calc(100vh - 160px); overflow: auto; }
.modal-img { flex: 0 0 220px; }
.modal-img img { width: 100%; height: auto; border-radius: 6px; object-fit: cover; }
.modal-info { flex: 1; min-width: 0; }
#modal-img { max-width: 100%; height: auto; object-fit: contain; }

/* Extra-spec wrapper: allow horizontal scroll without breaking modal */
#extra-spec { margin-top: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#extra-spec .extra-table { min-width: 760px; width: 100%; table-layout: auto; border-collapse: collapse; }
.extra-table th, .extra-table td { border: 1px solid #bbb; padding: 8px; text-align: center; font-weight: 600; font-size: 0.95rem; }
.extra-table thead th { background: #f4f4f4; }

@media (max-width: 768px) {
    .modal-body { flex-direction: column; }
    .modal-img { flex: 0 0 auto; width: 100%; max-width: 400px; margin: 0 auto; }
    #extra-spec .extra-table { min-width: 700px; }
    .modal-content { margin: 8% auto; padding: 16px; }
}
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
table td, table th { border: 1px solid #ddd; padding: 8px; font-size: 0.9rem; }

/* Tabla extra de especificaciones */
.extra-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.extra-table th, .extra-table td { border: 2px solid #333; padding: 10px; text-align: center; font-weight: 600; }
.extra-table thead th { background: #f4f4f4; }
@media (max-width: 768px) {
    .extra-table td, .extra-table th { font-size: 0.8rem; padding: 6px; }
}

/* Nosotros y Contacto */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.about-card { background: white; padding: 30px; border-top: 5px solid var(--rojo); display: flex; flex-direction: column; align-items: center; text-align: center; }
.about-card img { width: 100%; max-width: 300px; height: 200px; object-fit: cover; border-radius: 8px; margin-bottom: 15px; }

/* Sección "Nosotros" - formato profesional */
.about-intro.professional { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; margin-bottom: 40px; }
.about-intro.professional .intro-media img { width: 100%; max-width: 560px; height: auto; border-radius: 10px; display: block; margin: 0 auto; }
.about-intro.professional .intro-text { font-size: 1rem; line-height: 1.7; color: var(--gris-oscuro); }
.about-intro.professional .lead { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: var(--gris-oscuro); }

@media (min-width: 768px) {
    .about-intro.professional { grid-template-columns: 1fr 1fr; }
    .about-intro.professional .intro-text { padding-left: 20px; }
}

/* Product detail - Layout dividido */
.product-detail { margin-top: 30px; }

/* Sección superior: imagen + descripción lado a lado */
.detail-top { display: grid; grid-template-columns: 320px 1fr; gap: 30px; align-items: start; }
.detail-media img { width: 100%; border-radius: 8px; }
.detail-description h1 { margin-top: 0; font-size: 1.8rem; }
.detail-description .lead { font-size: 0.95rem; line-height: 1.6; }
.price-tag { font-size: 1.2rem; font-weight: 700; color: var(--rojo); margin: 6px 0 12px; }

/* Separador horizontal */
.detail-separator { margin: 30px 0; border: none; border-top: 2px solid #e0e0e0; }

/* Sección inferior: ficha técnica alineada a la izquierda */
.detail-bottom { display: flex; justify-content: flex-start; }
.detail-specs-section { max-width: 100%; }
.detail-specs-section h3 { color: var(--rojo); font-size: 1.5rem; margin-bottom: 8px; border-bottom: 2px solid var(--rojo); display: inline-block; padding-bottom: 4px; }
.detail-specs-section h4 { font-size: 1rem; margin-top: 20px; margin-bottom: 10px; }
.detail-specs-section table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.detail-specs-section table th, .detail-specs-section table td { border: 1px solid #ccc; padding: 10px; text-align: center; }
.detail-specs-section table th { background: #f9f9f9; font-weight: 600; }

@media (max-width: 768px) {
    .detail-top { grid-template-columns: 1fr; }
    .detail-media { text-align: center; }
    .detail-specs-section { width: 100%; }
}

/* Breadcrumbs */
.breadcrumbs { font-size: 0.95rem; color: var(--gris-medio); margin: 18px 0; display: flex; gap: 8px; align-items: center; }
.breadcrumbs a { color: var(--gris-medio); text-decoration: none; }
.breadcrumbs a:hover { color: var(--rojo); }
.breadcrumbs .sep { color: #bbb; margin: 0 6px; }
.breadcrumbs .home-icon { font-size: 1.05rem; margin-right: 6px; }

.about-stats { display: flex; justify-content: space-around; margin-top: 40px; flex-wrap: wrap; }
.stat { text-align: center; margin: 10px; }
.stat h4 { font-size: 2rem; color: var(--rojo); margin-bottom: 5px; }
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; }
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.btn-whatsapp { background: #25D366; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; font-weight: 700; display: inline-block; }
.btn-whatsapp:hover { background: #1ebe5a; }
footer { background: var(--gris-oscuro); color: white; text-align: center; padding: 20px; }

@media (max-width: 768px) { 
    .contact-wrapper { grid-template-columns: 1fr; } 
    .modal-content { width: 95%; margin: 10% auto; } 
    .container { flex-direction: column; }
    .sidebar { width: 100%; }
}