:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #253045;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #cbd5e1;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #10b981;
    --critical: #f59e0b;
    --border: #334155;
    --font-main: 'Montserrat', sans-serif;
}

/* --- RESET Y ESTILOS BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 80px; /* Space for fixed navbar */
    overflow-x: hidden; /* Prevent horizontal scroll */
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    width: 100%;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
}
.navbar .container {
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-weight: 800; font-size: 1.5rem; color: #fff;
    text-transform: uppercase; letter-spacing: -1px;
    white-space: nowrap; /* Prevent logo breaking */
}
.logo span { color: var(--primary); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
    font-weight: 600; font-size: 0.95rem; color: var(--text-primary);
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--primary); }

.mobile-menu-btn { display: none; font-size: 1.5rem; background: none; border: none; color: #fff; cursor: pointer; }

/* --- CLASES DE UTILIDAD --- */
.highlight-blue { color: var(--primary); }
.subtitle {
    text-align: center; font-size: 1.2rem; color: var(--text-secondary);
    margin-bottom: 3rem; max-width: 800px; margin-left: auto; margin-right: auto;
    padding: 0 1rem;
}
.card-badge {
    display: inline-block; font-size: 0.8rem; font-weight: 700;
    background: var(--primary); color: #fff; padding: 4px 12px;
    border-radius: 20px; margin-bottom: 1rem; text-transform: uppercase;
}
.card-badge.critical { background: var(--critical); color: var(--bg-dark); }

/* --- HERO HARDWARE --- */
.hardware-hero {
    text-align: center; padding: 4rem 1rem;
    background: radial-gradient(circle at top center, #1e293b 0%, #0f172a 70%);
}
.hardware-hero h1 {
    font-size: 3rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -1px;
    line-height: 1.2;
    word-wrap: break-word; /* Prevent long words breaking layout */
    overflow-wrap: break-word;
}
.hardware-hero h1 span {
    display: block; font-size: 1.5rem; font-weight: 600; color: var(--primary); margin-top: 0.5rem; text-transform: uppercase;
}

/* --- GRID COMPONENTES --- */
/* Changed minmax from 280px to 100% on small screens to prevent overflow */
.components-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem; margin-top: 3rem;
}

.gear-card {
    background: var(--bg-card); border-radius: 16px; overflow: hidden;
    border: 1px solid var(--border); transition: all 0.3s ease; position: relative;
    display: flex; flex-direction: column;
}
.gear-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5); border-color: var(--primary);
}
.card-image-container {
    height: 220px; background: #fff; display: flex;
    align-items: center; justify-content: center; padding: 20px;
}
.card-image-container img {
    max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 0.3s ease;
}
.gear-card:hover .card-image-container img { transform: scale(1.05); }
.card-content { padding: 1.5rem; text-align: left; flex-grow: 1; display: flex; flex-direction: column; }
.card-content h3 { font-size: 1.4rem; margin-bottom: 0.5rem; color: #fff; overflow-wrap: break-word; }
.card-content p { margin-bottom: 1rem; font-size: 0.95rem; color: var(--text-muted); }

.benefits-list { list-style: none; margin-top: auto; }
.benefits-list li {
    margin-bottom: 0.8rem; padding-left: 1.5rem; position: relative; font-size: 0.9rem; color: var(--text-muted);
}
.benefits-list li::before {
    content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: bold;
}

/* --- SOFTWARE SECTION --- */
.section-divider {
    height: 80px; background: linear-gradient(to bottom, #1e293b, #0f172a); margin-bottom: 2rem;
}
.software-section { background-color: var(--bg-dark); padding-bottom: 4rem; }
.software-header {
    text-align: center; padding: 3rem 1rem; max-width: 900px; margin: 0 auto;
}
.software-header h2 { font-size: 2.5rem; margin-bottom: 1rem; color: #fff; line-height: 1.2; overflow-wrap: break-word; }
.feature-split {
    display: flex; align-items: center; gap: 4rem; padding: 4rem 0; border-bottom: 1px solid var(--bg-card);
}
.feature-split:last-child { border-bottom: none; }
.feature-text { flex: 1; min-width: 0; /* Fix flex child overflow */ }
.feature-image {
    flex: 1; border-radius: 12px; overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); border: 1px solid var(--border);
    min-width: 0; /* Fix flex child overflow */
}
.feature-image img { width: 100%; height: auto; display: block; }
.feature-title { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; color: #fff; line-height: 1.2; overflow-wrap: break-word; }
.highlight-hybrid { color: var(--accent); }
.highlight-cloud { color: #8b5cf6; }

/* --- MODULES GRID --- */
.modules-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem; margin-top: 3rem;
}
.module-card {
    background: var(--bg-card); padding: 2rem; border-radius: 12px;
    border: 1px solid var(--border); transition: 0.3s;
    overflow-wrap: break-word; /* Prevent text overflow */
    word-break: break-word;
}
.module-card:hover { background: var(--bg-card-hover); transform: translateY(-5px); }
.module-icon {
    font-size: 2rem; margin-bottom: 1rem; display: inline-block;
    padding: 10px; background: rgba(59, 130, 246, 0.1); border-radius: 8px;
}

/* --- PRICING --- */
.pricing-section {
    background: radial-gradient(circle at bottom center, #1e293b 0%, #0f172a 70%);
    padding: 5rem 1rem; color: #fff;
    scroll-margin-top: 80px;
}
.pricing-grid {
    display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; max-width: 1100px; margin: 0 auto;
}
.price-card {
    background: var(--bg-card); border-radius: 20px; padding: 2.5rem; width: 100%;
    max-width: 400px; position: relative; border: 1px solid var(--border);
    transition: all 0.3s ease; display: flex; flex-direction: column;
}
.price-card:hover {
    transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); border-color: var(--primary);
}
.price-card.featured {
    background: linear-gradient(145deg, #1e293b, #252f45);
    border: 2px solid var(--primary); transform: scale(1.05); z-index: 2;
}
.popular-badge {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white; padding: 5px 20px;
    border-radius: 20px; font-weight: 700; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
    white-space: nowrap;
}
.plan-name { font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; text-align: center; }
.plan-desc { text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2rem; min-height: 40px; }
.price-tag { text-align: center; margin-bottom: 2rem; }
.amount { font-size: 3.5rem; font-weight: 800; color: #fff; line-height: 1; }
.period { color: var(--text-secondary); font-size: 1rem; }
.entry-cost {
    text-align: center; background: rgba(255, 255, 255, 0.05);
    padding: 10px; border-radius: 8px; margin-bottom: 2rem;
    font-size: 0.9rem; color: var(--text-muted);
}
.entry-cost strong { color: #fff; display: block; font-size: 1.1rem; }
.features { list-style: none; margin-bottom: 2rem; flex-grow: 1; }
.features li { margin-bottom: 1rem; color: var(--text-muted); font-size: 0.95rem; padding-left: 25px; position: relative; }
.features li::before { content: '✓'; color: var(--accent); position: absolute; left: 0; font-weight: bold; }
.cta-btn {
    display: block; width: 100%; padding: 1rem; text-align: center;
    border-radius: 8px; font-weight: 700; text-decoration: none;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 0.5px;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--border); color: #fff; }
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.05); }
.whatsapp-hook { color: #25D366 !important; font-weight: 600; }

/* --- HARDWARE PRICING SECTION --- */
.hardware-pricing-section {
    background-color: var(--bg-dark); padding: 4rem 1rem; color: #fff; border-top: 1px solid var(--bg-card);
}
.hardware-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; max-width: 1100px; margin: 0 auto; align-items: start;
}
.component-list { background: var(--bg-card); padding: 2rem; border-radius: 12px; border: 1px solid var(--border); }
.component-item {
    display: flex; justify-content: space-between; padding: 1rem 0;
    border-bottom: 1px solid var(--border); align-items: center;
    gap: 1rem; /* Prevent text touching price */
}
.component-item:last-child { border-bottom: none; }
.comp-name { font-weight: 600; font-size: 1.1rem; color: #fff; display: block; }
.comp-desc { font-size: 0.85rem; color: var(--text-secondary); display: block; margin-top: 4px; line-height: 1.3; }
.comp-price { font-weight: 700; color: var(--primary); font-size: 1.1rem; white-space: nowrap; }

.suggestion-card {
    background: linear-gradient(135deg, #252f45 0%, #1e293b 100%);
    border: 2px solid var(--accent); border-radius: 16px; padding: 2.5rem; position: relative;
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.15);
}
.suggestion-badge {
    background: var(--accent); color: var(--bg-dark); position: absolute; top: -15px; right: 20px;
    padding: 5px 15px; border-radius: 20px; font-weight: 800; text-transform: uppercase; font-size: 0.8rem;
    white-space: nowrap;
}
.total-row {
    margin-top: 2rem; padding-top: 1.5rem; border-top: 2px dashed #475569;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
}
.total-label { font-size: 1.2rem; color: var(--text-muted); }
.total-amount { font-size: 3rem; font-weight: 800; color: #fff; line-height: 1; }
.service-note {
    margin-top: 2rem; background: rgba(59, 130, 246, 0.1); border-left: 4px solid var(--primary);
    padding: 1rem; font-size: 0.9rem; color: var(--text-muted);
}
.the-why-section {
    margin-top: 4rem; text-align: center; padding: 3rem;
    background: linear-gradient(45deg, #1e293b, #0f172a);
    border-radius: 20px; border: 1px solid var(--border);
}

/* --- SOFTWARE AREA BLOCKS --- */
.area-block-container {
    background: rgba(30, 41, 59, 0.5);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.section-header-block {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    flex-wrap: wrap; /* Key fix for overflow */
}

.section-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.section-title {
    font-size: 1.8rem;
    color: #fff;
    line-height: 1.1;
    margin: 0;
    overflow-wrap: break-word;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: block;
}

/* --- FOOTER --- */
footer {
    background: #0b1120; padding: 3rem 1rem; text-align: center;
    border-top: 1px solid var(--border); margin-top: 2rem;
}
.footer-content p { color: var(--text-secondary); margin-bottom: 0.5rem; }
.social-links { margin-top: 1rem; display: flex; justify-content: center; gap: 1rem; }

/* --- FLOATING WHATSAPP --- */
.floating-wa {
    position: fixed; bottom: 20px; right: 20px;
    background-color: #25D366; color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000; transition: transform 0.3s;
    font-size: 30px;
}
.floating-wa:hover { transform: scale(1.1); }

/* --- RESPONSIVE --- */
@media (max-width: 850px) {
    body { padding-top: 70px; }
    
    .area-block-container { padding: 1.5rem; }
    
    .section-header-block { 
        gap: 1rem;
        justify-content: center;
        text-align: center;
    }
    
    .section-title { font-size: 1.5rem; }
    
    .hardware-hero h1 { font-size: clamp(2rem, 5vw, 3rem); /* Responsive font size */ }
    .hardware-hero h1 span { font-size: clamp(1rem, 4vw, 1.5rem); }
    
    /* Force grids to single column on mobile */
    .components-grid, .modules-grid {
        grid-template-columns: 1fr;
    }

    .feature-split { flex-direction: column; text-align: center; gap: 2rem; padding: 2rem 0; }
    .feature-split.reverse { flex-direction: column-reverse; }
    
    .hardware-grid { grid-template-columns: 1fr; gap: 2rem; }
    
    .mobile-menu-btn { display: block; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; width: 100%;
        background: var(--bg-card); flex-direction: column; padding: 1rem;
        border-bottom: 1px solid var(--border); text-align: center;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    .nav-links.active { display: flex; }
    
    /* Reset scaling on mobile to prevent overflow */
    .price-card.featured { transform: scale(1); margin-top: 0; z-index: 1; }
    .price-card { max-width: 100%; width: 100%; margin-bottom: 1rem; }
    
    /* Adjust pricing amounts for small screens */
    .amount { font-size: 2.5rem; }
    .total-amount { font-size: 2.2rem; }
    
    /* Fix suggestion card padding on mobile */
    .suggestion-card { padding: 1.5rem; }
    .suggestion-badge { right: 50%; transform: translateX(50%); top: -15px; }

    /* Module icons smaller on mobile */
    .module-icon { font-size: 1.5rem; padding: 8px; }

    /* Stack component items better */
    .component-item { align-items: flex-start; flex-direction: column; }
    .comp-price { margin-top: 5px; align-self: flex-end; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .hardware-hero h1 { font-size: 1.8rem; }
    .feature-title { font-size: 1.5rem; }
    .card-image-container { height: 180px; padding: 10px; }
    
    .btn-primary, .btn-outline { font-size: 0.9rem; padding: 0.8rem; }
    
    .pricing-section, .hardware-pricing-section, .hardware-hero { padding-left: 1rem; padding-right: 1rem; }
    
    /* Ensure tables/lists don't break layout */
    .benefits-list li { font-size: 0.85rem; }
    
    /* Adjust floating button position */
    .floating-wa { bottom: 15px; right: 15px; width: 50px; height: 50px; font-size: 24px; }
}