/**
 * All-In Bud - Główny plik stylów
 * Zoptymalizowany pod kątem Bootstrap i wydajności
 * Wersja: 2.0.0
 */

/* ===== ZMIENNE ===== */
:root {
    /* Kolory główne */
    --bs-primary: #ed3237;
    --bs-primary-rgb: 237, 50, 55;
    --bs-primary-dark: #d42d32;
    --bs-primary-light: rgba(237, 50, 55, 0.1);
    
    /* Kolory tekstu */
    --bs-body-color: #444444;
    --bs-heading-color: #424242;
    
    /* Fonty */
    --font-default: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-heading: 'Raleway', sans-serif;
    --font-nav: 'Poppins', sans-serif;
}

/* ===== PODSTAWOWE STYLE ===== */
body {
    font-family: var(--font-default);
    color: var(--bs-body-color);
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.2s ease;
}

html:not(.wf-loading) body,
.wf-active body {
    opacity: 1;
}

/* ===== NAGŁÓWKI ===== */
h1, .h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2, .h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3, .h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4, .h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5, .h5 { font-size: clamp(1.1rem, 2vw, 1.25rem); }
h6, .h6 { font-size: clamp(1rem, 1.5vw, 1.1rem); }

h1, h2, h3, h4, h5, h6 {
    color: var(--bs-heading-color);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* ===== LINKI ===== */
a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--bs-primary-dark);
}

/* ===== HEADER (nadpisanie Bootstrap) ===== */
.header {
    background-color: var(--bs-primary);
    padding: 15px 0;
    transition: all 0.3s ease;
    z-index: 1030;
}

.header.scrolled {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.header .logo img {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.header.scrolled .logo img {
    max-height: 45px;
}

/* ===== NAVIGATION (nadpisanie Bootstrap) ===== */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-nav);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease;
    position: relative;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus,
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff;
}

.navbar-dark .navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: #ffffff;
}

.dropdown-menu {
    margin-top: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
    background-color: var(--bs-primary-light);
    color: var(--bs-primary);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
                url('../img/hero-bg.webp') center/cover no-repeat;
    margin-top: -1px; /* Usuwa białą linię */
}

.hero h1 {
    color: #ffffff;
    margin-bottom: 1rem;
}

.hero h1 span {
    border-bottom: 4px solid var(--bs-primary);
    padding-bottom: 0.25rem;
}

.hero .btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hero .btn-primary:hover {
    background-color: var(--bs-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 50, 55, 0.3);
}

.hero .btn-outline-light:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* ===== SEKCJE ===== */
.section {
    padding: 80px 0;
    scroll-margin-top: 80px;
}

@media (max-width: 991.98px) {
    .section {
        padding: 60px 0;
        scroll-margin-top: 70px;
    }
}

@media (max-width: 767.98px) {
    .section {
        padding: 40px 0;
    }
}

.section-title {
    margin-bottom: 3rem;
}

.section-title h2 {
    color: var(--bs-primary);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title h3 {
    margin-bottom: 0;
}

/* ===== STATS ===== */
.stats-item {
    text-align: center;
}

.stats-item i {
    font-size: 3rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

.stats-item .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bs-primary);
    line-height: 1.2;
}

@media (max-width: 767.98px) {
    .stats-item .stat-number {
        font-size: 2rem;
    }
}

/* ===== GALLERY ===== */
.gallery-item {
    overflow: hidden;
    border-radius: 0.5rem;
}

.gallery-item img {
    transition: transform 0.5s ease;
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item .card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.gallery-overlay {
    background: rgba(237, 50, 55, 0.9);
    transition: opacity 0.3s ease;
}

.gallery-filters .btn {
    transition: all 0.3s ease;
    border-width: 2px;
}

.gallery-filters .btn.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
}

/* ===== TESTIMONIALS ===== */
.testimonials {
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('../img/cegla.webp') center/cover fixed;
    color: #ffffff;
}

.testimonials .card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
}

.testimonials .carousel-control-prev-icon,
.testimonials .carousel-control-next-icon {
    background-color: var(--bs-primary);
    border-radius: 50%;
    padding: 1.5rem;
}

/* ===== FAQ (Bootstrap Accordion) ===== */
.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 0.5rem !important;
    overflow: hidden;
}

.accordion-button {
    font-weight: 600;
    color: var(--bs-heading-color);
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background-color: var(--bs-primary-light);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(237, 50, 55, 0.25);
}

.accordion-button::after {
    background-size: 1.25rem;
}

/* ===== BLOG ===== */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blog-card img {
    transition: transform 0.5s ease;
    height: 200px;
    object-fit: cover;
}

.blog-card:hover img {
    transform: scale(1.05);
}

/* ===== CONTACT ===== */
.contact-info-item {
    transition: transform 0.3s ease;
}

.contact-info-item:hover {
    transform: translateX(5px);
}

.contact-info-item i {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-primary-light);
    color: var(--bs-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.contact-info-item:hover i {
    background-color: var(--bs-primary);
    color: #ffffff;
}

/* CF7 - Contact Form 7 */
.wpcf7-form .form-control {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7-form .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(237, 50, 55, 0.25);
    outline: none;
}

.wpcf7-form .btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 2rem;
}

.wpcf7-form .btn-primary:hover {
    background-color: var(--bs-primary-dark);
    border-color: var(--bs-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 50, 55, 0.3);
}

.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.wpcf7-response-output {
    border-radius: 0.5rem;
    padding: 1rem !important;
    margin: 1rem 0 0 !important;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #1a1e24;
    color: rgba(255, 255, 255, 0.7);
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--bs-primary);
}

.footer h5, .footer h6 {
    color: #ffffff;
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.footer h5::after, .footer h6::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--bs-primary);
}

.footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    background-color: var(--bs-primary);
    color: #ffffff;
    transform: translateY(-3px);
}

/* ===== PRELOADER ===== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--bs-primary-light);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SCROLL TO TOP ===== */
#scrollTop {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 5px 15px rgba(237, 50, 55, 0.3);
}

#scrollTop:hover {
    background-color: var(--bs-primary-dark);
    transform: translateY(-3px);
}

/* ===== UTILITIES ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

.aspect-4-3 {
    aspect-ratio: 4/3;
}

.aspect-16-9 {
    aspect-ratio: 16/9;
}

/* ===== RTL SUPPORT (jeśli potrzebne) ===== */
.rtl .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* ===== MEDIA QUERIES (optymalizacja) ===== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-dark .navbar-nav .nav-link {
        color: var(--bs-body-color);
    }
    
    .navbar-dark .navbar-nav .nav-link:hover,
    .navbar-dark .navbar-nav .nav-link.active {
        color: var(--bs-primary);
    }
    
    .navbar-dark .navbar-nav .nav-link.active::after {
        background-color: var(--bs-primary);
    }
}

@media (max-width: 575.98px) {
    .hero {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero .d-flex {
        justify-content: center;
    }
    
    .gallery-item img {
        height: 150px;
    }
}
/* =========================================================
   FIX: HEADER / NAVBAR (Bootstrap + WP)
   ========================================================= */

/* Navbar nie może się łamać */
.navbar {
    flex-wrap: nowrap;
}

/* Kontener menu – jedna linia */
.navbar-collapse {
    flex-grow: 0;
}

/* Lista menu */
.navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    white-space: nowrap;
}

/* Element listy */
.navbar-nav > li {
    white-space: nowrap;
}

/* Linki */
.navbar-dark .navbar-nav .nav-link {
    padding: 0.25rem 0 !important;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

/* ACTIVE / HOVER underline – poprawione */
.navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background-color: #fff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .current-menu-item > .nav-link::after {
    transform: scaleX(1);
}

/* USUŃ stary ::after (konflikt) */
.navbar-dark .navbar-nav .nav-link.active::after {
    left: 0;
    right: auto;
}

/* Telefon – nie rozpycha menu */
.header .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Logo */
.navbar-brand {
    flex-shrink: 0;
    margin-right: 2rem;
}

/* =========================================================
   MOBILE – osobny układ (zostaje kolumnowy)
   ========================================================= */
@media (max-width: 1199.98px) {
    .navbar-collapse {
        flex-grow: 1;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .navbar-dark .navbar-nav .nav-link::after {
        display: none;
    }
}
/* =========================================================
   MOBILE NAVBAR FIX
   ========================================================= */
@media (max-width: 1199.98px) {

    /* kontener menu */
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem 1.25rem;
        margin-top: 1rem;
        border-radius: 0.75rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }

    /* lista */
    .navbar-nav {
        width: 100%;
        gap: 0;
    }

    /* element listy */
    .navbar-nav > li {
        width: 100%;
    }

    /* link */
    .navbar-dark .navbar-nav .nav-link {
        width: 100%;
        padding: 0.75rem 0;
        color: var(--bs-body-color);
        font-size: 1rem;
        font-weight: 500;
        border-bottom: 1px solid #eaeaea;
    }

    /* ostatni bez linii */
    .navbar-nav > li:last-child .nav-link {
        border-bottom: none;
    }

    /* ACTIVE */
    .navbar-dark .navbar-nav .current-menu-item > .nav-link,
    .navbar-dark .navbar-nav .nav-link.active {
        color: var(--bs-primary);
        font-weight: 600;
    }

    /* underline OFF na mobile */
    .navbar-dark .navbar-nav .nav-link::after {
        display: none !important;
    }

    /* dropdown */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding-left: 1rem;
    }

    .dropdown-item {
        padding: 0.5rem 0;
    }

    /* telefon button */
    .header .btn {
        width: 100%;
        margin-top: 1rem;
        text-align: center;
    }

    /* hamburger */
    .navbar-toggler {
        border: none;
        box-shadow: none;
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }
}