/* Ajustes responsivos globales para Antvart Academy */

@media (max-width: 1024px) {
    body {
        overflow-x: hidden;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }

    .sidebar {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
        padding: 0.75rem 0.8rem !important;
        overflow-x: auto;
        white-space: nowrap;
        border-right: none !important;
        border-bottom: 1px solid #e8e8e8;
    }

    .sidebar .logo {
        margin: 0 0.5rem 0 0 !important;
        padding: 0 0.35rem !important;
        flex: 0 0 auto;
    }

    .sidebar .nav-item {
        flex: 0 0 auto;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        border-radius: 10px;
        padding: 0.7rem 0.9rem !important;
    }

    .sidebar .nav-item.active {
        border-bottom-color: var(--primary);
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table th,
    table td {
        white-space: nowrap;
    }

    .navbar-container,
    .hero,
    .stats,
    .courses-section,
    .categories-section,
    footer {
        padding-left: 1.2rem !important;
        padding-right: 1.2rem !important;
    }

    .hero-container,
    .layout,
    .course-detail-layout {
        grid-template-columns: 1fr !important;
    }

    .modal {
        padding: 0.8rem !important;
    }

    .cart-dropdown,
    #cartDropdown {
        width: min(420px, calc(100vw - 1rem)) !important;
        right: 0.5rem !important;
        left: auto !important;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 0.65rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .main-content {
        padding: 0.8rem !important;
    }

    .sidebar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        overflow: visible !important;
        white-space: normal !important;
        padding: 0.65rem !important;
        position: static !important;
    }

    .sidebar .logo {
        grid-column: 1 / -1;
        justify-content: center;
        margin: 0 !important;
        padding: 0.25rem 0 !important;
    }

    .sidebar .nav-item {
        width: 100%;
        justify-content: center;
        text-align: center;
        border-radius: 12px;
        border-bottom-width: 2px;
        padding: 0.65rem 0.55rem !important;
    }

    .sidebar .nav-icon {
        font-size: 1.1rem;
    }

    .header h1 {
        font-size: 1.6rem !important;
    }

    .navbar {
        padding: 0.8rem 0 !important;
    }

    .navbar-container {
        padding: 0 1rem !important;
        flex-wrap: wrap;
        gap: 0.7rem;
    }

    .nav-links {
        display: flex !important;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        gap: 1rem !important;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    .nav-buttons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #authButtons {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #authButtons .btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }

    #userInfo.active {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .user-name {
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #adminPanelBtn {
        margin-left: 0 !important;
    }

    .cart-btn {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .hero {
        padding-top: 2.7rem !important;
        padding-bottom: 2.7rem !important;
    }

    .hero-content h1 {
        font-size: 1.9rem !important;
        line-height: 1.25;
    }

    .hero-content p {
        font-size: 1rem !important;
        margin-bottom: 1.4rem !important;
    }

    .hero-buttons {
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 1.8rem !important;
    }

    .section-header {
        margin-bottom: 2rem !important;
    }

    .courses-grid,
    .categories-grid,
    .stats-grid,
    .stats-container,
    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .course-content,
    .card,
    .stat-card {
        padding: 1rem !important;
    }

    .course-meta {
        gap: 0.7rem !important;
        flex-wrap: wrap;
    }

    .course-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }

    .course-price,
    .price,
    .stat-value {
        font-size: 1.55rem !important;
    }

    .add-to-cart-btn,
    .course-detail-actions .btn,
    .actions .btn,
    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }

    .topbar .container,
    .topbar-content {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .actions {
        width: 100%;
    }

    .resource-row,
    .session-row,
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-content {
        width: 100% !important;
        max-height: 94vh !important;
        border-radius: 14px !important;
    }

    .modal-header,
    .modal-body {
        padding: 1rem !important;
    }

    .close-modal {
        top: 0.55rem !important;
        right: 0.55rem !important;
        width: 36px !important;
        height: 36px !important;
    }

    .container {
        width: min(100%, 96%) !important;
    }

    #searchInput,
    #categoryFilter {
        min-width: 0 !important;
        width: 100% !important;
    }

    .check {
        align-items: flex-start !important;
    }
}

@media (max-width: 480px) {
    .logo-image,
    .logo img {
        height: 40px !important;
    }

    .title,
    .modal-title,
    h1 {
        font-size: 1.5rem !important;
    }

    .section-title {
        font-size: 1.5rem !important;
    }

    .empty-state {
        padding: 2rem 1rem !important;
    }

    .sidebar {
        padding: 0.55rem 0.45rem !important;
        grid-template-columns: 1fr !important;
    }

    .sidebar .nav-item {
        padding: 0.55rem 0.65rem !important;
    }

    #authButtons .btn {
        flex: 1 1 100%;
    }

    .cart-btn {
        margin-left: 0;
    }

    .nav-links {
        gap: 0.75rem !important;
    }
}
