/* =====================================================
   CYTRIA RESPONSIVE CSS - Mobile-First Framework
   Created: 2026-01-30
   Supports: 320px-1440px+ viewports
   ===================================================== */

/* =====================================================
   BASE RESET & BOX MODEL
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
}

img, video, picture, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   CONTAINER SYSTEM
   ===================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }
}

/* =====================================================
   FLEX GRID SYSTEM
   ===================================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col {
    flex: 1 1 100%;
    padding: 0 8px;
    min-width: 0;
}

/* Mobile: Single column */
@media (max-width: 767px) {
    .row {
        flex-direction: column;
    }
    .col {
        width: 100%;
        flex-basis: 100%;
    }
}

/* Tablet: 2-3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .col-md-6 { flex-basis: 50%; max-width: 50%; }
    .col-md-4 { flex-basis: 33.333%; max-width: 33.333%; }
    .col-md-3 { flex-basis: 25%; max-width: 25%; }
}

/* Desktop: Full grid */
@media (min-width: 1024px) {
    .col-lg-6 { flex-basis: 50%; max-width: 50%; }
    .col-lg-4 { flex-basis: 33.333%; max-width: 33.333%; }
    .col-lg-3 { flex-basis: 25%; max-width: 25%; }
    .col-lg-2 { flex-basis: 16.666%; max-width: 16.666%; }
}

/* =====================================================
   VISIBILITY HELPERS
   ===================================================== */
.hide-mobile { display: block; }
.show-mobile { display: none; }
.hide-tablet { display: block; }
.hide-desktop { display: block; }

@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet { display: none !important; }
}

@media (min-width: 1024px) {
    .hide-desktop { display: none !important; }
}

/* =====================================================
   NAVIGATION - RESPONSIVE
   ===================================================== */
nav {
    max-width: 100vw;
    overflow-x: hidden;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    color: inherit;
    z-index: 1001;
}

/* Mobile Navigation */
@media (max-width: 767px) {
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg, #FAFCFE);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        z-index: 1000;
        padding: 80px 24px 24px;
    }
    
    .nav-links.active {
        display: flex !important;
    }
    
    .nav-links a {
        font-size: 18px !important;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0 !important;
    }
}

@media (min-width: 768px) {
    .hamburger {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
    }
}

/* =====================================================
   TOUCH TARGETS - Minimum 44x44px
   ===================================================== */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"],
.nav-link,
.nav-cta,
.clickable,
[role="button"] {
    min-height: 44px;
    min-width: 44px;
}

a {
    touch-action: manipulation;
}

/* =====================================================
   TYPOGRAPHY - RESPONSIVE
   ===================================================== */
/* Mobile First Sizes */
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.25rem; line-height: 1.3; }
h4 { font-size: 1.125rem; line-height: 1.35; }
h5, h6 { font-size: 1rem; line-height: 1.4; }
body, p { font-size: 16px; }

/* Tablet */
@media (min-width: 768px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

/* Desktop */
@media (min-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
}

/* =====================================================
   FORMS - RESPONSIVE
   ===================================================== */
input, select, textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
    width: 100%;
    max-width: 100%;
}

@media (max-width: 767px) {
    input, select, textarea {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
    }
    
    label {
        display: block;
        margin-bottom: 8px;
    }
    
    form .row {
        flex-direction: column;
    }
}

/* =====================================================
   BUTTONS - RESPONSIVE
   ===================================================== */
@media (max-width: 767px) {
    .btn,
    .hero-cta,
    .nav-cta,
    .cta {
        width: 100%;
        text-align: center;
        padding: 14px 24px !important;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-group,
    .button-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* =====================================================
   CARDS - RESPONSIVE
   ===================================================== */
.card,
.pitch-box,
.sector-card,
.stat-card,
.price-card {
    max-width: 100%;
    margin-bottom: 16px;
}

@media (max-width: 767px) {
    .card,
    .pitch-box,
    .sector-card,
    .stat-card,
    .price-card {
        padding: 20px !important;
        margin-bottom: 16px;
    }
}

/* =====================================================
   GRIDS - RESPONSIVE
   ===================================================== */
.pitch-grid,
.sector-grid,
.stat-grid,
.limits-grid,
.price-cards,
.feature-grid,
.service-grid,
.team-grid {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .pitch-grid,
    .sector-grid,
    .stat-grid,
    .limits-grid,
    .price-cards,
    .feature-grid,
    .service-grid,
    .team-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .pitch-grid,
    .sector-grid,
    .feature-grid,
    .service-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .stat-grid,
    .price-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* =====================================================
   HERO SECTION - RESPONSIVE
   ===================================================== */
.hero {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 767px) {
    .hero {
        padding: 80px 16px 60px !important;
        text-align: center;
    }
    
    .hero h1 {
        font-size: clamp(1.5rem, 7vw, 2.25rem) !important;
        padding: 0;
        margin-bottom: 20px;
    }
    
    .hero .subtitle,
    .hero p {
        font-size: 16px !important;
        padding: 0;
        margin-bottom: 24px;
    }
    
    .hero-cta {
        padding: 16px 32px !important;
        font-size: 16px !important;
        width: 100%;
        max-width: 320px;
    }
}

/* =====================================================
   SECTIONS - RESPONSIVE
   ===================================================== */
section,
.section {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 767px) {
    section,
    .section {
        padding: 48px 16px !important;
    }
    
    section h2,
    .section h2 {
        font-size: 1.5rem !important;
        margin-bottom: 24px;
    }
}

/* =====================================================
   FOOTER - RESPONSIVE
   ===================================================== */
footer {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 767px) {
    footer {
        padding: 32px 16px !important;
    }
    
    footer .container {
        flex-direction: column !important;
        gap: 24px !important;
        text-align: center;
    }
    
    footer .footer-links,
    footer nav,
    footer .links {
        flex-direction: column;
        gap: 16px;
    }
    
    footer a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* =====================================================
   TABLES - RESPONSIVE
   ===================================================== */
@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Stack table on mobile */
    .table-responsive tbody tr {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #eee;
        padding: 16px 0;
    }
    
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
    }
    
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
    }
}

/* =====================================================
   MODALS & OVERLAYS - RESPONSIVE
   ===================================================== */
.modal,
.overlay,
.popup {
    max-width: 100vw;
    max-height: 100vh;
}

@media (max-width: 767px) {
    .modal-content,
    .popup-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* =====================================================
   PREVENT HORIZONTAL SCROLL
   ===================================================== */
.hero,
.section,
.footer,
header,
main,
nav,
.container,
.wrapper {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Fix any absolutely positioned elements */
.hero::before,
.hero::after,
.section::before,
.section::after {
    max-width: 100vw;
    overflow: hidden;
}

/* =====================================================
   SPACING UTILITIES
   ===================================================== */
@media (max-width: 767px) {
    .mb-mobile-0 { margin-bottom: 0 !important; }
    .mb-mobile-1 { margin-bottom: 8px !important; }
    .mb-mobile-2 { margin-bottom: 16px !important; }
    .mb-mobile-3 { margin-bottom: 24px !important; }
    .mb-mobile-4 { margin-bottom: 32px !important; }
    
    .p-mobile-0 { padding: 0 !important; }
    .p-mobile-1 { padding: 8px !important; }
    .p-mobile-2 { padding: 16px !important; }
    .p-mobile-3 { padding: 24px !important; }
}

/* =====================================================
   CYTRIA SPECIFIC FIXES
   ===================================================== */

/* Pricing cards featured state */
@media (max-width: 767px) {
    .price-card.featured {
        transform: none !important;
        order: -1; /* Show featured first on mobile */
    }
}

/* Language selector */
@media (max-width: 767px) {
    .lang-switch,
    .language-selector {
        position: absolute;
        top: 16px;
        right: 60px;
    }
    
    .lang-switch a,
    .language-selector a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Stats section */
@media (max-width: 767px) {
    .stat-card .number {
        font-size: 2rem !important;
    }
    
    .stat-card .label {
        font-size: 14px !important;
    }
    
    .stat-card .source {
        font-size: 12px !important;
    }
}

/* FAQ section */
@media (max-width: 767px) {
    .faq-list {
        padding: 0;
    }
    
    .faq-item {
        padding: 20px 0;
    }
    
    .faq-item h3 {
        font-size: 16px !important;
        cursor: pointer;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .faq-item p {
        font-size: 14px !important;
    }
}

/* ROI Calculator */
@media (max-width: 767px) {
    .calculator-form {
        padding: 20px !important;
    }
    
    .calculator-result {
        padding: 20px !important;
    }
}

/* Contact Form */
@media (max-width: 767px) {
    .contact-form {
        padding: 24px 16px !important;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .hamburger,
    .nav-links,
    .cookie-consent,
    .modal,
    .popup {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}
