/* ==========================================================================
   1. RESET, VARIABLES Y ESTILOS GLOBALES
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-family: 'Montserrat', 'Helvetica Neue', sans-serif; color: #2d3748; background-color: #f7fafc; }
body { width: 100%; overflow-x: hidden; line-height: 1.6; }

/* Reutilización global de imágenes adaptables */
.brand-logo img,
.card-img-wrapper img,
.normal-img-col img,
.instagram-embed-container iframe,
.linkedin-embed-container { width: 100%; display: block; }

/* Componente de Cuadrícula para la administración */
.imagen-cuadricula {
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
                    linear-gradient(-45deg, #ccc 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #ccc 75%),
                    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #ffffff;
  display: inline-block;
}

/* Selector de archivos nativo personalizado */
input[type="file"]::file-selector-button {
  background-color: #2196F3;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}
input[type="file"]::file-selector-button:hover { background-color: #0b7dda; }

/* ==========================================================================
   2. SECCIONES PÚBLICAS Y COMPONENTES
   ========================================================================== */
/* Navegación */
.main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(26, 37, 47, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 12px 20px; }
.brand-logo img { height: 42px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: #edf2f7; font-size: 0.92rem; font-weight: 500; text-decoration: none; transition: color 0.3s ease; }
.nav-links a:hover { color: #3182ce; }
.menu-checkbox, .menu-btn-label { display: none; }

/* Slider Hero */
.hero-slider-container { position: relative; width: 100%; height: 100vh; overflow: hidden; background-color: #000; }
.slider-wrapper, .main-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.main-slide { background-size: cover; background-position: center; opacity: 0; transition: opacity 0.8s ease-in-out; }
.main-slide.active { opacity: 1; z-index: 2; }
.hero-static-content { position: absolute; z-index: 5; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #fff; width: 90%; }
.hero-static-content h1 { font-size: 3.4rem; text-shadow: 0 3px 12px rgba(0,0,0,0.65); letter-spacing: 1px; margin-bottom: 5px; }
.hero-static-content p { font-size: 1.4rem; text-transform: uppercase; letter-spacing: 3px; font-weight: 300; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; background: rgba(0,0,0,0.25); color: white; border: none; padding: 16px; cursor: pointer; font-size: 1.4rem; border-radius: 4px; transition: background 0.3s; }
.hero-nav:hover { background: rgba(0,0,0,0.65); }
.hero-nav.prev { left: 15px; }
.hero-nav.next { right: 15px; }

/* Estructura Modular */
.section-padding { padding: 95px 0; border-bottom: 1px solid #e2e8f0; }
.section-main-title { text-align: center; font-size: 2.1rem; text-transform: uppercase; letter-spacing: 1.5px; position: relative; margin-bottom: 2.5rem; }
.section-main-title::after { content: ''; display: block; width: 55px; height: 3.5px; background-color: #3182ce; margin: 12px auto 0; }
.section-intro-block { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-bottom: 45px; text-align: left; }
.section-intro-img { max-width: 550px; width: 100%; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.section-intro-text { font-size: 1.1rem; color: #4a5568; max-width: 800px; line-height: 1.7; }

/* Desplegable "Leer Más" */
.post-content-wrapper { position: relative; overflow: hidden; transition: max-height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.post-content-wrapper.closed { max-height: 85px; }
.post-content-wrapper.closed::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 35px; background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,1)); }
.btn-read-more { background: none; border: none; color: #3182ce; font-weight: 700; cursor: pointer; margin-top: 12px; font-size: 0.9rem; transition: color 0.2s; }
.btn-read-more:hover { color: #2b6cb0; }

/* Layouts Estructurales Públicos */
.cards-grid-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.card-item-web { background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.04); border: 1px solid #edf2f7; }
.card-img-wrapper img { height: 210px; object-fit: cover; border-radius: 6px; margin-bottom: 18px; }
.card-info-content h3 { font-size: 1.25rem; margin-bottom: 12px; color: #1a202c; }

.normal-linear-layout { display: flex; flex-direction: column; gap: 55px; }
.normal-layout-row { display: flex; gap: 40px; align-items: flex-start; }
.normal-layout-row:nth-child(even) { flex-direction: row-reverse; }
.normal-img-col { flex: 1; max-width: 450px; width: 100%; }
.normal-img-col img { border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.06); }
.normal-text-col { flex: 2; }
.normal-text-col h3 { font-size: 1.4rem; margin-bottom: 12px; color: #1a202c; }

/* Elementos Globales del Pie y Utilidades */
#btn-arriba { position: fixed; bottom: 25px; right: 25px; background: #1a252f; color: white; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 99; font-size: 1.1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
#btn-arriba.visible { opacity: 1; visibility: visible; }
.main-footer { background: #1a252f; color: #a0aec0; padding: 45px 0; text-align: center; font-size: 0.9rem; border-top: 2px solid #2d3748; }

/* ==========================================================================
   3. PANEL DE ADMINISTRACIÓN INTERNO
   ========================================================================== */
.admin-login-body { background-color: #ebf0f5; display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { background: #fff; padding: 35px; border-radius: 6px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); width: 100%; max-width: 380px; }

/* Contenedor unificado de formularios (Fusión de líneas 64 y 118) */
.form-group { 
    margin-bottom: 20px; 
    margin-top: 25px; 
    padding: 15px; 
    border: 1px solid #e2e8f0; 
    border-radius: 5px; 
    background-color: #f8f9fa; 
}
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 1.2rem; color: #4a5568; }
.form-group input[type="text"], .form-group input[type="password"], .form-group input[type="number"], .form-group input[type="url"] { width: 100%; padding: 11px; border: 1px solid #cbd5e0; border-radius: 4px; font-family: inherit; font-size: 0.95rem; }

.alert { padding: 12px; border-radius: 4px; font-size: 0.9rem; font-weight: bold; margin-bottom: 15px; }
.alert-danger { background: #fed7d7; color: #9b2c2c; }
.alert-success { background: #c6f6d5; color: #22543d; }

.admin-header { background-color: #2c3e50; color: #fff; padding: 16px 25px; display: flex; align-items: center; justify-content: space-between; }
.card-box { background: #fff; padding: 25px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 15px; background: white; }
.admin-table th, .admin-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e2e8f0; font-size: 0.92rem; }
.admin-table th { background-color: #f7fafc; color: #4a5568; font-weight: 700; }

/* Botonera de acciones */
.btn { display: inline-block; padding: 9px 18px; border-radius: 4px; font-weight: 700; cursor: pointer; border: none; font-size: 0.88rem; transition: background 0.2s; text-decoration: none; text-align: center; }
.btn-primary { background: #3182ce; color: #fff; }
.btn-primary:hover { background: #2b6cb0; }
.btn-success { background: #38a169; color: #fff; }
.btn-success:hover { background: #2f855a; }
.btn-warning { background: #dd6b20; color: #fff; }
.btn-warning:hover { background: #c05621; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; margin-right: 4px; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }

/* ==========================================================================
   4. COMPONENTES DE SOCIAL MEDIA (INSTAGRAM & LINKEDIN)
   ========================================================================== */
.social-grid-layout { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important; }
.social-card-item { background: #fff; padding: 12px !important; display: flex; justify-content: center; align-items: flex-start; overflow: hidden; height: 475px; }
.instagram-embed-container { max-width: 100%; max-height: 450px; overflow: hidden; }
.instagram-embed-container iframe { margin: 0 auto !important; max-height: 450px !important; }
.linkedin-embed-container { height: 100%; }

/* ==========================================================================
   5. MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================================================== */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 100%; right: 0; width: 250px; background: #1a252f; flex-direction: column; gap: 0; box-shadow: -4px 4px 15px rgba(0,0,0,0.15); }
    .nav-links a { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.04); width: 100%; }
    .menu-btn-label { display: block; cursor: pointer; padding: 8px; }
    .menu-btn-label span, .menu-btn-label span::before, .menu-btn-label span::after { display: block; width: 22px; height: 2px; background: #fff; position: relative; transition: 0.3s; }
    .menu-btn-label span::before { content: ''; top: -7px; position: absolute; }
    .menu-btn-label span::after { content: ''; bottom: -7px; position: absolute; }
    .menu-checkbox:checked ~ .nav-links { display: flex; }
    
    .normal-layout-row, .normal-layout-row:nth-child(even) { flex-direction: column; gap: 25px; }
    .normal-img-col { max-width: 100%; }
    .hero-static-content h1 { font-size: 2.1rem; }
    .hero-static-content p { font-size: 1rem; }
    .admin-table { display: block; overflow-x: auto; }
}

/* ==========================================================================
   NUEVO: SOPORTE PARA SUBMENÚ DINÁMICO (SERVICIOS)
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a252f;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 6px 0;
    z-index: 1100;
}

.dropdown-menu a {
    color: #edf2f7;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.88rem;
    text-align: left;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: #3182ce;
    color: #fff;
}

/* Activar visualización al pasar el cursor (Escritorio) */
.nav-dropdown:hover .dropdown-menu {
    display: block;
}

/* Adaptación fluida a Media Query móvil existente */
@media (max-width: 768px) {
    .nav-dropdown {
        width: 100%;
    }
    .dropdown-menu {
        position: relative;
        top: 0;
        background-color: rgba(0, 0, 0, 0.1);
        box-shadow: none;
        width: 100%;
        padding-left: 15px;
        display: block; /* Se muestra expandido directamente en móviles */
    }
    .dropdown-menu a {
        border-bottom: 1px solid rgba(255,255,255,0.02) !important;
    }
}