/* =============================================
   RESPONSIVE.CSS — Mobile-First Responsive Fixes
   SuperWebTech Marketing Website
   ============================================= */

/* ---- Global Responsive Resets ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Tablet (max-width: 991px) ---- */
@media (max-width: 991.98px) {

    /* Navbar mobile */
    .navbar-custom {
        padding: 0.5rem 0;
    }

    .navbar-brand img {
        height: 70px !important;
    }

    .navbar-collapse {
        background: #ffffff;
        border-radius: 0 0 1rem 1rem;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
    }

    [data-theme="dark"] .navbar-collapse {
        background: #1e293b;
    }

    .navbar-nav {
        gap: 0 !important;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        font-size: 0.95rem;
    }

    /* Mobile toggler icon fix */
    .navbar-toggler {
        padding: 0.4rem 0.6rem;
        font-size: 1.1rem;
    }

    .navbar-toggler-icon {
        width: 1.2em;
        height: 1.2em;
    }

    /* Mega menu — stack vertically on mobile */
    .mega-menu {
        position: relative !important;
    }

    .mega-menu .dropdown-menu,
    .mega-menu .mega-dropdown {
        position: static !important;
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.5rem 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        background: #f8fafc !important;
    }

    [data-theme="dark"] .mega-menu .dropdown-menu,
    [data-theme="dark"] .mega-menu .mega-dropdown {
        background: #111827 !important;
    }

    .mega-menu .dropdown-menu .row {
        flex-direction: column;
    }

    .mega-menu .dropdown-menu .col-md-3 {
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0.5rem 1rem;
    }

    .mega-menu .dropdown-menu .border-top {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    /* Hide right-side buttons on very small */
    .d-flex.align-items-center.gap-3 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    /* Hero section */
    .hero-section {
        padding: 100px 0 50px !important;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    .hero-visual {
        height: 280px !important;
        margin-top: 2rem;
    }

    .hero-dashboard {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .hero-float-card {
        display: none !important;
    }

    /* Dash metrics grid */
    .dash-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Section titles */
    .section-title {
        font-size: 1.75rem !important;
    }

    h1.display-4 {
        font-size: 1.8rem !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    /* Cards */
    .feature-card {
        padding: 1.25rem !important;
    }

    .feature-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.4rem !important;
        margin-bottom: 1rem !important;
    }

    /* Counter / Stats */
    .counter-value {
        font-size: 2rem !important;
    }

    /* Footer */
    .footer-custom {
        padding: 40px 0 20px !important;
        text-align: center;
    }

    .footer-custom .row > div {
        margin-bottom: 1.5rem;
    }

    /* Floating actions */
    .floating-actions {
        bottom: 15px !important;
        right: 15px !important;
    }

    .btn-floating {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }

    /* Breadcrumb / Page headers */
    section[style*="padding-top: 120px"] {
        padding-top: 90px !important;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Forms */
    .form-control, .form-select {
        font-size: 0.95rem;
    }

    /* Logo slider */
    .logo-slider img {
        height: 32px !important;
        margin: 0 20px !important;
    }
}

/* ---- Phone (max-width: 575px) ---- */
@media (max-width: 575.98px) {

    /* Smaller navbar logo */
    .navbar-brand img {
        height: 70px !important;
    }

    /* Even smaller hero text */
    .hero-title {
        font-size: 1.6rem !important;
    }

    h1.display-4 {
        font-size: 1.5rem !important;
    }

    .hero-section {
        padding: 85px 0 40px !important;
    }

    .hero-visual {
        height: 220px !important;
    }

    /* Dash metrics single column */
    .dash-metrics {
        grid-template-columns: 1fr !important;
    }

    .dash-metric-val {
        font-size: 1.1rem !important;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }

    .btn-primary-gradient {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.85rem !important;
    }

    /* Section paddings */
    section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .section-title {
        font-size: 1.4rem !important;
    }

    .section-subtitle {
        font-size: 0.75rem !important;
    }

    /* Cards */
    .feature-card {
        padding: 1rem !important;
        border-radius: 0.85rem !important;
    }

    .counter-value {
        font-size: 1.6rem !important;
    }

    /* Footer cols stack */
    .footer-custom .col-lg-3,
    .footer-custom .col-lg-4,
    .footer-custom .col-md-6 {
        text-align: center;
    }

    /* Container padding */
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Card images */
    .card-img-top {
        height: 180px !important;
        object-fit: cover;
    }

    /* Portfolio / Blog card image */
    img[style*="height: 240px"] {
        height: 160px !important;
    }

    img[style*="height: 450px"],
    img[style*="max-height: 450px"] {
        max-height: 200px !important;
    }

    img[style*="height: 400px"],
    img[style*="max-height: 400px"] {
        max-height: 200px !important;
    }

    /* Badge sizes */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.6rem !important;
    }

    /* Glassmorphism on mobile */
    .glassmorphism {
        backdrop-filter: blur(8px) !important;
    }

    /* Logo slider */
    .logo-slider img {
        height: 25px !important;
        margin: 0 15px !important;
    }

    /* Theme toggle smaller */
    .theme-switch-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}

/* ---- Very small devices (max-width: 360px) ---- */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.35rem !important;
    }

    h1.display-4 {
        font-size: 1.3rem !important;
    }

    .navbar-brand img {
        height: 26px !important;
    }

    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}
