/* style-cosmic.css - Kosmiczny motyw MasterPUR v4.1 (Mobile Fix) */

:root {
    --primary-lime: #9bc32d;
    --primary-lime-hover: #8ab024;
    --space-navy: #0b1120;
    --space-light: #1e293b;
    --text-dark: #0f172a;
    --light-gray: #f1f5f9;
    --white-pure: #ffffff;
    --shadow-glow: 0 0 20px rgba(155, 195, 45, 0.3);
    
    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* CMS Compatibility */
    --brand-lime: #9bc32d;
    --brand-dark: #0f172a;
    --brand-gray: #475569;
    --bg-light: #f1f5f9;
    --white: #ffffff;
}

/* GLOBAL RESETS - Mobile Fix */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--white-pure);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Zapobiega wychodzeniu obrazów poza ekran */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Zapobiega problemom z długimi linkami/word-break */
a, p, h1, h2, h3, h4, h5, h6, span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* TOP BAR MOBILE */
.top-bar {
    background: var(--space-navy);
    color: white;
    font-size: 0.85rem;
    padding: 8px 0;
    width: 100%;
    overflow: hidden;
}

.status-dot {
    height: 8px;
    width: 8px;
    background-color: var(--primary-lime);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--primary-lime);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(155, 195, 45, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(155, 195, 45, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(155, 195, 45, 0); }
}

/* NAVBAR MOBILE FIX */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    box-shadow: 0 4px 20px -10px rgba(0,0,0,0.1);
    width: 100%;
}

.navbar-collapse {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 600;
    margin: 0;
    transition: 0.3s;
    font-family: var(--font-head);
    font-size: 1rem;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.logo-img { 
    max-height: 40px; 
    width: auto;
}

/* HERO MOBILE FIX */
.hero-section {
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.stars-bg {
    background-color: var(--space-navy);
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    min-height: auto;
}

/* Responsywne nagłówki - clamp() */
h1, .display-3 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.2;
}

h2, .display-4 {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
}

.text-lime { 
    color: var(--primary-lime) !important; 
}

.bg-space { 
    background-color: var(--space-navy); 
    color: white; 
}

/* PRZYCISKI - pełna szerokość na mobile */
.btn-cosmic {
    background: var(--primary-lime);
    color: white;
    padding: 12px 24px;
    font-weight: 700;
    border-radius: 50px;
    border: none;
    transition: 0.3s;
    box-shadow: 0 10px 20px -5px rgba(155, 195, 45, 0.4);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
    font-family: var(--font-head);
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.btn-cosmic:hover {
    background: var(--primary-lime-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(155, 195, 45, 0.6);
    color: white;
}

@media (min-width: 992px) {
    .btn-cosmic {
        width: auto;
        padding: 14px 32px;
        font-size: 0.9rem;
    }
}

/* HERO IMG - responsywność */
.hero-img-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 3px solid white;
    width: 100%;
}

.hero-img {
    transition: transform 0.5s;
    width: 100%;
    height: auto;
}

/* KARTY - pełna szerokość i odstępy */
.card-service, .hover-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s;
    height: 100%;
    width: 100%;
}

.card-service:hover, .hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    border-color: var(--primary-lime);
}

/* NAV SEGMENTS - poprawione na mobile */
.nav-segments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.nav-segments .nav-link {
    border: 1px solid #e2e8f0;
    color: var(--text-dark);
    border-radius: 8px;
    margin-bottom: 0;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    background: white;
    font-family: var(--font-head);
    width: 100%;
}

.nav-segments .nav-link.active {
    background: var(--space-navy);
    color: white !important;
    border-color: var(--space-navy);
}

@media (max-width: 991px) {
    .nav-segments {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-segments .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.9rem;
    }
}

/* TAB CONTENT - overflow fix */
.tab-content {
    width: 100%;
    overflow: hidden;
}

/* FLEET BADGE - pozycjonowanie */
.fleet-badge {
    position: absolute;
    top: 10px; 
    right: 10px;
    background: var(--primary-lime);
    color: white;
    padding: 4px 12px;
    font-weight: bold;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-family: var(--font-head);
    font-size: 0.8rem;
    z-index: 10;
}

@media (min-width: 768px) {
    .fleet-badge {
        top: 20px; 
        right: 20px;
        padding: 5px 15px;
        font-size: 0.9rem;
    }
}

/* STATYSTYKI - poprawione na mobile */
.divide-cols > div {
    padding: 15px 10px;
}

@media (max-width: 767px) {
    .divide-cols > div:nth-child(-n+2) {
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
}

@media (min-width: 768px) {
    .divide-cols > div:not(:last-child) {
        border-right: 1px solid #e2e8f0;
    }
}

/* FORMULARZE - full width inputs */
.form-control, .form-select {
    max-width: 100%;
}

/* POST CONTENT - zapobiega wychodzeniu */
.post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
}

.post-content pre,
.post-content code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    display: block;
}

/* WYCENA FIX - zapobiega przewijaniu */
#wycena {
    width: 100%;
    overflow: hidden;
}

.wizard-step {
    width: 100%;
}

.config-card {
    width: 100%;
    text-align: center;
    padding: 15px 10px !important;
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .config-card {
        padding: 10px 5px !important;
        font-size: 0.8rem;
    }
    
    .config-card i {
        font-size: 1.5rem !important;
    }
}

/* GADGET - mobile positioning */
@media (max-width: 576px) {
    .contact-gadget {
        bottom: 15px;
        right: 15px;
    }
    
    .main-fab {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }
    
    .contact-item {
        padding: 10px 15px;
        min-width: 160px;
        font-size: 0.8rem;
    }
    
    .fab-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
        top: -8px;
        right: -8px;
    }
}

/* FOOTER - mobile stack */
.footer-cta-box {
    padding: 30px 20px;
    text-align: center;
}

@media (min-width: 992px) {
    .footer-cta-box {
        padding: 40px;
        text-align: left;
    }
}

/* TABLES - scroll na mobile */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* UTILITIES */
.object-fit-cover {
    object-fit: cover;
}

.ls-1 {
    letter-spacing: 1px;
}

.transition-transform {
    transition: transform 0.5s ease;
}

.hover-card:hover .transition-transform {
    transform: scale(1.05);
}

/* EDITOR CONTENT FIX */
.admin-content img,
.editor-container img {
    max-width: 100%;
    height: auto;
}

/* MEDIA QUERIES - poprawki */
@media (max-width: 991px) {
    .hero-section {
        padding: 40px 0 30px;
    }
    
    .stars-bg {
        background-attachment: scroll;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col, [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Landscape phones */
@media (max-width: 576px) {
    h1, .display-3 {
        font-size: 1.8rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-cosmic {
        font-size: 0.8rem;
        padding: 10px 20px;
    }
}

/* Fix dla iOS inputs */
input, textarea, select, button {
    font-size: 16px !important; /* Zapobiega zoomowaniu na iOS */
}