/* ============================================================
   medws-responsive.css - mocny responsive override
   Breakpointy: 1280 / 1024 / 768 / 600 / 480 / 360
   Ladowane PO medws-design.css zeby nadpisywac
   ============================================================ */

/* Viewport guard - kazdy obiekt nie wystaje poza ekran */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

img, video, iframe, table, pre, code {
    max-width: 100%;
    height: auto;
}

/* Touch targets minimum 44px (WCAG AAA) */
a, button, input, select, textarea, .medws-btn-primary, .medws-btn-secondary,
.medws-nav-trigger, .medws-mega-cta {
    min-height: 44px;
}
.medws-nav-item a, .medws-pricing-card a {
    min-height: auto;
}

/* ===== BREAKPOINT 1280px (laptopy) ===== */
@media (max-width: 1280px) {
    .medws-container, .container, .medws-hero, .medws-section {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
    .medws-mega-menu {
        max-width: 95vw;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* ===== BREAKPOINT 1024px (tablety landscape) ===== */
@media (max-width: 1024px) {
    h1, .medws-hero h1 { font-size: 36px !important; line-height: 1.2 !important; }
    h2 { font-size: 28px !important; }
    h3 { font-size: 22px !important; }

    .medws-hero {
        padding: 40px 24px !important;
        text-align: center !important;
    }
    .medws-hero-grid, .medws-2col, .medws-3col {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* Footer 5-col -> 2-col na tablecie */
    .medws-footer-grid, footer .medws-grid-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px !important;
    }

    /* Mega menu - upakuj */
    .medws-mega-menu {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        max-width: 90vw !important;
        padding: 24px !important;
    }
}

/* ===== BREAKPOINT 768px (tablety portrait) ===== */
@media (max-width: 768px) {
    body { font-size: 16px; line-height: 1.6; }
    h1, .medws-hero h1 { font-size: 28px !important; }
    h2 { font-size: 24px !important; }
    h3 { font-size: 20px !important; }
    p { font-size: 16px !important; }

    /* Hero pakiet kompaktowy */
    .medws-hero {
        padding: 32px 16px !important;
        min-height: auto !important;
    }
    .medws-hero h1 { margin-bottom: 12px !important; }
    .medws-hero p { margin-bottom: 20px !important; }

    /* Sekcje - mniejszy padding */
    section, .medws-section {
        padding: 40px 16px !important;
    }

    /* Wszystkie grids -> 1 kolumna */
    .medws-grid-2, .medws-grid-3, .medws-grid-4, .medws-grid-5,
    .medws-pricing-grid, .medws-services-grid, .medws-branze-grid,
    .medws-cases-grid, .medws-clients-grid, .medws-blog-grid,
    .medws-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Header - mobile menu trigger */
    .medws-header, header.medws {
        padding: 12px 16px !important;
    }
    .medws-nav, header nav {
        display: none !important;
    }
    .medws-nav.is-open {
        display: flex !important;
        position: fixed !important;
        top: 0; left: 0; right: 0; bottom: 0;
        background: #fff;
        flex-direction: column;
        padding: 80px 24px 24px;
        z-index: 9999;
        overflow-y: auto;
    }
    .medws-mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: 0;
        width: 44px;
        height: 44px;
        cursor: pointer;
        padding: 0;
    }
    .medws-mobile-toggle:before {
        content: '\2630';
        font-size: 28px;
        color: #0a0a0a;
    }
    .medws-nav.is-open .medws-mobile-toggle:before {
        content: '\2715';
    }

    /* Mega menu na mobile - accordion */
    .medws-mega-menu {
        position: static !important;
        display: none !important;
        grid-template-columns: 1fr !important;
        background: #f6f7f9 !important;
        padding: 16px !important;
        margin-top: 8px !important;
        box-shadow: none !important;
        border-radius: 8px;
    }
    .medws-nav-dropdown.is-open .medws-mega-menu {
        display: grid !important;
    }
    .medws-nav-trigger {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        font-size: 18px;
        border-bottom: 1px solid #e7e9ed;
    }
    .medws-nav-item {
        width: 100%;
    }
    .medws-mega-col h5 {
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin: 0 0 8px;
        color: #0066cc;
    }
    .medws-mega-col ul {
        list-style: none;
        padding: 0;
        margin: 0 0 16px;
    }
    .medws-mega-col li {
        padding: 8px 0;
        border-bottom: 1px solid #eef0f3;
    }
    .medws-mega-col a {
        color: #0a0a0a;
        text-decoration: none;
        font-size: 16px;
        display: block;
    }

    /* Pakiety / cennik karty */
    .medws-pricing-card {
        padding: 24px 16px !important;
        margin-bottom: 16px;
    }
    .medws-pricing-card h3 {
        font-size: 20px !important;
    }
    .medws-pricing-card .price {
        font-size: 28px !important;
    }

    /* Footer 5-col -> 1-col na mobile */
    .medws-footer-grid, footer .medws-grid-5, footer .medws-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    footer h5 {
        font-size: 16px !important;
        margin-bottom: 12px;
    }
    footer ul {
        list-style: none;
        padding: 0;
    }
    footer li {
        padding: 6px 0;
    }

    /* Tabele - przewijalne */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Quick form mobile */
    .medws-quick-form, .medws-form-wrap {
        padding: 16px !important;
    }
    .medws-quick-form input, .medws-quick-form select, .medws-quick-form textarea {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 16px;
        font-size: 16px;
        min-height: 48px;
        border: 1px solid #d8dde3;
        border-radius: 6px;
        margin-bottom: 12px;
    }
    .medws-quick-form button {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }

    /* Sticky CTA mobile */
    .medws-sticky-cta-mobile {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #0a0a0a;
        padding: 12px 16px;
        z-index: 9000;
        gap: 8px;
        justify-content: space-around;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
    }
    .medws-sticky-cta-mobile a {
        flex: 1;
        text-align: center;
        color: #fff;
        text-decoration: none;
        padding: 10px;
        font-size: 14px;
        border-radius: 6px;
        background: #0066cc;
        font-weight: 600;
    }
    .medws-sticky-cta-mobile a.medws-cta-phone {
        background: #0a8754;
    }
    /* Padding na dol body, zeby nie zaslaniac contentu */
    body {
        padding-bottom: 80px !important;
    }

    /* Cookie banner mobile */
    .medws-cookie-banner {
        bottom: 80px !important;
        left: 8px !important;
        right: 8px !important;
        max-width: none !important;
        padding: 16px !important;
        font-size: 14px;
    }

    /* WhatsApp/Tawk floating */
    .medws-whatsapp-float, #tawkchat-container, .tawk-min-container {
        bottom: 90px !important;
    }
}

/* ===== BREAKPOINT 600px (telefon landscape) ===== */
@media (max-width: 600px) {
    h1, .medws-hero h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    .medws-hero { padding: 24px 12px !important; }
    section, .medws-section { padding: 32px 12px !important; }
    .medws-btn-primary, .medws-btn-secondary {
        width: 100%;
        text-align: center;
        padding: 14px 20px !important;
        font-size: 16px !important;
    }
    .medws-cta-group {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===== BREAKPOINT 480px (mniejsze telefony) ===== */
@media (max-width: 480px) {
    h1, .medws-hero h1 { font-size: 22px !important; line-height: 1.3 !important; }
    h2 { font-size: 18px !important; }
    body { font-size: 15px; }
    .medws-stat-number, .stat-num { font-size: 32px !important; }
    .medws-pricing-card .price { font-size: 24px !important; }
    .medws-mobile-toggle {
        width: 40px;
        height: 40px;
    }
}

/* ===== BREAKPOINT 360px (najmniejsze) ===== */
@media (max-width: 360px) {
    h1, .medws-hero h1 { font-size: 20px !important; }
    body { font-size: 14px; }
}

/* ===== DESKTOP - ukryj mobile-only elementy ===== */
@media (min-width: 769px) {
    .medws-sticky-cta-mobile, .medws-mobile-toggle {
        display: none !important;
    }
}

/* ===== Mega menu fix dla desktopu - zapobiega obcinaniu ===== */
@media (min-width: 769px) {
    .medws-mega-menu {
        max-width: min(1100px, 92vw);
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== PRINT styles ===== */
@media print {
    header, footer, .medws-cookie-banner, .medws-sticky-cta-mobile,
    .medws-whatsapp-float, #tawkchat-container, .medws-mobile-toggle {
        display: none !important;
    }
    body { background: #fff !important; color: #000 !important; }
    a { color: #000 !important; text-decoration: underline; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}