/**
 * DhanGenie Design System - Global Responsive Framework
 * Breakpoints:
 * - Desktop: >= 1200px
 * - Small Desktop / Tablet Landscape: 992px – 1199px
 * - Tablet Portrait: 768px – 991px
 * - Mobile: <= 767px
 * - Extra Small Mobile: <= 480px
 * - Super Small Mobile: <= 360px
 */

/* 1. Global Box-Sizing & Viewport Safety Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

img, svg, video, iframe {
    max-width: 100%;
    height: auto;
}

/* 2. Small Desktop & Tablet Landscape (992px – 1199px) */
@media (max-width: 1199px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

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

    .nav-links {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .hero-visual-img {
        max-width: 360px;
        max-height: 320px;
    }
}

/* 3. Tablet & Mobile Navigation Breakpoint (<= 991px) */
@media (max-width: 991px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* 12-Column Grids collapse to single-column on tablets and mobile */
    .grid-cols-12 {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    .grid-cols-12 > *,
    .grid-cols-12 > [style*="grid-column"],
    .col-12, .col-11, .col-10, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2, .col-1 {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

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

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

    /* Mobile Header & Hamburger Toggle */
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        background: #ffffff;
        border: 1.5px solid var(--mst-border);
        border-radius: 8px;
        font-size: 18px;
        color: var(--mst-text-heading);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .nav-toggle:hover {
        border-color: var(--mst-primary);
        color: var(--mst-primary);
    }

    /* Mobile Navigation Dropdown */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        bottom: auto;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 16px 20px 24px 20px;
        border-top: 1px solid var(--mst-border);
        border-bottom: 2px solid var(--mst-primary);
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
        display: none;
        z-index: 1005;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-item:last-of-type {
        border-bottom: none;
    }

    .nav-link {
        padding: 13px 4px;
        font-size: 14.5px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--mst-text-heading);
        border-radius: 6px;
        width: 100%;
    }

    .nav-link i {
        font-size: 11px;
        color: var(--mst-text-muted);
        transition: transform 0.2s ease;
    }

    .nav-item.open .nav-link i {
        transform: rotate(180deg);
        color: var(--mst-primary);
    }

    .nav-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid var(--mst-border);
        background: var(--mst-bg-alt);
        border-radius: 10px;
        padding: 8px;
        margin-top: 2px;
        margin-bottom: 10px;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .nav-item.open .nav-dropdown {
        display: block;
    }

    .dropdown-item {
        padding: 9px 10px;
        border-radius: 8px;
    }

    .dropdown-item-title {
        font-size: 13px;
    }

    .dropdown-item-desc {
        font-size: 11.5px;
    }

    .navbar-actions {
        display: none;
    }

    .nav-links .mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--mst-border);
    }

    .mobile-actions .mst-btn-primary,
    .mobile-actions .mst-btn-secondary {
        width: 100%;
        height: 44px;
        font-size: 14px;
    }

    .mst-cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 36px 24px;
        gap: 24px;
    }

    .mst-cta-desc {
        max-width: 100%;
    }

    .stats-bar-card .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coming-soon-card {
        padding: 36px 28px;
    }

    .legal-content-card {
        padding: 28px 24px;
    }

    .domain-search-box {
        padding: 26px 24px;
    }
}

/* 4. Mobile Breakpoint (<= 767px) */
@media (max-width: 767px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
        width: 100%;
        max-width: 100%;
    }

    .section {
        padding: 44px 0;
    }

    .section-sm {
        padding: 28px 0;
    }

    .section-header {
        margin-bottom: 28px;
        padding: 0 4px;
    }

    .section-title {
        font-size: clamp(1.4rem, 4.5vw, 1.75rem);
    }

    /* All Multi-Column Grids collapse to single-column on mobile */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-12 {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .grid-cols-12 > *,
    .grid-cols-12 > [style*="grid-column"],
    .grid-cols-4 > *,
    .grid-cols-3 > *,
    .grid-cols-2 > *,
    .col-12, .col-11, .col-10, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2, .col-1 {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Mobile Header & Brand */
    .mst-navbar {
        height: 64px;
    }

    .navbar-inner {
        height: 64px;
    }

    .navbar-brand {
        gap: 8px;
    }

    .navbar-brand img {
        height: 32px;
        max-width: 140px;
    }

    .brand-badge {
        font-size: 9.5px;
        padding: 2px 6px;
    }

    /* Breadcrumbs */
    .mst-breadcrumbs {
        margin-bottom: 12px;
    }

    .breadcrumb-list {
        font-size: 12px;
    }

    .breadcrumb-separator {
        margin: 0 6px;
        font-size: 8.5px;
    }

    .breadcrumb-separator i {
        font-size: 8.5px;
    }

    /* Hero Section */
    .hero-section {
        padding: 32px 0 24px 0;
    }

    .hero-title {
        font-size: clamp(1.5rem, 5vw, 1.95rem);
        line-height: 1.22;
        margin-bottom: 14px;
    }

    .hero-desc {
        font-size: 14px;
        line-height: 1.55;
        margin-bottom: 20px;
    }

    .hero-visual-wrap {
        min-height: auto;
        margin-top: 14px;
    }

    .hero-visual-img,
    .col-4 img,
    .col-5 img,
    .col-6 img {
        max-width: 240px;
        max-height: 190px;
        height: auto;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hero-actions .mst-btn-primary,
    .hero-actions .mst-btn-secondary {
        width: 100%;
        height: 46px;
    }

    .hero-trust-list {
        gap: 12px;
        padding-top: 16px;
    }

    .hero-trust-item {
        font-size: 12.5px;
    }

    /* Coming Soon Card */
    .coming-soon-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .coming-soon-title {
        font-size: clamp(1.4rem, 4.8vw, 1.8rem);
        line-height: 1.25;
        margin-bottom: 10px;
    }

    .coming-soon-subtitle {
        font-size: 14.5px;
        line-height: 1.5;
        margin-bottom: 14px;
    }

    .coming-soon-desc {
        font-size: 13.5px;
        line-height: 1.6;
        margin-bottom: 16px;
    }

    .coming-soon-capabilities {
        margin-bottom: 20px;
    }

    .coming-soon-features {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .coming-soon-feature-item {
        font-size: 13px;
        line-height: 1.45;
    }

    .coming-soon-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
        padding-top: 18px;
    }

    .coming-soon-actions .mst-btn-primary,
    .coming-soon-actions .mst-btn-secondary {
        width: 100% !important;
        height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
    }

    .coming-soon-visual {
        margin-top: 24px;
        text-align: center;
    }

    .coming-soon-visual .hero-visual-wrap {
        min-height: auto;
        margin-top: 0;
    }

    .coming-soon-visual .hero-visual-img {
        max-width: 220px;
        max-height: 180px;
        height: auto;
    }

    /* Domain Search Box */
    .domain-search-box {
        padding: 20px 16px;
        margin-top: -20px;
        border-radius: 14px;
    }

    .domain-form {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .domain-input-group {
        width: 100%;
    }

    .domain-search-input {
        height: 48px;
        font-size: 14px;
        padding-left: 44px;
        width: 100%;
    }

    .domain-input-icon {
        left: 14px;
    }

    .domain-form .domain-search-submit,
    .domain-form .mst-btn-primary {
        width: 100%;
        height: 48px;
    }

    .domain-tld-pills {
        gap: 8px;
        margin-top: 16px;
    }

    .tld-pill {
        padding: 6px 10px;
        font-size: 12px;
    }

    .domain-result-box {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 16px 14px;
    }

    .domain-result-name {
        font-size: 1.15rem;
    }

    .domain-result-box .mst-btn-primary,
    .domain-result-box .mst-btn-secondary,
    .domain-result-box .mst-btn-outline {
        width: 100%;
        height: 42px;
    }

    .domain-suggestions-wrap .grid {
        grid-template-columns: 1fr !important;
    }

    /* Cards */
    .pricing-card {
        padding: 24px 18px;
    }

    .feature-card {
        padding: 22px 18px;
    }

    .mst-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 16px;
    }

    .mst-card-body {
        padding: 18px 16px;
    }

    .stats-bar-card {
        padding: 20px 14px;
    }

    .stats-bar-card .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    .stat-item {
        padding: 4px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 12px;
    }

    /* Mobile Footer */
    .mst-footer {
        padding: 40px 0 0 0;
    }

    .footer-top {
        padding-bottom: 32px;
    }

    .footer-top .grid-cols-4 {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .footer-col {
        margin-bottom: 0;
        width: 100%;
    }

    .footer-brand {
        margin-bottom: 14px;
    }

    .footer-desc {
        font-size: 13px;
        line-height: 1.55;
        margin-bottom: 16px;
    }

    .footer-contact-item {
        font-size: 13px;
        margin-bottom: 10px;
        word-break: break-word;
    }

    .footer-title {
        font-size: 13.5px;
        margin-bottom: 14px;
        padding-bottom: 6px;
        border-bottom: 1px solid #1e293b;
    }

    .footer-links {
        gap: 12px;
    }

    .footer-links li a {
        font-size: 13.5px;
        display: inline-block;
        padding: 2px 0;
    }

    .footer-bottom {
        padding: 20px 0;
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        font-size: 12px;
    }

    .footer-legal-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .footer-legal-links a {
        font-size: 12px;
    }

    /* Floating WhatsApp */
    .floating-whatsapp {
        bottom: 20px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 18px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .legal-content-card {
        padding: 22px 16px;
    }

    .legal-content-card .legal-section-title {
        font-size: 1.15rem;
        margin-top: 22px;
    }

    .faq-cta-card {
        padding: 20px 16px;
    }

    .faq-cta-title {
        font-size: 1.2rem;
    }

    .sitemap-card {
        padding: 20px 16px;
    }

    /* Button and Link Wrapping */
    .mst-btn-primary,
    .mst-btn-secondary,
    .mst-btn-outline,
    .mst-btn-lg,
    .mst-cta-btn {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
}

/* 5. Extra Small Mobile (<= 480px) */
@media (max-width: 480px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .navbar-brand img {
        height: 30px;
        max-width: 125px;
    }

    .brand-badge {
        font-size: 8.5px;
        padding: 2px 5px;
    }

    .mst-breadcrumbs {
        margin-bottom: 10px;
    }

    .breadcrumb-list {
        font-size: 11.5px;
    }

    .breadcrumb-separator {
        margin: 0 5px;
        font-size: 8px;
    }

    .breadcrumb-separator i {
        font-size: 8px;
    }

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

    .hero-title {
        font-size: 1.45rem;
    }

    .coming-soon-card {
        padding: 20px 14px;
    }

    .coming-soon-actions .mst-btn-primary,
    .coming-soon-actions .mst-btn-secondary {
        height: 46px;
        font-size: 13.5px;
    }

    .legal-content-card {
        padding: 18px 12px;
    }

    .stats-bar-card .grid-cols-4 {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .footer-legal-links {
        flex-direction: column;
        gap: 8px;
    }

    .faq-cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .faq-cta-actions .mst-btn-primary,
    .faq-cta-actions .mst-btn-secondary {
        width: 100%;
    }
}

/* 6. Super Small Mobile (<= 360px) */
@media (max-width: 360px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar-brand {
        gap: 6px;
    }

    .navbar-brand img {
        height: 26px;
        max-width: 110px;
    }

    .brand-badge {
        font-size: 8px;
        padding: 1px 4px;
        letter-spacing: 0.2px;
    }

    .nav-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .coming-soon-card {
        padding: 16px 10px;
    }

    .coming-soon-actions .mst-btn-primary,
    .coming-soon-actions .mst-btn-secondary {
        height: 44px;
        font-size: 12.5px;
        padding: 0 10px;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .mst-btn-primary,
    .mst-btn-secondary,
    .mst-btn-outline {
        font-size: 13px;
        padding: 0 12px;
    }
}
