/* Variables & Reset */
:root {
    --primary-color: #0056b3;
    --primary-dark: #004494;
    --secondary-color: #ffffff;
    --text-color: #333333;
    --heading-color: #1a1a1a;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --accent-color: #007bff;
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-white);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Sections */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--heading-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border-color: #fff;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #fff;
    color: var(--primary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Header */
header {
    background-color: #000000;
    /* Black to match logo background */
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
    /* Subtle light shadow */
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: block;
}

.logo img {
    height: 90px;
    /* Increased from 60px */
    width: auto;
    max-width: 250px;
    /* Prevent it from getting too wide on small screens */
}

nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
}

nav a {
    font-weight: 500;
    color: #ffffff;
    transition: var(--transition);
}

nav a:not(.btn):hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

/* Hero Section */
#hero {
    height: 90vh;
    /* Almost full screen */
    background: url('assets/hero_bg.webp') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

#hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

#hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Services */
#servicios {
    background-color: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    border-top-color: var(--primary-color);
}

.icon-box {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--heading-color);
}

.service-card p {
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #666;
}

.service-card ul li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.service-card ul li i {
    color: var(--primary-color);
}

/* Audience */
.audience-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.audience-card {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.audience-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.audience-card i {
    font-size: 3rem;
    color: var(--heading-color);
    display: block;
    margin-bottom: 15px;
}

.audience-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

/* Why Choose Us */
#nosotros {
    background-color: var(--primary-color);
    color: #fff;
}

#nosotros .section-title {
    color: #fff;
}

#nosotros .section-title::after {
    background-color: #fff;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

.benefit-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(5px);
}

.benefit-item i {
    font-size: 2rem;
    color: var(--bg-white);
    /* White icon */
}

/* Process */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    position: relative;
}

.step {
    text-align: center;
    position: relative;
    padding: 20px;
}

.step-number {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.contact-info p {
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 30px;
    color: #555;
}

.btn-whatsapp-large {
    background-color: #25D366;
    color: #fff;
    font-size: 1.1rem;
    padding: 15px 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-whatsapp-large:hover {
    background-color: #128C7E;
    color: #fff;
}

.contact-form-wrapper {
    background: #fff;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--heading-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* Footer */
footer {
    background-color: #222;
    color: #fff;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* Sticky Whatsapp */
.sticky-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition);
}

.sticky-whatsapp:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 900px) {

    .audience-grid,
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    #hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .menu-toggle {
        display: block;
    }

    #navbar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #000;
        padding: 20px;
        clip-path: circle(0% at 100% 0);
        transition: all 0.5s ease-in-out;
    }

    #navbar.active {
        clip-path: circle(140% at 100% 0);
    }

    nav ul {
        flex-direction: column;
        gap: 20px;
    }

    nav ul li {
        width: 100%;
        text-align: center;
    }

    nav a {
        display: block;
        padding: 10px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .audience-grid,
    .process-steps {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* =========================================
   ESTILOS PARA EL ADMINISTRADOR (COTIZADOR)
   ========================================= */

.admin-body {
    background-color: #f4f6f9;
}

.cotizador-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 40px 20px;
    align-items: flex-start;
}

.cotizador-sidebar {
    width: 100%;
    max-width: 350px;
    flex-shrink: 0;
}

.cotizador-main {
    flex-grow: 1;
    background: #fff;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 0; /* previene desborde en flex */
}

.cotizador-card {
    background: #fff;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.cotizador-card h3 {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.8rem;
}

.table-responsive {
    overflow-x: auto;
}

.cotizacion-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    min-width: 500px;
}

.cotizacion-table th, 
.cotizacion-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.cotizacion-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--heading-color);
}

.btn-icon {
    background: transparent;
    border: none;
    color: #e74c3c;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: #c0392b;
    transform: scale(1.1);
}

/* TABLA ESTILIZADA CORPORATIVA */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9em;
    min-width: 500px;
}

.styled-table thead tr {
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: left;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f9fbfc;
}

.styled-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Alineaciones compactas para números */
.styled-table .col-sm { width: 80px; }
.styled-table .col-md { width: 110px; font-size: 0.95em; }
.styled-table .right { text-align: right; }
.styled-table .center { text-align: center; }

/* TOTALES REDISEÑADOS Y COMPACTOS */
.totales-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.totales-panel {
    background-color: #fff;
    padding: 15px;
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.95em;
    color: #444;
}

.total-gran-row {
    margin-top: 10px;
    padding: 12px 15px;
    background-color: var(--primary-color);
    border-radius: 5px;
    font-size: 1.15em;
    font-weight: 700;
}

/* OCULTAR ELEMENTOS IMPRIMIBLES EN PANTALLA NORMAL */
.print-only {
    display: none;
}

/* Responsive del Cotizador */
@media (max-width: 768px) {
    .cotizador-container {
        flex-direction: column;
    }
    .cotizador-sidebar {
        max-width: 100%;
    }
    .totales-panel {
        max-width: 100%;
    }
}

/* =========================================
   REGLAS DE IMPRESIÓN (PDF)
   ========================================= */
@media print {
    body {
        background-color: #fff;
        font-size: 10pt;
    }
    .no-print {
        display: none !important;
    }
    .print-only {
        display: table-header-group; /* o block según la estructura */
    }
    tfoot.print-only {
        display: table-footer-group;
    }
    
    .cotizador-container {
        padding: 0;
        display: block;
    }
    .cotizador-main {
        box-shadow: none;
        padding: 0;
    }
    
    .layout-table {
        width: 100%;
    }
    
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        border-bottom: 3px solid var(--primary-color);
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    
    .totales-panel {
        border-color: #ccc;
    }
    .total-gran-row {
        /* Para asegurar que el color se imprima */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .styled-table thead tr {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .styled-table tbody tr:nth-of-type(even) {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page { 
        margin: 1.5cm; 
    }
}

/* =========================================
   ESTILOS PARA EL CATÁLOGO (TIENDA)
   ========================================= */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.producto-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.producto-img-box {
    height: 200px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--primary-color);
}

.placeholder-icon {
    font-size: 5rem;
    color: #cbd5e1;
}

.producto-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.producto-info h3 {
    font-size: 1.2rem;
    color: var(--heading-color);
    margin-bottom: 10px;
}

.producto-info .desc {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

.producto-precio {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* =========================================
   ESTILOS DEL CARRITO DE COMPRAS
   ========================================= */
.cart-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.cart-toggle:hover {
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    transition: transform 0.3s;
}

.cart-badge.bump {
    transform: scale(1.3);
}

/* Offcanvas Cart */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cart-panel {
    width: 100%;
    max-width: 400px;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.cart-overlay.active .cart-panel {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-header h2 {
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.cart-close:hover {
    color: #e74c3c;
}

.cart-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 5px;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: var(--heading-color);
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.qty-btn {
    background: #eee;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #555;
}

.qty-btn:hover {
    background: #ddd;
}

.qty-display {
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.cart-empty {
    text-align: center;
    color: #888;
    margin-top: 50px;
}

.cart-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    color: #ccc;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.cart-total-info {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--heading-color);
}