﻿/* ================================
   Offer Section (Vina + Hrana)
   ================================ */

/* Puna širina sekcije (prebijamo Bootstrap container) */
#offer-section .container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.offer-section {
    --radius: 18px;
    --gap: 24px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .08);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, .14);
    width: 100%;
    margin: 0;
    padding: 2.2rem 3vw;
}

/* Mobile padding reduction */
@media (max-width: 767.98px) {
    .offer-section {
        padding: 1rem 0.75rem;
    }

    .offer-subtitle {
        margin: 0 0 0.75rem 0;
        font-size: 1.3rem;
    }
}

.offer-subtitle {
    font-weight: 800;
    letter-spacing: .3px;
    margin: 0 0 1.1rem 3vw;
    font-size: 1.6rem;
}

/* GRID – šire kartice, full width */
/* GRID – Default Desktop (>1600px) */
.offer-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--gap);
    align-items: stretch;
    width: 100%;
    position: relative;
    /* Za pozicioniranje strelica */
    scroll-behavior: smooth;
}

/* LAPTOP MODE (1200px - 1599px) -> SLIDER */
@media(max-width: 1599.98px) {
    .offer-row {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 10px;
        /* Prostor za scrollbar ako je vidljiv */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox - sakrij scrollbar */
    }

    .offer-row::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari - sakrij scrollbar */
    }

    .offer-row>* {
        flex: 0 0 calc(25% - var(--gap));
        /* 4 kartice vidljive */
        scroll-snap-align: start;
        min-width: 260px;
        /* Da se ne skupe previše */
    }
}

/* TABLET MODE (768px - 1199px) -> GRID 2x3 */
@media(max-width: 1199.98px) {
    .offer-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        overflow-x: visible;
        /* Isključi scroll */
    }
}

/* MOBILE MODE (<768px) -> SLIDER (1 card + peek) */
@media(max-width: 767.98px) {
    .offer-row {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-right: 15%;
        /* Peek effect space */
    }

    .offer-row>* {
        flex: 0 0 85%;
        /* 1 kartica + malo sledeće */
        scroll-snap-align: center;
        /* Centriraj aktivnu karticu */
    }
}

.offer-wrapper {
    position: relative;
    width: 100%;
}

/* NAVIGATION ARROWS (Laptop Only) - Isolated with .offer-wrapper */
.offer-wrapper .nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 1.3rem;
    color: #111;
}

.offer-wrapper .nav-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Show arrows on hover over the section wrapper */
.offer-wrapper:hover .nav-arrow {
    opacity: 1;
    pointer-events: auto;
}

.offer-wrapper .nav-prev {
    left: 20px;
}

.offer-wrapper .nav-next {
    right: 20px;
}

/* Hide arrows on non-laptop screens - Isolated with .offer-wrapper */
@media(min-width: 1600px), (max-width: 1199.98px) {
    .offer-wrapper .nav-arrow {
        display: none !important;
    }
}


/* =========================
   FLIP KARTICA – Finalna verzija
   ========================= */
.flip-card {
    perspective: 1000px;
    height: 100%;
}

.flip-inner {
    /* RESET STILOVA ZA DUGME */
    display: block;
    border: none;
    background: transparent;
    padding: 0;
    font-family: inherit;
    /* Nasleđuje font od ostatka stranice */
    text-align: left;
    /* Vraća poravnanje teksta na levo */
    /* ORIGINALNI STILOVI */
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.35s ease;
    cursor: pointer;
    outline: none;
}

/* Stil za fokus, sada radi ispravno na dugmetu */
.flip-inner:focus-visible {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .45), var(--shadow-hover);
}

@media(hover:hover) and (pointer:fine) {
    .flip-card:hover .flip-inner {
        box-shadow: var(--shadow-hover);
    }
}

.flip-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: #ffffff;
    /* Eksplicitno postavljena bela pozadina */
    color: #111;
    border-radius: var(--radius);
    overflow: hidden;
}

.flip-face.front {
    /* Prednja strana je u početnom položaju */
}

.flip-face.back {
    transform: rotateY(180deg);
}

/* Flip stanje */
.flip-card.is-flipped .flip-inner {
    transform: rotateY(180deg);
}


/* FRONT raspored */
.front-img {
    height: 80%;
    overflow: hidden;
}

.front-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

@media(hover:hover) and (pointer:fine) {
    .flip-card:hover .front-img img {
        transform: scale(1.04);
    }
}

.front-body {
    flex-grow: 1;
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.front-title {
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.front-meta {
    font-size: .94rem;
    color: #6c757d;
    margin: 0;
}

.front-price {
    font-weight: 700;
    margin: 0;
}


/* BACK raspored */
.flip-face.back {
    padding: 20px 22px;
    justify-content: space-between;
}

.back-title {
    font-size: 1.04rem;
    font-weight: 800;
    margin: 0;
}

.back-meta {
    font-size: .94rem;
    color: #6c757d;
    margin: 0;
}

.back-desc {
    flex-grow: 1;
    font-size: .96rem;
    line-height: 1.55;
    color: #222;
    margin: 10px 0;
    overflow-y: auto;
    /* Scroll ako je tekst predugačak */
}

.back-price {
    font-weight: 700;
    margin: 0;
}