/* ========================================================
   ARCHIVO: css/styles.css
   PROPÓSITO: Diseño visual, responsividad y tipografías
   ======================================================== */

/* Reset de estilos básicos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #2d3748;
    background-color: #f7fafc;
    line-height: 1.6;
}

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

/* Encabezado Principal */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    text-decoration: none;
    color: #1a365d;
}

.logo span {
    color: #3182ce;
    font-weight: 300;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #3182ce;
}

.main-nav .btn-portal {
    background-color: #1a365d;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.main-nav .btn-portal:hover {
    background-color: #2b6cb0;
    color: #ffffff;
}

/* Sección Hero (Bienvenida) */
.hero-section {
    background: linear-gradient(135deg, #1a365d 0%, #2a4365 100%);
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #e2e8f0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Botones Generales */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3182ce;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2b6cb0;
    transform: translateY(-1px);
}

/* Sección Catálogo */
.catalog-section {
    padding: 60px 0;
    text-align: center;
}

.catalog-section h2 {
    font-size: 28px;
    color: #1a365d;
    margin-bottom: 5px;
}

.subtitle {
    color: #718096;
    margin-bottom: 40px;
}

/* Filtros Superiores */
.categories-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn-filter {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 20px;
    color: #4a5568;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    border-color: #cbd5e0;
    background-color: #f7fafc;
}

.btn-filter.active {
    background-color: #3182ce;
    color: #ffffff;
    border-color: #3182ce;
}

/* Cuadrícula de Trámites */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}

.product-card h3 {
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 12px;
}

.product-desc {
    color: #718096;
    font-size: 14px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 15px;
}

.btn-buy {
    width: 100%;
    background-color: #edf2f7;
    color: #2b6cb0;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-buy:hover {
    background-color: #3182ce;
    color: #ffffff;
}

/* Paginación */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.page-btn.active, .page-btn:hover {
    background-color: #1a365d;
    color: #ffffff;
    border-color: #1a365d;
}

/* Formulario de Contacto */
.contact-section {
    background-color: #ffffff;
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.contact-section h2 {
    color: #1a365d;
    margin-bottom: 10px;
}

.clean-form {
    max-width: 500px;
    margin: 30px auto 0 auto;
    text-align: left;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5568;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 15px;
    color: #2d3748;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(66,153,225,0.15);
}

.btn-submit {
    width: 100%;
    background-color: #3182ce;
    color: #ffffff;
}

/* Pie de página */
.main-footer {
    background-color: #1a365d;
    color: #a0aec0;
    padding: 25px 0;
    text-align: center;
    font-size: 14px;
}

/* Ajustes Responsivos y Adaptación Móvil Completa */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .hero-section {
        padding: 50px 0;
    }
    .hero-content h1 {
        font-size: 26px;
    }
    .hero-content p {
        font-size: 15px;
    }
    
    /* CONTROL AGRESIVO PARA EL CARRITO EN CELULARES */
    .cart-panel {
        width: 100% !important; /* Ocupa toda la pantalla en celular */
        right: -100% !important;
        box-shadow: none;
    }
    .cart-panel.open {
        right: 0 !important;
    }
    .floating-cart-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}
/* ========================================================
   ESTILOS DEL CARRITO DE COMPRAS FLOTANTE
   ======================================================== */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #38a169;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.floating-cart-btn #cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e53e3e;
    color: white;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}
.cart-panel.open {
    right: 0;
}
.cart-header {
    padding: 20px;
    background-color: #1a365d;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}
.cart-items-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}
.cart-item h4 { font-size: 14px; color: #2d3748; max-width: 200px; }
.cart-item p { font-size: 14px; font-weight: bold; color: #2b6cb0; }
.remove-item { background: none; border: none; color: #e53e3e; cursor: pointer; font-size: 16px; }
.cart-footer { padding: 20px; border-top: 1px solid #e2e8f0; background-color: #f7fafc; }
.cart-total-box { display: flex; justify-content: space-between; font-weight: bold; font-size: 18px; margin-bottom: 15px; color: #1a365d; }
.btn-checkout { width: 100%; background-color: #38a169; color: white; border: none; padding: 12px; font-size: 16px; font-weight: bold; border-radius: 6px; cursor: pointer; transition: background 0.2s; }
.btn-checkout:hover { background-color: #2f855a; }
