/* ==============================
   VARIABLES Y DISEÑO BASE
=============================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #0a2171;
    --primary-light: #1e3a8a;
    --secondary-color: #0ea5e9;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* ==============================
   HEADER SUPERIOR (LOGO + TÍTULO)
=============================== */
.header-ugel {
    background: var(--surface-color);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-ugel .logo {
    width: 65px;
    height: auto;
    transition: var(--transition);
}

.header-ugel .logo:hover {
    transform: scale(1.05);
}

.header-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    margin-left: 16px;
    letter-spacing: -0.5px;
}

/* Buscador en Header */
.search-container {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    width: 320px;
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.search-container input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    flex: 1;
    color: var(--text-main);
}

.search-container i {
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.search-container:focus-within i {
    color: var(--secondary-color);
}

/* ==============================
   MENÚ PRINCIPAL STICKY CON GLASSMORPHISM
=============================== */
.nav-ugel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-ugel .nav-link {
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    padding: 14px 24px !important;
    transition: var(--transition);
    border-radius: var(--radius-md);
    margin: 0 2px;
}

.nav-ugel .nav-link:hover,
.nav-ugel .nav-link:focus,
.nav-ugel .nav-link.active {
    background: rgba(10, 33, 113, 0.05);
    color: var(--primary-color);
}

.nav-ugel .dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    animation: fadeInDown 0.2s ease-out;
}

.nav-ugel .dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-ugel .dropdown-item:hover {
    background: rgba(10, 33, 113, 0.05);
    color: var(--primary-color);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================
   ÁREA INTRANET Y BUSCADOR CENTRAL
=============================== */
.area-intranet {
    padding: 60px 0 80px 0;
    min-height: calc(100vh - 350px);
}

.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.titulo-principal {
    font-size: 46px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -1px;
}

.subtitulo {
    font-size: 18px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 48px;
}

.buscador-box {
    max-width: 650px;
    margin: 0 auto 50px auto;
    position: relative;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-full);
}

.buscador-box input {
    width: 100%;
    padding: 18px 24px 18px 56px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    font-size: 16px;
    background: var(--surface-color);
    transition: var(--transition);
    color: var(--text-main);
}

.buscador-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.buscador-box .icono {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--secondary-color);
}

/* ==============================
   TARJETAS DE SERVICIOS
=============================== */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

.card-servicio {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
}

.card-servicio:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(10, 33, 113, 0.1);
}

.card-servicio .icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(10, 33, 113, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--transition);
}

.card-servicio:hover .icon-wrapper {
    background: var(--primary-color);
}

.card-servicio i {
    font-size: 38px;
    color: var(--primary-color);
    transition: var(--transition);
}

.card-servicio:hover i {
    color: white;
    transform: scale(1.1);
}

.card-servicio h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.card-servicio p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
    flex-grow: 1;
}

.badge-interno {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    font-style: italic;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius-full);
}

.btn-servicio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 0;
    border-radius: var(--radius-full);
    background: rgba(10, 33, 113, 0.05);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: var(--transition);
}

.card-servicio:hover .btn-servicio {
    background: var(--primary-color);
    color: white;
}

/* Tarjetas Externas */
.card-externo {
    background: linear-gradient(145deg, #fffaf0, #fff7ed);
    border: 1px solid #fed7aa;
}
.card-externo .icon-wrapper { background: rgba(249, 115, 22, 0.1); }
.card-externo i { color: #ea580c; }
.card-externo:hover .icon-wrapper { background: #ea580c; }
.card-externo:hover { border-color: #fdba74; box-shadow: 0 20px 25px -5px rgba(234, 88, 12, 0.15); }
.card-externo h3 { color: #9a3412; }
.card-externo .btn-servicio { background: rgba(249, 115, 22, 0.1); color: #ea580c; }
.card-externo:hover .btn-servicio { background: #ea580c; color: white; }

.card-externo-alt {
    background: linear-gradient(145deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
}
.card-externo-alt .icon-wrapper { background: rgba(34, 197, 94, 0.1); }
.card-externo-alt i { color: #16a34a; }
.card-externo-alt:hover .icon-wrapper { background: #16a34a; }
.card-externo-alt:hover { border-color: #86efac; box-shadow: 0 20px 25px -5px rgba(22, 163, 74, 0.15); }
.card-externo-alt h3 { color: #166534; }
.card-externo-alt .btn-servicio { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.card-externo-alt:hover .btn-servicio { background: #16a34a; color: white; }

/* ==============================
   BOTÓN WHATSAPP
=============================== */
.whatsapp-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-flotante:hover {
    background-color: #128c7e;
    transform: scale(1.1) rotate(5deg);
    color: white;
}

.whatsapp-flotante .tooltip-wa {
    position: absolute;
    right: 85px;
    background-color: var(--surface-color);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(20px) scale(0.9);
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

.whatsapp-flotante .tooltip-wa span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.whatsapp-flotante:hover .tooltip-wa {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* ==============================
   FOOTER
=============================== */
.footer {
    background: linear-gradient(to right, #0f172a, #1e293b);
    color: #e2e8f0;
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
    position: relative;
    border-top: 4px solid var(--secondary-color);
}

.footer .subtitulo {
    font-size: 15px;
    margin-top: 12px;
    color: #94a3b8;
}

.footer .subtitulo a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer .subtitulo a:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* ==============================
   OFFCANVAS SIDEBAR (MÓVIL)
=============================== */
.offcanvas {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: none !important;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    width: 85%;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.offcanvas-header .offcanvas-title {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 18px;
}

.offcanvas-body {
    padding: 16px 24px;
}

.offcanvas-body .navbar-nav {
    gap: 0;
}

.offcanvas-body .nav-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.offcanvas-body .nav-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    padding: 16px 0 !important;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.offcanvas-body .nav-link:hover {
    color: var(--primary-color);
    padding-left: 8px !important;
}

.offcanvas-body .nav-link i {
    color: var(--secondary-color);
    font-size: 18px;
}

.offcanvas-body .dropdown-menu {
    border: none;
    background: var(--bg-color);
    box-shadow: none;
    border-radius: var(--radius-md);
    padding: 8px 0 8px 12px;
    margin-top: 0;
    position: static !important;
    transform: none !important;
}

.offcanvas-body .dropdown-item {
    font-size: 15px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-muted);
}

.offcanvas-body .dropdown-item:hover {
    background: rgba(10, 33, 113, 0.05);
    color: var(--primary-color);
}

/* Fondo overlay del offcanvas */
.offcanvas-backdrop.show {
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
    .titulo-principal { font-size: 32px; }
    .subtitulo { font-size: 16px; margin-bottom: 32px; }
    .servicios-grid { grid-template-columns: 1fr; }
    .header-title { font-size: 20px; }
}

