/* ============================================
   APPWIN Theme - Responsive CSS (moban-45)
   ============================================ */

/* === TABLET: 1024px === */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    /* Header */
    .header-top {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-time {
        display: none;
    }

    .header-btn-group .btn-login,
    .header-btn-group .btn-register,
    .header-btn-group .btn-demo {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* Navigation */
    .nav-menu .nav-item .nav-link {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Hero */
    .hero-inner-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text-side {
        max-width: 100%;
    }

    .hero-brand {
        font-size: 42px;
    }

    .hero-tagline {
        font-size: 18px;
    }

    .hero-stats-row {
        justify-content: center;
    }

    .hero-cta-group {
        justify-content: center;
    }

    .hero-download-badge {
        margin: 0 auto;
    }

    .hero-phone-side {
        max-width: 100%;
    }

    .phone-3d-showcase {
        width: 320px;
        height: 400px;
    }

    .phone-frame {
        width: 160px;
        height: 320px;
    }

    .phone-center {
        width: 180px;
        height: 360px;
    }

    /* Features */
    .features-ios-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .ios-icon-box {
        width: 65px;
        height: 65px;
    }

    .ios-icon-box i {
        font-size: 26px;
    }

    /* Ratings */
    .ratings-content-wrapper {
        flex-direction: column;
    }

    .rating-overview {
        flex-direction: column;
        text-align: center;
    }

    /* Footer columns */
    .footer-columns-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* News */
    .home-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-news-placeholder {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Related */
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Content */
    .content-area {
        flex-direction: column;
    }

    /* Floating sidebar */
    .floating-sidebar {
        right: 10px;
    }

    .sidebar-btn {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }
}

/* === MOBILE: 768px === */
@media (max-width: 768px) {
    /* Header */
    .site-header {
        position: sticky;
    }

    .header-top {
        padding: 10px 0;
    }

    .logo img {
        height: 35px;
    }

    .header-btn-group {
        gap: 6px;
    }

    .header-btn-group .btn-login,
    .header-btn-group .btn-register,
    .header-btn-group .btn-demo {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Mobile navigation */
    .mobile-menu-toggle {
        display: block;
        padding: 10px;
    }

    .main-navigation .container {
        position: relative;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #1e1b4b;
        z-index: 100;
        box-shadow: 0 8px 20px rgba(0,0,0,0.3);
        max-height: 400px;
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-item .nav-link {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav-menu .has-dropdown > .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
    }

    /* Notification bar */
    .notification-content span {
        font-size: 12px;
    }

    /* Announcement Modal */
    .announcement-content {
        padding: 25px 20px;
        max-width: 95%;
    }

    .announcement-title {
        font-size: 16px;
    }

    .announcement-header-icon i {
        font-size: 36px;
    }

    .announcement-text {
        font-size: 12px;
    }

    /* Hero */
    .appwin-hero {
        padding: 40px 0 60px;
        min-height: auto;
    }

    .hero-brand {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .hero-tagline {
        font-size: 16px;
    }

    .hero-description {
        font-size: 14px;
    }

    .hero-stats-row {
        gap: 10px;
    }

    .hero-stat {
        padding: 8px 12px;
        min-width: 70px;
    }

    .hero-stat-number {
        font-size: 18px;
    }

    .hero-stat-label {
        font-size: 10px;
    }

    .hero-cta-group {
        flex-direction: column;
        align-items: center;
    }

    .btn-purple-primary,
    .btn-outline-purple {
        padding: 12px 28px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }

    /* Phone showcase */
    .phone-3d-showcase {
        width: 280px;
        height: 350px;
    }

    .phone-frame {
        width: 130px;
        height: 260px;
        border-radius: 20px;
    }

    .phone-center {
        width: 150px;
        height: 300px;
        border-radius: 22px;
    }

    .phone-left {
        transform: rotateY(25deg) translateX(-80px) translateZ(-20px) scale(0.8);
        --tx: -80px;
    }

    .phone-right {
        transform: rotateY(-25deg) translateX(80px) translateZ(-20px) scale(0.8);
        --tx: 80px;
    }

    /* Section title */
    .section-title {
        font-size: 24px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    /* Features grid */
    .features-ios-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .ios-icon-box {
        width: 55px;
        height: 55px;
    }

    .ios-icon-box i {
        font-size: 22px;
    }

    .feature-label {
        font-size: 11px;
    }

    /* App screens */
    .screen-phone-frame {
        width: 220px;
    }

    .screen-phone-content {
        height: 380px;
    }

    /* Ratings */
    .rating-overview {
        padding: 20px;
        gap: 20px;
    }

    .rating-number {
        font-size: 48px;
    }

    .rating-big-stars i {
        font-size: 16px;
    }

    /* Download */
    .download-title {
        font-size: 26px;
    }

    .download-qr-area {
        flex-direction: column;
        gap: 25px;
    }

    .qr-placeholder {
        width: 130px;
        height: 130px;
    }

    .qr-placeholder i {
        font-size: 36px;
    }

    .store-btn {
        min-width: 200px;
        padding: 10px 18px;
    }

    .store-btn i {
        font-size: 22px;
    }

    .store-big {
        font-size: 14px;
    }

    .download-devices {
        gap: 20px;
    }

    .device-icon i {
        font-size: 24px;
    }

    /* Footer CTA */
    .footer-cta-inner h2 {
        font-size: 26px;
    }

    .cta-features {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .cta-main-btn {
        padding: 14px 36px;
        font-size: 16px;
    }

    /* News */
    .home-news-grid {
        grid-template-columns: 1fr;
    }

    .home-news-placeholder {
        grid-template-columns: 1fr;
    }

    /* Article grid */
    .article-grid {
        grid-template-columns: 1fr;
    }

    /* Single article */
    .single-article {
        padding: 20px;
    }

    .article-title {
        font-size: 22px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-columns-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-col {
        text-align: center;
    }

    .footer-col ul li a {
        justify-content: center;
    }

    .footer-social-links {
        justify-content: center;
    }

    .license-icons {
        gap: 15px;
    }

    .license-item i {
        font-size: 22px;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 12px;
    }

    /* Provider tabs */
    .provider-tabs {
        gap: 6px;
    }

    .provider-tab {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Category header */
    .category-header {
        padding: 15px;
    }

    .category-title {
        font-size: 22px;
    }

    /* Pagination */
    .pagination .page-numbers {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }

    /* Floating sidebar - bottom bar on mobile */
    .floating-sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        right: 0;
        left: 0;
        transform: none;
        flex-direction: row;
        justify-content: center;
        background: #1e1b4b;
        padding: 8px 15px;
        gap: 12px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
        z-index: 1000;
    }

    .sidebar-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .sidebar-label {
        display: none !important;
    }

    /* Page */
    .page-article {
        padding: 20px;
    }

    .page-title {
        font-size: 22px;
    }

    /* Add padding at bottom for mobile sidebar */
    body {
        padding-bottom: 60px;
    }
}

/* === SMALL MOBILE: 480px === */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    /* Hero */
    .hero-brand {
        font-size: 28px;
    }

    .hero-tagline {
        font-size: 14px;
    }

    .hero-stats-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hero-stat {
        min-width: 60px;
        padding: 6px 10px;
    }

    .hero-stat-number {
        font-size: 16px;
    }

    /* Phone */
    .phone-3d-showcase {
        width: 240px;
        height: 300px;
    }

    .phone-frame {
        width: 110px;
        height: 220px;
        border-radius: 16px;
    }

    .phone-center {
        width: 130px;
        height: 260px;
    }

    /* Features */
    .features-ios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 300px;
    }

    .ios-icon-box {
        width: 65px;
        height: 65px;
    }

    /* App screens */
    .screen-phone-frame {
        width: 200px;
    }

    .screen-phone-content {
        height: 340px;
    }

    /* Rating */
    .rating-number {
        font-size: 42px;
    }

    .rating-breakdown {
        width: 100%;
    }

    .review-card {
        padding: 15px;
    }

    .review-text {
        font-size: 13px;
    }

    /* Download */
    .download-title {
        font-size: 22px;
    }

    .download-subtitle {
        font-size: 14px;
    }

    .store-btn {
        min-width: 180px;
    }

    /* Related */
    .related-grid {
        grid-template-columns: 1fr;
    }

    .related-item-thumb {
        height: 100px;
    }

    /* Footer */
    .footer-license-bar {
        padding: 15px;
    }

    .license-item i {
        font-size: 18px;
    }

    .license-item span {
        font-size: 10px;
    }

    /* CTA */
    .footer-cta-inner h2 {
        font-size: 22px;
    }

    /* Article */
    .article-card-thumb {
        height: 150px;
    }

    .article-card-title {
        font-size: 14px;
        padding: 12px 12px 6px;
    }

    .article-card-meta {
        padding: 0 12px;
        font-size: 11px;
    }

    .article-card-excerpt {
        padding: 8px 12px 12px;
        font-size: 12px;
    }
}

/* === VERY SMALL: 360px === */
@media (max-width: 360px) {
    .hero-brand {
        font-size: 24px;
    }

    .header-btn-group .btn-demo {
        display: none;
    }

    .section-title {
        font-size: 20px;
    }

    .features-ios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .ios-icon-box {
        width: 55px;
        height: 55px;
    }

    .ios-icon-box i {
        font-size: 20px;
    }
}

/* === Mobile Optimization Additions === */
@media (max-width: 768px) {
  .nav-link, .btn-login, .btn-register, .btn-demo,
  a, button, .sidebar-btn {
    min-height: 44px;
    min-width: 44px;
  }
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
  }
  img {
    max-width: 100%;
    height: auto;
  }
  .site-footer {
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  .article-card {
    margin-bottom: 20px;
  }
  .content-area {
    padding: 10px;
  }
}
@media (max-width: 360px) {
  .container {
    padding: 0 10px;
  }
  h1, .hero-title {
    font-size: 24px !important;
  }
  h2 {
    font-size: 20px !important;
  }
}
