/* Zmienne CSS */
:root {
    --color-dark-blue: #0F1626;
    /* Główny kolor tła */
    --color-dark-gray: #1C2431;
    /* Tła sekcji, kart */
    --color-light-gray: #F5F5F5;
    /* Akcenty, tła */
    --color-primary: #FF6B00;
    /* Pomarańczowy akcent i CTA */
    --color-secondary: #007BFF;
    /* Można użyć dla drugorzędnych akcji */
    --color-text-light: #E0E0E0;
    /* Tekst na ciemnym tle */
    --color-text-dark: #333333;
    /* Tekst na jasnym tle */

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    --max-width: 1200px;
    --padding-section: 80px 0;
    --border-radius-card: 8px;
}

/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text-light);
    background-color: var(--color-dark-blue);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typografia */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text-light);
    margin-bottom: 20px;
}

h1 {
    font-size: 3.2em;
    line-height: 1.2;
}

h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    text-align: center;
}

h3 {
    font-size: 1.8em;
}

p {
    margin-bottom: 15px;
}

a {
    text-decoration: none;
    color: var(--color-primary);
}

a:hover {
    text-decoration: underline;
}

/* Przyciski */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #e05e00;
    /* Ciemniejszy odcień */
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 12px 26px;
    /* Mniejsze paddingi ze względu na border */
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
}

.btn-tertiary {
    /* Dla przycisków w kartach usług */
    background-color: var(--color-dark-blue);
    color: var(--color-primary);
    padding: 10px 20px;
    border-radius: var(--border-radius-card);
    font-size: 0.9em;
    font-weight: 400;
}

.btn-tertiary:hover {
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
}

/* Header */
.main-header {
    background-color: var(--color-dark-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: visible;
    /* Allows dropdowns to show */
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.header-top {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-top .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.logo {
    flex: 0 0 auto;
}

.logo img {
    height: 70px;
    /* Slimmer for one-line layout */
    width: auto;
    transition: height 0.3s ease;
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 20px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav ul li {
    position: relative;
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--color-text-light);
    font-weight: 600;
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease;
    text-decoration: none;
}

.main-nav ul li a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.main-nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-dark-gray);
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius-card);
    padding: 10px 0;
    list-style: none;
    z-index: 1100;
    /* Above regular header elements */
}

.main-nav .submenu li {
    margin: 0;
}

.main-nav .submenu li a {
    padding: 10px 20px;
    color: var(--color-text-light);
    white-space: nowrap;
}

.main-nav .submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-primary);
}

.main-nav ul li:hover>.submenu {
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}


.header-icon {
    color: var(--color-text-light);
    font-size: 1.3em;
    transition: color 0.3s ease;
}

.header-icon:hover {
    color: var(--color-primary);
}

.hamburger {
    display: none;
    /* Ukryte domyślnie, widoczne na mniejszych ekranach */
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px;
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 70vh;
    /* Wysokość pełnoekranowa */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    /* Przyciemnienie tła */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    /* Ograniczenie szerokości tekstu */
}

/* Ensure hero content layout is stable: column with centered items
   so rotating heading won't push the buttons around. */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.hero-content h1 {
    font-size: 3.8em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: block;
    /* reserve block-level space so transforms inside don't reflow siblings */
    position: relative;
    /* Reserve vertical space so rotating text doesn't change layout and push buttons */
    min-height: 120px;
}

.slide-in {
    animation: fadeInOut 5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    20% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

.hero-content p {
    font-size: 1.3em;
    margin-bottom: 40px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

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

/* Keep buttons from shrinking or shifting when heading animates */
.hero-actions {
    flex-shrink: 0;
}

/* Intro/About Section */
.intro-section {
    padding: 60px 0;
    background-color: var(--color-dark-blue);
    text-align: center;
}

.intro-section h2 {
    font-size: 2.2em;
    margin-bottom: 20px;
    color: var(--color-text-light);
}

.intro-section p {
    max-width: 800px;
    margin: 0 auto 30px auto;
    font-size: 1.1em;
    color: var(--color-text-light);
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
}

.feature-item {
    flex: 1;
    min-width: 200px;
}

.feature-item i {
    font-size: 2.5em;
    color: var(--color-primary);
    margin-bottom: 15px;
    display: block;
}

.feature-item h4 {
    font-size: 1.2em;
    color: white;
    margin-bottom: 15px;
}

.feature-item p {
    font-size: 0.9em;
    color: var(--color-text-light);
}

/* Services Overview Section */
.services-overview {
    padding: var(--padding-section);
    background-color: var(--color-dark-blue);
    text-align: center;
}

/* Grid for Index Page (handled by .services-grid in HTML) */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: stretch;
}

/* Grid for Gadzety Page (direct container children) */
.catalogs-list .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: stretch;
}

/* Service Card - Default (Index Page) - Vertical Layout */
.service-card {
    width: 100%;
    background-color: var(--color-dark-gray);
    padding: 30px;
    border-radius: var(--border-radius-card);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    height: 100%;
    /* Ensure full height in grid */
}

/* Service Card - Gadzety Page - Horizontal Layout */
.catalogs-list .service-card {
    flex-direction: row;
    text-align: left;
    gap: 30px;
    justify-content: space-between;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.service-card-info {
    flex: 1;
    /* Zajmuje dostępną przestrzeń */
}

.service-card .icon {
    font-size: 3em;
    color: var(--color-primary);
    margin-bottom: 20px;
    display: block;
    /* Upewnia się, że ikona jest nad tekstem w sekcji info */
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--color-text-light);
}

.service-card p {
    color: var(--color-text-light);
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 0;
    /* Margines kontrolowany przez kontener */
}

.service-card-visual {
    flex: 0 0 200px;
    /* Stała szerokość dla sekcji wizualnej na desktopie */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.service-card-visual img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.service-card-visual img:hover {
    transform: scale(1.05);
}

.service-card-visual .btn {
    width: 100%;
    padding: 10px;
    font-size: 0.9em;
}

/* Responsywność dla kart */
@media (max-width: 600px) {
    .service-card {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }

    .service-card-info {
        width: 100%;
        margin-bottom: 20px;
    }

    .service-card .icon {
        margin-bottom: 15px;
        display: inline-block;
    }

    .service-card-visual {
        width: 100%;
        flex: auto;
        max-width: 250px;
        /* Ograniczenie szerokości obrazka na mobilu */
        margin: 0 auto;
    }
}

/* Footer */
.main-footer {
    background-color: var(--color-dark-blue);
    color: var(--color-text-light);
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
    margin-bottom: 20px;
}

.footer-col h4 {
    font-size: 1.2em;
    margin-bottom: 25px;
    color: white;
    position: relative;
}

.footer-col h4::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--color-primary);
    margin-top: 10px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--color-text-light);
    font-size: 0.95em;
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer-col ul li a:hover {
    color: var(--color-primary);
    padding-left: 5px;
    /* Delikatny efekt najazdu */
}

.footer-col p {
    font-size: 0.95em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-col p i {
    margin-right: 10px;
    color: var(--color-primary);
    font-size: 1.1em;
}

.footer-logo {
    height: 150px;
    margin-bottom: 10px;
}

.social-links a {
    display: inline-block;
    color: white;
    font-size: 1.5em;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85em;
}

.footer-bottom a {
    color: var(--color-text-light);
    text-decoration: underline;
}

.footer-bottom a:hover {
    color: var(--color-primary);
}


/* Responsywność */
@media (max-width: 992px) {
    .main-header .container {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .main-nav {
        flex-basis: 100%;
        order: 3;
        /* Przesuwa menu pod logo i akcje */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }

    .main-nav.active {
        max-height: 80vh;
        /* Better for mobile visibility */
        overflow-y: auto;
        /* Allows scrolling long menus */
        transition: max-height 0.4s ease-in;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        background-color: var(--color-dark-gray);
        padding: 20px 0;
        border-radius: var(--border-radius-card);
        margin-top: 15px;
    }

    .main-nav ul li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main-nav ul li:last-child {
        border-bottom: none;
    }

    .main-nav ul li a {
        padding: 15px 25px;
        color: white;
    }

    .main-nav .submenu {
        position: static;
        /* Submenu staje się częścią flow */
        background-color: var(--color-dark-blue);
        /* Lżejsze tło */
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.3s ease-out, opacity 0.3s;
    }

    .main-nav li.active-submenu .submenu {
        max-height: 1000px;
        /* High enough for all sub-items */
        opacity: 1;
        visibility: visible;
        transition: max-height 0.4s ease-in, opacity 0.4s;
    }

    .main-nav .submenu li a {
        padding-left: 45px;
        /* Wcięcie dla elementów submenu */
    }

    .header-actions {
        order: 2;
        /* Akcje obok hamburgera */
        gap: 10px;
    }

    .header-actions .btn-primary {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .hamburger {
        display: block;
        order: 1;
        /* Hamburger po prawej, lub obok logo */
    }

    .hero-content h1 {
        font-size: 2.5em;
        /* smaller screens: reduce reserved height */
        min-height: 80px;
    }

    .hero-content p {
        font-size: 1.1em;
    }

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

    .btn {
        width: 80%;
        /* Przyciski na hero full width */
        max-width: 300px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .catalogs-list .container {
        grid-template-columns: 1fr;
    }

    .catalogs-list .service-card {
        flex-direction: column;
        text-align: center;
    }

    .footer-col {
        min-width: unset;
        width: 100%;
        text-align: center;
    }

    .footer-col h4::after {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-col p {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.8em;
    }

    h2 {
        font-size: 2em;
    }

    .hero-section {
        height: 60vh;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }

    .hero-content h1 {
        /* smallest screens - keep a reasonable reserved height */
        min-height: 60px;
    }

    h2 {
        font-size: 1.8em;
    }

    .hero-content p {
        font-size: 1em;
    }

    .hero-section {
        height: 50vh;
    }

    .main-header .container {
        padding: 0 15px;
    }

    .header-actions .btn-primary {
        display: none;
        /* Ukryj przycisk "Wycena" na najmniejszych ekranach, zostaw ikony */
    }

    .main-header .header-actions {
        gap: 5px;
    }
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switcher a {
    display: flex;
    align-items: center;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    line-height: 0;
}

.lang-switcher img {
    display: block;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.lang-switcher a:hover {
    background: rgba(255, 107, 0, 0.1);
    transform: translateY(-1px);
}

.lang-switcher a.active {
    background: rgba(255, 107, 0, 0.15);
    border-color: var(--color-primary);
}

.lang-switcher a.active img {
    transform: scale(1.1);
}

@media (max-width: 992px) {
    .lang-switcher {
        margin-right: 10px;
        gap: 5px;
    }
}