/* ================================= 
   OPŠTI STILOVI ZA STRANICE PROIZVODA
   ================================= */
body {
    background-color: #fff;
}

/* ================================= 
   STRANICA KATEGORIJE (npr. specijalni-hlebovi.html)
   ================================= */

/* --- Hero sekcija --- */
.hero-section-proizvodi {
    height: 50vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;

}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);

}

.hero-content {
    position: relative;
    z-index: 2;
    top: 0;
    padding-bottom: 50px;

}

.hero-content h1 {
    font-size: 3.5rem;
    font-family: 'Playfair Display', serif;
}

.hero-content p {
    font-size: 1.4rem;
}

/* --- Uvodni tekst --- */
.kategorija-uvod {
    padding: 60px 20px;
    text-align: center;
    background-color: #f9f9f9;
}

.kategorija-uvod h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.kategorija-uvod p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

/* --- Legenda ikonica --- */
.legenda-section {
    padding: 30px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #e7e7e7;
}

.legenda-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px 40px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legenda-item img {
    width: 24px;
    height: 24px;
}

.legenda-item span {
    font-size: 0.9rem;
    color: #777;
}

/* --- Grid proizvoda i kartice --- */
.proizvodi-grid-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.proizvodi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.proizvod-kartica {
    background-color: #fff;
    border: 1px solid #eee;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.proizvod-kartica:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.kartica-slika-wrapper {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.kartica-slika-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.4s ease-in-out;
}

.slika-osnovna {
    z-index: 1;
}

.slika-hover {
    z-index: 2;
    opacity: 0;
}

.kartica-slika-wrapper:hover .slika-hover {
    opacity: 1;
}

.proizvod-kartica h3 {
    font-size: 1.4rem;
    margin: 20px 15px 10px 15px;
}

.proizvod-kartica .kartica-opis {
    font-size: 1rem;
    color: #666;
    margin: 0 15px 15px 15px;
    flex-grow: 1;
}

.proizvod-kartica .kartica-ikonice {
    margin-bottom: 20px;
}

.proizvod-kartica .kartica-ikonice img {
    width: 32px;
    height: 32px;
    margin: 0 5px;
}

.kartica-dugmici-wrapper {
    display: flex;
    margin-top: auto;
}

.details-btn {
    flex: 1;
    /*background-color: #333;*/
    background-color: #2c3e50;
    color: #fff;
    border: none;
    padding: 15px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.kartica-dugmici-wrapper .details-btn:first-child:not(:last-child) {
    border-right: 1px solid #555;
}

.details-btn:hover {
    background-color: #e74c3c;
}

/* ================================= 
   MODALNI PROZORI (OPŠTI STILOVI)
   ================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: #fff;
    width: 80%;
    max-width: 900px;
    padding: 30px 40px;
    border-radius: 5px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    z-index: 10;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-content {
    display: flex;
    gap: 30px;
    overflow-y: auto;
    padding-right: 15px;
    align-items: flex-start;
}

/* ================================= 
   STILOVI ZA "BRZI PREGLED" MODAL
   ================================= */
.quickview-modal {
    max-width: 800px;
    padding: 20px;
}

.quickview-modal .modal-content {
    gap: 20px;
    align-items: center;
    align-items: flex-start;
}

/* --- Galerija u "Brzi pregled" modalu --- */
.quickview-image-gallery {
    flex-basis: 45%;
    position: relative;
    min-width: 0;
}

.quickview-modal .swiper {
    width: 100%;
    height: 350px;
    border-radius: 4px;
}

.quickview-modal .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
}

.quickview-modal .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quickview-modal .swiper-button-next,
.quickview-modal .swiper-button-prev {
    color: #333;
    --swiper-navigation-size: 28px;
}

.quickview-modal .swiper-button-next:hover,
.quickview-modal .swiper-button-prev:hover {
    color: #e74c3c;
}

.quickview-modal .swiper-pagination-bullet-active {
    background-color: #e74c3c;
}

/* --- Informacije u "Brzi pregled" modalu --- */
.quickview-info {
    flex-basis: 55%;
    padding-left: 20px;
}

.quickview-info .naziv-proizvoda {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.quickview-opis {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.quickview-ikonice {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.quickview-ikonice img {
    width: 40px;
    height: 40px;
}

.quickview-sastojci {
    font-size: 1rem;
    color: #333;
    margin-bottom: 25px;
}

.quickview-sastojci strong {
    font-weight: 700;
}

.quickview-cta-btn {
    display: inline-block;
    background-color: #333;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.quickview-cta-btn:hover {
    background-color: #e74c3c;
}

/* ==================================================== */
/* STILOVI ZA STRANICU POJEDINAČNOG PROIZVODA          */
/* ==================================================== */
.product-page-main {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

/* --- Sekcija 1: Osnovne informacije --- */
.product-detail-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* --- Galerija na stranici proizvoda --- */
.product-gallery {
    position: relative;
}

.product-page-main .swiper.product-page-swiper {
    width: 100%;
    height: 500px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.product-page-main .product-page-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
}

.product-page-main .product-page-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-page-main .product-page-swiper .swiper-button-next,
.product-page-main .product-page-swiper .swiper-button-prev {
    color: #333;
    --swiper-navigation-size: 32px;
}

.product-page-main .product-page-swiper .swiper-button-next:hover,
.product-page-main .product-page-swiper .swiper-button-prev:hover {
    color: #e74c3c;
}

.product-page-main .product-page-swiper .swiper-pagination-bullet-active {
    background-color: #e74c3c;
}

/* --- Informacije na stranici proizvoda --- */
.product-info .breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.product-info .breadcrumbs li {
    font-size: 0.9rem;
    color: #777;
}

.product-info .breadcrumbs li:not(:last-child)::after {
    content: '>';
    margin: 0 8px;
    color: #ccc;
}

.product-info .breadcrumbs a {
    color: #555;
    text-decoration: none;
}

.product-info .breadcrumbs a:hover {
    text-decoration: underline;
}

.product-info .product-title {
    font-size: 2rem;
    margin: 0 0 15px 0;
}

.product-info .product-short-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 25px;
}

.product-info .product-features-icons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.product-info .product-features-icons img {
    width: 48px;
    height: 48px;
}

.product-info .product-cta .cta-button {
    display: inline-block;
    background-color: #333;
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    margin-right: 15px;
}

.product-info .product-cta .cta-button:hover {
    background-color: #e74c3c;
}

.product-info .product-cta .cta-link {
    font-size: 1rem;
    color: #555;
    text-decoration: underline;
}

/* ================================= 
   ZAJEDNIČKI STILOVI ZA TABOVE I NUTR. TABELU
   ================================= */
.tab-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.tab-link:hover {
    color: #333;
}

.tab-link.active {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

.tab-content-wrapper {
    position: relative;
    overflow: hidden;
    transition: height 0.85s ease-in-out;
}

.tab-panel {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    padding-bottom: 20px;
}

.tab-panel.active {
    opacity: 1;
    visibility: visible;
    position: static;
}

.tab-panel p,
.tab-panel ul {
    line-height: 1.6;
    color: #555;
}

.tab-panel h3,
.tab-panel h4 {
    margin-top: 0;
}

.tab-panel ul {
    padding-left: 20px;
}

.nova-nutritivna-tabela {
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    text-align: left;
}

.nova-tabela-header {
    width: 100%;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    background-color: #f0f0f0;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    padding: 8px;
    text-align: left;
    box-sizing: border-box;
}

.nova-tabela-sadrzaj {
    width: 100%;
    box-sizing: border-box;
}

.nova-tabela-red {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.nova-tabela-red:last-child {
    border-bottom: none;
}

.nova-tabela-opis {
    flex: 1;
}

.nova-tabela-vrednost {
    width: 100px;
    text-align: left;
    font-weight: 700;
}

.nova-tabela-opis.bold {
    font-weight: 700;
}

.nova-tabela-opis.ugnjezden {
    padding-left: 20px;
    font-weight: 400;
    color: #444;
}

.nova-tabela-vrednost.ugnjezden {
    font-weight: 400;
}

/* === DODATO ZA ZBIJENIJI TEKST U SASTOJCIMA === */
#tab-sastojci p {
    margin-top: 0;
    margin-bottom: 6px;
    /* Smanjuje razmak ispod svakog pasusa */
    line-height: 1.5;
    /* Malo smanjuje prored unutar samog pasusa */
}

#tab-sastojci p:last-child {
    margin-bottom: 0;
}

/* === KRAJ DODATKA === */

/* Vizuelno obogaćivanje stavki liste unutar bilo kog taba */
.tab-panel ul {
    list-style-type: none;
    /* Uklanjamo standardne tačkice */
    padding-left: 0;
}

.tab-panel li {
    padding-left: 25px;
    /* Pravimo prostor za ikonicu */
    position: relative;
    margin-bottom: 8px;
    /* Mali razmak između stavki */
}

.tab-panel li::before {
    content: '\f00c';
    /* Font Awesome Unicode za kvačicu (check) */
    font-family: 'Font Awesome 6 Free';
    /* Obavezno navesti Font Awesome porodicu */
    font-weight: 900;
    /* Za solid ikonice */
    position: absolute;
    left: 0;
    top: 2px;
    color: #e74c3c;
    /* Tvoja glavna boja */
    font-size: 0.9rem;
}

/* Stilovi za ikonice unutar linkova tabova */
.tab-link {
    display: flex;
    /* Omogućava lako poravnanje ikonice i teksta */
    align-items: center;
    gap: 8px;
    /* Razmak između ikonice i teksta */
}

.tab-link i {
    transition: transform 0.95s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    /* Glatka tranzicija za rotaciju sa "bounce" efektom */
    font-size: 1rem;
    color: #aaa;
    /* Malo svetlija boja za neaktivnu ikonicu */
}

.tab-link:hover i {
    transform: rotate(360deg);
    /* Rotacija na hover */
    color: #555;
    /* Tamnija boja na hover */
}

.tab-link.active i {
    color: #e74c3c;
    /* Boja aktivne ikonice */
    transform: scale(1.1);
    /* Opciono: malo uvećaj aktivnu ikonicu */
}

.elegant-line {
    border: 0;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.2);
    /* Jednostavna, polu-providna siva boja */
    margin: 5px 0;
    /* Dodaje malo razmaka iznad i ispod linije */
}

/* Stilovi za sekciju sa alergenima */
.allergen-section {
    margin-top: 20px;
    display: flex;
    /* KLJUČNA PROMENA: Postavlja elemente u red */
    align-items: center;
    /* Vertikalno centrira naslov i ikonice */
    gap: 12px;
    /* Pravi razmak između naslova i prve ikonice */
}

.allergen-title {
    margin-bottom: 0;
    /* Uklanjamo donju marginu jer nam više ne treba */
    font-size: 1em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    /* Sprečava prelamanje teksta "Alergeni:" */
}

.allergen-container {
    display: flex;
    flex-wrap: wrap;
    /* Omogućava prelamanje bedževa u novi red */
    gap: 10px;
    /* Razmak između bedževa */
}

.allergen-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Centriramo ikonicu horizontalno */

    /* Pravimo kružić oko ikonice */
    width: 32px;
    height: 32px;
    padding: 0;
    /* Uklanjamo padding koji nam ne treba više */

    border: 1px solid #e0e0e0;
    border-radius: 50%;
    /* Pravi savršen krug */
    background-color: #fdfdfd;
    transition: all 0.2s ease;
    cursor: help;
    /* Menjamo kursor da sugeriše da ima dodatnih informacija */
}

/* Hover efekat */
.allergen-pill:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    transform: scale(1.1);
    /* Malo uvećamo krug na hover */
}

/* Stil za ikonicu unutar kruga */
.allergen-pill img {
    width: 18px;
    /* Malo veća da bolje popuni krug */
    height: 18px;
    margin-right: 0;
    /* Više nam ne treba margina */
}

/* ================================= 
   SEKCIJA POVEZANIH PROIZVODA
   ================================= */
.related-products-section {
    margin-top: 60px;
}

.related-products-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
}

#tab-logistika ol li::before {
    content: none !important;
    /* Uklanja crveni štikl */
}

/* ================================= 
   RESPONSIVE DIZAJN
   ================================= */
@media (max-width: 900px) {
    .proizvodi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .product-detail-section {
        grid-template-columns: 1fr;
    }

    .product-title {
        font-size: 2.2rem;
    }

    .related-products-section .proizvodi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .proizvodi-grid {
        grid-template-columns: 1fr;
    }

    .related-products-section .proizvodi-grid {
        grid-template-columns: 1fr;
    }
}

/* =================================
   MOBILNA OPTIMIZACIJA ZA KATEGORIJE (proizvodi.css) - BEZ BRZOG PREGLEDA
   ================================= */

@media (max-width: 768px) {

    /* Prilagođavanje hero sekcije na mobilnim telefonima */
    .hero-section-proizvodi {
        height: auto !important;
        min-height: 40vh;
        padding: 60px 20px !important;
    }

    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 1.1rem !important;
    }

    /* SAKRIVAMO "Brz pregled" dugme na mobilnim i tablet ekranima */
    .kartica-dugmici-wrapper button.details-btn {
        display: none !important;
    }

    /* "Detalji" dugme širimo preko cele kartice za lakši dodir */
    .kartica-dugmici-wrapper a.details-btn {
        width: 100% !important;
        flex: none !important;
        border-right: none !important;
    }

    /* Pretvaramo navigaciju tabova u horizontalni skrol na mobilnom */
    .tab-nav {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        /* Omogućava horizontalni skrol */
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        /* Tečan skrol na iOS uređajima */
        border-bottom: 1px solid #ddd;
        padding-bottom: 2px;
        scrollbar-width: none;
        /* Sakriva scrollbar na Firefox-u */
    }

    /* Sakriva scrollbar za Chrome, Safari i Operu */
    .tab-nav::-webkit-scrollbar {
        display: none;
    }

    /* Sprečavamo sabijanje dugmića u tab navigaciji */
    .tab-link {
        flex: 0 0 auto !important;
        /* Dugmad zadržavaju svoju prirodnu širinu */
        padding: 10px 15px !important;
        font-size: 0.9rem !important;
    }

    /* Prilagođavanje breadcrumbs-a na mobilnom */
    .product-info .breadcrumbs ol {
        list-style-type: none !important;
        /* Uklanja decimalne brojeve (1, 2, 3) */
        padding-left: 0 !important;
    }
}