/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green-dark: #1a4d2e;
    --green-mid: #5c8a3c;
    --green-light: #8ba862;
    --bg-white: #ffffff;
    --bg-alt: #f5f7f2;
    --text: #333333;
    --text-light: #666666;
    --radius: 8px;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg-white);
}

a {
    color: var(--green-dark);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--green-mid);
}

img {
    max-width: 100%;
    height: auto;
}

.nowrap {
    white-space: nowrap;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    transition: background var(--transition), box-shadow var(--transition);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-link {
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
    background: var(--bg-alt);
    color: var(--green-mid);
}

.nav-phone {
    background: var(--green-dark);
    color: #fff !important;
    font-weight: 600;
}

.nav-phone:hover {
    background: var(--green-mid) !important;
    color: #fff !important;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--green-dark);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* === Hero === */
.hero {
    position: relative;
    min-height: 100vh;
    /* svh = realna wysokość okna na mobile, bez paska adresu */
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--green-dark) 0%, #2a6b3f 40%, var(--green-mid) 70%, var(--green-light) 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(139, 168, 98, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(92, 138, 60, 0.2) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 2;
    /* 70px navbar + oddech; dół z zapasem na falę (60px) */
    padding: 90px 20px 84px;
    max-width: 660px;
}

/* Logo jest pionowe (320x573), więc limitujemy wysokość,
   nie szerokość — inaczej rozpycha hero w pionie */
.hero-logo {
    max-height: 240px;
    width: auto;
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.hero h1 {
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    line-height: 1.15;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero-sub {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(0.95rem, 1.8vw, 1.08rem);
    line-height: 1.55;
    max-width: 540px;
    margin: 0 auto 26px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 3;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 13px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background: var(--green-dark);
    color: #fff;
    border-color: var(--green-dark);
}

.btn-primary:hover {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(26, 77, 46, 0.3);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

/* === Sections === */
.section {
    padding: 80px 0;
}

.intro {
    background: var(--bg-white);
    padding-top: 56px;
    padding-bottom: 40px;
}

.oferta {
    background: var(--bg-alt);
}

.dostawa {
    background: var(--bg-white);
}

.faq {
    background: var(--bg-alt);
}

.kontakt {
    background: var(--bg-white);
}

/* Karty na jasnym tle sekcji zachowują biel */
.oferta .card,
.dostawa .card {
    background: var(--bg-white);
}

.section-title {
    text-align: center;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--green-dark);
    margin-bottom: 12px;
    font-weight: 700;
}

/* Dekoracyjna kreska pod nagłówkiem sekcji */
.section-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--green-dark), var(--green-light));
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 48px;
    font-size: 1.05rem;
}

.section-cta {
    text-align: center;
    margin-top: 48px;
    font-size: 1.1rem;
    color: var(--green-dark);
    font-weight: 500;
}

/* === Intro === */
.intro-text {
    max-width: 820px;
    margin: 0 auto;
}

.intro-text .section-title {
    margin-bottom: 24px;
}

.intro-text p {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.intro-text strong {
    color: var(--text);
}

.intro-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    list-style: none;
    margin-top: 32px;
}

.intro-badges li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 14px;
    background: var(--bg-alt);
    border: 1px solid #e2e9dc;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--green-dark);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.intro-badges li:hover {
    transform: translateY(-2px);
    border-color: var(--green-light);
    box-shadow: var(--shadow);
}

/* Zielony znacznik "check" przed tekstem */
.intro-badges li::before {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background: var(--green-mid);
    border-radius: 50%;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 11px 11px;
    background-repeat: no-repeat;
    background-position: center;
}

/* === FAQ === */
.faq-list {
    max-width: 820px;
    margin: 0 auto;
}

.faq-item {
    position: relative;
    background: var(--bg-white);
    border: 1px solid #e8ede5;
    border-radius: 14px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow var(--transition),
                border-color var(--transition),
                transform var(--transition);
}

/* Pionowy akcent wysuwający się przy hover i otwarciu */
.faq-item::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--green-dark), var(--green-light));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--transition);
}

.faq-item:hover {
    border-color: #d6e0cc;
    box-shadow: var(--shadow);
}

.faq-item:hover::before,
.faq-item[open]::before {
    transform: scaleX(1);
}

.faq-item[open] {
    border-color: var(--green-light);
    box-shadow: var(--shadow-hover);
}

.faq-item summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
    transition: background var(--transition);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    background: var(--bg-alt);
}

.faq-item summary:focus-visible {
    outline: 2px solid var(--green-mid);
    outline-offset: -3px;
    border-radius: 14px;
}

.faq-question {
    flex: 1;
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.45;
    color: var(--green-dark);
    transition: color var(--transition);
}

/* Ikona plus → minus */
.faq-icon {
    position: relative;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(92, 138, 60, 0.1);
    transition: background var(--transition), transform var(--transition);
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 2px;
    border-radius: 2px;
    background: var(--green-dark);
    transform: translate(-50%, -50%);
    transition: transform var(--transition), background var(--transition), opacity var(--transition);
}

.faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item[open] .faq-icon {
    background: var(--green-dark);
    transform: rotate(180deg);
}

.faq-item[open] .faq-icon::before,
.faq-item[open] .faq-icon::after {
    background: #ffffff;
}

/* Pionowa belka znika → zostaje minus */
.faq-item[open] .faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg) scaleX(0);
    opacity: 0;
}

/* Kontener animowany przez JS (height 0 → auto) */
.faq-answer {
    overflow: hidden;
}

.faq-answer-inner {
    margin: 0 24px;
    padding: 16px 0 22px;
    border-top: 1px solid #eef2ea;
}

.faq-answer-inner p {
    color: var(--text-light);
    font-size: 0.96rem;
    line-height: 1.75;
}

.faq-answer-inner a {
    font-weight: 500;
    border-bottom: 1px solid rgba(92, 138, 60, 0.35);
    transition: border-color var(--transition);
}

.faq-answer-inner a:hover {
    border-bottom-color: var(--green-mid);
}

/* === FAQ CTA === */
.faq-cta {
    max-width: 820px;
    margin: 40px auto 0;
    padding: 32px 24px;
    text-align: center;
    background: var(--bg-white);
    border: 1px dashed #cfdbc4;
    border-radius: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.faq-cta:hover {
    border-color: var(--green-light);
    box-shadow: var(--shadow);
}

.faq-cta p {
    color: var(--text-light);
    margin-bottom: 18px;
    font-size: 1.02rem;
}

/* === Cards Grid === */
.cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.cards-grid .card {
    flex: 0 1 calc((100% - 48px) / 3);
}

.card {
    background: var(--bg-white);
    border: 1px solid #e8ede5;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 20px;
    border-radius: 50%;
    color: var(--green-mid);
    background: rgba(92, 138, 60, 0.08);
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.card:hover .card-icon {
    background: var(--green-dark);
    color: #ffffff;
    transform: scale(1.05);
}

.card h3 {
    font-size: 1.15rem;
    color: var(--green-dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.card p {
    color: var(--text-light);
    font-size: 0.93rem;
    line-height: 1.6;
}

/* === Kontakt Grid === */
.kontakt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 40px;
    align-items: stretch;
}

.kontakt-info h3,
.kontakt-form h3 {
    font-size: 1.3rem;
    color: var(--green-dark);
    margin-bottom: 16px;
    font-weight: 600;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text);
}

.info-item svg {
    flex-shrink: 0;
    color: var(--green-mid);
    margin-top: 2px;
}

.info-item a {
    color: var(--text);
    font-weight: 500;
}

.info-item a:hover {
    color: var(--green-mid);
}

.map-container {
    margin-top: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-container iframe {
    display: block;
}

.map-link {
    margin-top: 10px;
    text-align: right;
    font-size: 0.88rem;
}

.map-link a {
    color: var(--green-mid);
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), color var(--transition);
}

.map-link a:hover {
    color: var(--green-dark);
    border-bottom-color: var(--green-mid);
}

/* === Form === */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.93rem;
    color: var(--text);
}

.form-group textarea {
    resize: none;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid #d0d8ca;
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(92, 138, 60, 0.15);
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: #d32f2f;
}

.form-error {
    display: none;
    color: #d32f2f;
    font-size: 0.82rem;
    margin-top: 4px;
}

.form-error:not(:empty) {
    display: block;
}

.kontakt-form form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kontakt-form form .form-group:last-of-type {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kontakt-form form .form-group:last-of-type textarea {
    flex: 1;
}

.kontakt-form {
    display: flex;
    flex-direction: column;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border: none;
    margin-top: auto;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* === Footer === */
.footer {
    background: var(--green-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 40px 0 24px;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.footer-info p {
    margin-bottom: 6px;
    font-size: 0.93rem;
}

.footer-info a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-info a:hover {
    color: var(--green-light);
}

.footer-area {
    margin-top: 24px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
}

.footer-area-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2px;
}

.footer-copy {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-author {
    margin-top: 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-author a {
    display: inline-flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.footer-author a:hover {
    opacity: 0.8;
}

.footer-author img {
    height: 16px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* === Fade-in animation === */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* FAQ: wejście realizujemy animacją, nie transition — dzięki temu
   transition panelu zostaje wolne dla hover/open i nic się nie opóźnia */
.faq-item.fade-in {
    transition: box-shadow var(--transition), border-color var(--transition);
}

@keyframes faqFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-item.fade-in.visible {
    animation: faqFadeUp 0.6s ease both;
}

/* Schodkowe pojawianie się pytań */
.faq-item.fade-in.visible:nth-child(2) { animation-delay: 0.06s; }
.faq-item.fade-in.visible:nth-child(3) { animation-delay: 0.12s; }
.faq-item.fade-in.visible:nth-child(4) { animation-delay: 0.18s; }
.faq-item.fade-in.visible:nth-child(5) { animation-delay: 0.24s; }

/* Szacunek dla ustawień systemowych */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* === Responsive === */

/* Tablet */
@media (max-width: 1024px) {
    .cards-grid .card {
        flex: 0 1 calc((100% - 24px) / 2);
    }
}

/* Niskie ekrany (laptopy 768px, telefon w poziomie):
   hero musi zmieścić logo + nagłówek + przyciski bez przewijania */
@media (max-height: 760px) {
    .hero-content {
        padding: 84px 20px 74px;
    }

    .hero-logo {
        max-height: 150px;
        margin-bottom: 12px;
    }

    .hero h1 {
        font-size: clamp(1.4rem, 3vw, 1.9rem);
        margin-bottom: 10px;
    }

    .hero-sub {
        margin-bottom: 20px;
    }
}

@media (max-height: 620px) {
    .hero-content {
        padding: 78px 20px 60px;
    }

    .hero-logo {
        max-height: 104px;
        margin-bottom: 10px;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

    .hero-sub {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    .hero-wave svg {
        height: 36px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        padding: 80px 32px 32px;
        gap: 4px;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
        transition: right var(--transition);
        align-items: stretch;
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 1.05rem;
    }

    .hero-content {
        padding: 84px 20px 62px;
    }

    .hero-logo {
        max-height: 150px;
        margin-bottom: 14px;
    }

    .hero h1 {
        font-size: 1.35rem;
        letter-spacing: 1px;
        margin-bottom: 10px;
    }

    .hero-sub {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .hero-wave svg {
        height: 40px;
    }

    .section {
        padding: 50px 0;
    }

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

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 32px;
    }

    .cards-grid .card {
        flex: 0 1 100%;
        padding: 24px 20px;
    }

    .kontakt-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .kontakt-form {
        display: block;
    }

    .kontakt-form form {
        display: block;
    }

    .btn-submit {
        margin-top: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        padding: 12px 24px;
    }

    .footer {
        padding: 32px 0 20px;
    }

    .footer-logo {
        font-size: 1.2rem;
    }

    .section-cta {
        margin-top: 32px;
        font-size: 1rem;
    }

    .intro {
        padding-bottom: 30px;
    }

    .intro-text p {
        font-size: 1rem;
    }

    .intro-badges {
        gap: 8px;
        margin-top: 24px;
    }

    .intro-badges li {
        font-size: 0.85rem;
        padding: 8px 14px 8px 12px;
    }

    .faq-item summary {
        gap: 14px;
        padding: 16px 18px;
    }

    .faq-question {
        font-size: 0.95rem;
    }

    .faq-icon {
        width: 30px;
        height: 30px;
    }

    .faq-answer-inner {
        margin: 0 18px;
        padding: 14px 0 18px;
    }

    .faq-cta {
        margin-top: 28px;
        padding: 24px 18px;
    }

    .card-icon {
        width: 72px;
        height: 72px;
    }
}
