/* Osnovni reset i fontovi */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    color: #4a4a4a;
    background-color: #fdfaf6;
    overflow-x: hidden; /* Glavni pokušaj sprječavanja horizontalnog scrolla */
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #333;
    font-weight: 700;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto; /* Centriranje containera */
    padding: 0 20px;
}

/* Header */
header {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: top 0.3s;
    width: 100%; /* Osiguraj da header ne bude širi od viewporta */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Da se container unutar headera proteže pravilno */
}

#logo {
    /* Nema potrebe za specifičnom širinom ako se flex ponaša kako treba */
}

#logo h1 {
    margin: 0;
    font-size: 2em;
}
#logo a {
    text-decoration: none;
    color: #333;
}
#logo .highlight {
    color: #e5a991;
}
#logo .tagline {
    font-size: 0.8em;
    color: #777;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
}

nav {
    /* Nema potrebe za specifičnom širinom ako se flex ponaša kako treba */
}
nav ul {
    list-style: none;
    display: flex;
    align-items: center; /* Vertikalno poravnanje linkova */
}
nav ul li {
    margin-left: 25px;
}
nav ul li:first-child {
    margin-left: 0; /* Prvi link nema lijevi margin */
}
nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 400;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap; /* Sprječava prelamanje teksta linka */
}
nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e5a991;
    transition: width 0.4s ease;
}
nav ul li a:hover,
nav ul li a.active {
    color: #e5a991;
}
nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* Hero Sekcija */
.hero {
    height: 90vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background-size: cover;
    background-position: center;
    position: relative;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('/Slike/HeaderSlika.jpg');
    animation: heroBackgroundPan 25s linear infinite alternate;
}

@keyframes heroBackgroundPan {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.hero-content {
    z-index: 1;
    animation: fadeInText 1.5s ease-out forwards;
}
@keyframes fadeInText {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h2 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}
.hero p {
    font-size: 1.3em;
    margin-bottom: 30px;
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}
.button {
    display: inline-block;
    background: #e5a991;
    color: #fff;
    padding: 14px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 169, 145, 0.3);
    border: none;
    cursor: pointer;
}
.button:hover {
    background-color: #d9937a;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(229, 169, 145, 0.5);
}

/* Opće sekcije */
section {
    padding: 80px 0;
}
section h2 {
    text-align: center;
    font-size: 2.8em;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 15px;
}
section h2::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: #e5a991;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* O Nama Sekcija */
#o-nama p {
    font-size: 1.1em;
    text-align: center;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Usluge Sekcija */
.usluge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}
.usluga-item {
    background: #fff;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}
.usluga-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.usluga-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
    color: #e5a991;
}
.usluga-item h3 {
    font-size: 1.6em;
    margin-bottom: 10px;
    color: #4a4a4a;
}

/* Galerija Sekcija */
#galerija { background-color: #fff; }

.gallery-slider-container {
    position: relative;
    width: 100%; /* Osigurava da ne bude širi od roditeljskog containera */
    overflow: hidden; /* Ključno za sakrivanje slika izvan vidokruga */
}

.gallery-grid-slider {
    display: grid; /* Default za desktop */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    transition: transform 0.4s ease-in-out; /* Za mobilni slider */
    /* Na mobitelu, JS će promijeniti display u flex */
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden; /* Da zaobljeni rubovi od .gallery-item režu sliku */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* border-radius nasljeđuje od .gallery-item ako .gallery-item ima overflow:hidden */
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery-item:hover::before {
    opacity: 1;
}

.slider-btn {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 15px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}
.slider-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.8);
}
.slider-btn:disabled {
    opacity: 0.3;
    cursor: default;
    background-color: rgba(0, 0, 0, 0.4);
}
.prev-btn {
    left: 10px;
}
.next-btn {
    right: 10px;
}

/* Kontakt Sekcija */
#kontakt {
    background-color: #fdfaf6;
}
.kontakt-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}
.kontakt-info {
    flex: 1;
    min-width: 280px;
}
.kontakt-info h3 {
    font-size: 1.4em;
    color: #e5a991;
    margin-top: 20px;
    margin-bottom: 8px;
}
.kontakt-info p {
    margin-bottom: 10px;
    line-height: 1.8;
}
.kontakt-info a {
    color: #4a4a4a;
    text-decoration: none;
    transition: color 0.3s ease;
}
.kontakt-info a:hover {
    color: #e5a991;
}
.map-container {
    flex: 1.2;
    min-width: 280px;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer */
footer {
    background: #333;
    color: #f1f1f1;
    padding: 40px 0 20px 0;
    margin-top: 50px;
    font-size: 0.9em;
}
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
    margin-bottom: 20px;
}
.footer-info {
    flex-basis: 55%;
    text-align: left;
}
.footer-info p {
    margin-bottom: 8px;
    line-height: 1.6;
}
.footer-info a {
    color: #e5a991;
    text-decoration: none;
}
.footer-info a:hover {
    text-decoration: underline;
}
.footer-social {
    flex-basis: 35%;
    text-align: right;
}
.footer-social p {
    margin-bottom: 10px;
    font-weight: 600;
}
.social-icon {
    width: 30px;
    height: 30px;
    margin-left: 10px;
    vertical-align: middle;
    color: #e5a991;
    stroke: currentColor;
    transition: color 0.3s ease, transform 0.3s ease;
}
.social-icon:hover {
    color: #fff;
    transform: scale(1.1);
}
.footer-copyright {
    text-align: center;
    font-size: 0.85em;
}
.footer-copyright p {
    margin-bottom: 5px;
}

/* Animacije na scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible,
.usluga-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsivnost */
@media (max-width: 992px) { /* Tablet i veći mobiteli */
    .hero h2 { font-size: 2.8em; }
    .hero p { font-size: 1.1em; }
    section h2 { font-size: 2.4em; }
    .map-container { height: 350px; }

    /* Prilagodba headera za tablete ako je potrebno */
    nav ul li {
        margin-left: 15px; /* Manji razmak između linkova */
    }
}

@media (max-width: 768px) { /* Mobiteli */
    .container {
        width: 95%; /* Malo širi container na mobitelu */
        padding: 0 15px;
    }
    
    header .container {
        flex-direction: column;
        align-items: center;
    }
    #logo {
        margin-bottom: 15px; /* Manji margin */
        text-align: center;
        width: 100%;
    }
    #logo h1 {
        font-size: 1.8em; /* Malo manji logo */
    }
    nav {
        width: 100%;
        overflow: hidden;
    }
    nav ul {
        padding: 0;
        list-style: none; /* Eksplicitno ukloni list-style ako nije već */
        display: flex;
        flex-wrap: wrap; /* KLJUČNO: Ovo MORA prelomiti iteme */
        justify-content: center; /* Centriraj prelomljene iteme */
        align-items: center;
        width: 100%; /* Lista mora biti 100% da bi se itemi prelamali unutar nje */
        margin: 0;
    }
    nav ul li {
        margin: 5px; /* Jednak margin svuda oko linkova */
    }
    nav ul li a {
        padding: 8px 12px; /* Prilagodi padding da ne bude preširoko */
        font-size: 0.9em;
        white-space: normal; /* DOZVOLI PRELAMANJE TEKSTA UNUTAR LINKA ako je potrebno */
        text-align: center; /* Centriraj tekst unutar linka */
        display: inline-block; /* Malo manji font linkova */
    }

    .hero { height: auto; min-height: 70vh; padding: 60px 0; } /* Fleksibilnija visina */
    .hero h2 { font-size: 2em; }
    .hero p { font-size: 1em; }

    section { padding: 60px 0; }
    section h2 { font-size: 2em; margin-bottom: 40px; }
    
    /* Galerija na mobitelu postaje slider */
    .gallery-slider-container {
        /* width: 100% i overflow:hidden su već globalno definirani za ovaj element */
    }

    .gallery-grid-slider {
        display: flex;
    }

    .gallery-item {
        flex: 0 0 88%;
        margin-right: 12px;
    }
    .gallery-item:last-child {
        margin-right: 0;
    }
    .gallery-item img {
        height: 450px; 
        object-fit: cover;
        display: block;
        border-radius: 6px;
    }

    .slider-btn {
        display: block;
        padding: 12px; /* Vraćeno na originalni padding ako je 15px preveliko */
        font-size: 24px;
    }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }


    .kontakt-flex { flex-direction: column; }
    .kontakt-info, .map-container {
        width: 100%;
        flex-basis: auto;
    }
    .map-container { height: 300px; margin-top: 20px; }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-info, .footer-social {
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    .footer-social p { margin-top: 10px; }
    .social-icon { margin: 0 8px; }
}

@media (max-width: 480px) { /* Manji mobiteli */
    #logo h1 {
        font-size: 1.6em;
    }
    .hero h2 {
        font-size: 1.8em;
    }
    .hero p {
        font-size: 0.9em;
    }
    nav ul li a {
        font-size: 0.85em; /* Još manji font linkova */
        padding: 6px 8px;
    }
    .gallery-item {
        flex: 0 0 90%; /* Možda malo širi prikaz na jako malim ekranima */
        margin-right: 10px;
    }
    .gallery-item img {
        height: 380px; /* Prilagodi visinu za jako male ekrane */
    }
}