/* ==============================================================================
 * TAILIEUHUE - RESPONSIVE MOBILE & TABLET (assets/css/responsive.css)
 * ==============================================================================
 * Tối ưu cho: 1440px, 1024px, 768px, 425px, 375px, 320px.
 * Chống tràn ngang, chống vỡ bố cục, nút bấm phù hợp cảm ứng.
 */

@media (max-width: 1220px) {
    .nav-link {
        padding: 7px 10px;
        font-size: 0.87rem;
        gap: 5px;
    }

    .header-inner {
        gap: 10px;
    }
}

@media (max-width: 1120px) {
    .main-nav,
    .auth-actions-desktop,
    .upload-cta-desktop {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .dock-search-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pro-plans-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1040px) {

    .hero-grid,
    .showcase-grid,
    .detail-layout,
    .auth-split-layout,
    .dual-cta-grid,
    .compare-dual-grid {
        grid-template-columns: 1fr;
    }

    .auth-section-editorial {
        min-height: auto;
        padding: 36px 0 52px;
    }

    .auth-split-layout {
        max-width: 600px;
        margin: 0 auto;
        gap: 32px;
    }

    .auth-intro-col {
        position: static;
        padding-top: 0;
    }

    .auth-feature-item {
        margin: 0;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.72);
        border-color: rgba(15, 23, 42, 0.06);
    }

    .showcase-surface .showcase-photo-wrap {
        min-height: 0;
        aspect-ratio: 819 / 1024;
        max-width: 480px;
        margin: 0 auto;
    }

    .hero-float-card {
        position: static;
        margin-top: 10px;
    }

    .highlights-grid,
    .profile-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-grid,
    .doc-grid,
    .form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .categories-showcase-section .category-card {
        flex-basis: calc((100% - 16px) / 2);
    }

    .catalog-layout,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .posts-grid,
    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-with-dock {
        padding-bottom: 34px;
    }

    .search-dock-wrap {
        margin-top: 16px;
    }

    .dock-search-grid,
    .pro-plans-grid,
    .drive-check-row {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
    .hero-section {
        padding: 24px 0 30px;
    }

    .hero-search-form {
        flex-direction: column;
        padding: 10px;
    }

    .hero-search-btn {
        width: 100%;
    }

    .doc-grid,
    .category-grid,
    .posts-grid,
    .info-grid,
    .footer-grid,
    .detail-info-grid,
    .interact-grid,
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .categories-showcase-section .category-card {
        flex-basis: 100%;
    }

    .auth-card,
    .auth-card-register,
    .auth-single-card {
        padding: 26px 20px 24px;
        border-radius: 20px;
    }

    .auth-intro-title {
        font-size: 1.78rem;
    }

    .auth-trust-strip {
        gap: 8px 14px;
    }

    .auth-captcha-box {
        grid-template-columns: 1fr;
    }

    .auth-captcha-media {
        justify-content: space-between;
    }

    .auth-captcha-img {
        flex: 1;
        width: 100%;
        max-width: 196px;
        height: 44px;
    }

    .editorial-promo-banner,
    .pro-hero-editorial {
        padding: 28px 22px;
        background-position: center;
    }

    .editorial-banner-overlay {
        background: linear-gradient(180deg, rgba(0, 42, 122, 0.92) 0%, rgba(0, 68, 186, 0.82) 100%);
    }

    .editorial-banner-actions .btn,
    .hero-cta-row .btn {
        width: 100%;
    }

    .pdf-iframe {
        height: 400px;
    }

    .search-count-note {
        margin-left: 0;
        width: 100%;
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 0;
        padding-bottom: 54px;
    }
}

@media (max-width: 425px) {
    .container {
        padding: 0 14px;
    }

    .brand-logo-img {
        height: 46px;
    }

    .brand-logo-footer {
        height: 60px;
    }

    .brand-text small {
        display: none;
    }

    .highlights-grid,
    .hero-stats,
    .profile-kpi-grid,
    .mobile-auth-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px 16px;
    }

    .showcase-actions .btn,
    .form-actions .btn,
    .modal-actions .btn {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .toast-container {
        left: 14px;
        right: 14px;
        bottom: 78px;
        width: auto;
        max-width: none;
    }

    .page-nav-label {
        display: none;
    }
    .page-btn-nav {
        padding: 0;
        width: 36px;
    }
}

@media (max-width: 900px) {
    .contact-fanpage-card {
        grid-template-columns: 1fr;
        padding: 22px 20px;
    }
}

@media (max-width: 640px) {
    .th-chat-widget {
        right: 14px;
        bottom: 14px;
    }
    .th-chat-fab {
        width: 50px;
        height: 50px;
    }
    .th-chat-tooltip {
        display: none;
    }
    .th-chat-popover {
        width: calc(100vw - 28px);
        max-width: 320px;
        bottom: calc(100% + 12px);
    }
    .contact-fp-actions .btn,
    .about-fp-actions .btn,
    .pro-fb-bill-actions .btn {
        width: 100%;
    }
    .pro-fb-bill-actions {
        width: 100%;
    }
    .notif-page-item,
    .adm-notif-row {
        flex-direction: column;
        align-items: stretch;
    }

    .notif-page-actions {
        justify-content: flex-end;
    }

    .notif-panel {
        right: -40px;
        width: calc(100vw - 24px);
    }

    .category-cta-card {
        flex-wrap: wrap;
        padding: 18px;
    }

    .cat-cta-btn {
        width: 100%;
        justify-content: center;
    }
}
