/*
 * Responsive Styles for CIPVEGE Theme
 * 
 * @package CIPVEGE
 */

/* ===========================
   TABLET (max-width: 1024px)
   =========================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

/* ===========================
   MOBILE (max-width: 768px)
   =========================== */
@media (max-width: 768px) {
    /* Typography */
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    /* Header */
    .header-top {
        display: none;
    }
    
    .header-main {
        padding: var(--spacing-sm) 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .site-branding {
        flex-direction: column;
        text-align: center;
    }
    
    .site-logo img {
        height: 50px;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    /* Navigation */
    .menu-toggle {
        display: block;
        width: 100%;
    }
    
    .main-navigation {
        width: 100%;
    }
    
    .nav-menu-wrapper {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-white);
        box-shadow: var(--shadow-lg);
        padding: var(--spacing-md);
        z-index: 999;
    }
    
    .main-navigation.toggled .nav-menu-wrapper {
        display: flex;
    }
    
    .main-navigation ul {
        display: flex;
        flex-direction: column;
    }
    
    .main-navigation li {
        width: 100%;
        margin: 0;
    }
    
    .main-navigation a {
        display: block;
        padding: var(--spacing-sm);
        border-bottom: 1px solid var(--color-gray-100);
    }
    
    /* Portal Estudiantes Móvil - dentro del menú */
    .menu-item-portal {
        background: linear-gradient(135deg, #4A90A4 0%, #3A7080 100%);
        border-radius: 8px;
        margin: 0.5rem 0;
    }
    
    .menu-item-portal .portal-link {
        color: white !important;
        font-weight: 600;
        padding: 1rem !important;
        border: none !important;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .menu-item-portal .portal-icon {
        font-size: 1.3rem;
    }
    
    .portal-btn-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: linear-gradient(135deg, #4A90A4 0%, #3A7080 100%);
        color: white !important;
        padding: 1rem;
        border-radius: 10px;
        text-align: center;
        font-weight: 600;
        font-size: 1.1rem;
        text-decoration: none;
        box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
        margin-bottom: 1rem;
        transition: all 0.3s ease;
    }
    
    .portal-btn-mobile:hover {
        background: linear-gradient(135deg, #3A7080 0%, #2A6070 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(74, 144, 164, 0.4);
    }
    
    .portal-btn-mobile .portal-icon {
        font-size: 1.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: var(--spacing-xl) 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Grids */
    .programs-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .program-card {
        margin-bottom: var(--spacing-md);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-bottom {
        font-size: 0.8rem;
    }
    
    .footer-bottom p {
        margin-bottom: var(--spacing-xs);
    }
}

/* ===========================
   SMALL MOBILE (max-width: 480px)
   =========================== */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .program-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    .site-header,
    .site-footer,
    .hero-section,
    .menu-toggle,
    .main-navigation {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
}

}

/* Ocultar Portal Estudiantes en desktop */
@media (min-width: 769px) {
    .menu-item-portal {
        display: none !important;
    }
    
    .nav-menu-wrapper {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    
    .main-navigation ul {
        flex-direction: row;
    }
}

/* Ensure nested submenus stay collapsed on mobile */
@media (max-width: 900px){
  #primary-menu .sub-menu{ display:none !important; }
  #primary-menu .menu-item-has-children.cipvege-open > .sub-menu{ display:block !important; }
}
