@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #62795d;
    --secondary-color: #4b5d47;
    --dark-bg: #2C3E50;
    --light-bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-color: #333;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- NAVBAR --- */
.navbar-custom {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar-logo {
    height: 50px;
    width: auto;
    display: block;
}

.nav-link {
    font-weight: 600;
    color: var(--text-color) !important;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
}

/* --- HERO SECTION --- */
.hero-section {
    padding: 120px 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9), rgba(98, 121, 93, 0.8)), url('uploads/hero-bg.jpg') center/cover;
    color: white;
    text-align: center;
    border-radius: 0 0 50px 50px;
    margin-bottom: 60px;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

/* --- CARDS --- */
.card-custom {
    border: none;
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.icon-box {
    width: 70px;
    height: 70px;
    background: rgba(98, 121, 93, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
    transition: all 0.3s;
}

.card-custom:hover .icon-box {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* --- BOTTONI --- */
.btn-primary-custom {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50px;
    padding: 12px 35px;
    border: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary-custom:hover {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(98, 121, 93, 0.4);
    transform: translateY(-2px);
}

.btn-outline-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50px;
    padding: 10px 30px;
    font-weight: 600;
    transition: all 0.3s;
    background: transparent;
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: white;
}
/* --- INSTAGRAM SLIDER INFINITO --- */
.insta-slider {
    background: white;
    overflow: hidden;
    position: relative;
    padding: 60px 0;
    border-top: 1px solid #eee;
}

.insta-track {
    display: flex;
    /* 250px di larghezza * 32 foto (16 originali + 16 cloni per il loop continuo) */
    width: calc(250px * 32); 
    animation: scroll 40s linear infinite;
}

.insta-slide {
    width: 250px;
    padding: 0 10px;
    flex-shrink: 0;
}

.insta-slide img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    aspect-ratio: 1/1; /* Forza sempre un formato quadrato */
    object-fit: cover;
}

.insta-slide img:hover {
    transform: scale(1.05);
    cursor: pointer;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-250px * 16)); } /* Scorre l'esatta larghezza delle prime 16 foto */
}

/* --- DOGSPORTAL ARTICOLI A SCORRIMENTO --- */
.dogsportal-articles-section {
    overflow: hidden;
}
.dogsportal-articles-track-wrapper {
    overflow: hidden;
    margin: 0 -0.5rem;
}
.dogsportal-articles-track {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0 1rem;
    animation: dogsportal-scroll 50s linear infinite;
    width: max-content;
}
.dogsportal-articles-track:hover {
    animation-play-state: paused;
}
.dogsportal-article-card {
    flex: 0 0 320px;
    max-width: 320px;
    padding: 1.25rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(98, 121, 93, 0.15);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.25s, box-shadow 0.25s;
}
.dogsportal-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(98, 121, 93, 0.15);
    color: inherit;
}
.dogsportal-card-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}
.dogsportal-article-card h3 {
    line-height: 1.35;
    font-size: 1rem;
}
@keyframes dogsportal-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- BANNER COOKIE --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--dark-bg);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transition: transform 0.35s ease, opacity 0.35s ease;
}
.cookie-banner--hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}
.cookie-banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cookie-banner-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.95);
    flex: 1;
    min-width: 260px;
}
.cookie-banner-link {
    color: var(--primary-color);
    text-decoration: underline;
    white-space: nowrap;
}
.cookie-banner-link:hover {
    color: #8fa88a;
    color: rgba(255,255,255,0.9);
}
.cookie-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.cookie-btn-accept {
    background: var(--primary-color) !important;
    color: #fff !important;
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}
.cookie-btn-accept:hover {
    background: var(--secondary-color) !important;
    color: #fff !important;
    transform: translateY(-1px);
}
.cookie-btn-reject {
    background: transparent !important;
    color: rgba(255,255,255,0.85) !important;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}
.cookie-btn-reject:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.7);
}

/* ========== RESPONSIVE - MOBILE FIRST ========== */

/* Tablet e sotto */
@media (max-width: 991px) {
    .navbar-custom {
        padding: 0.75rem 0;
    }
    /* Banner verdi pagine interne */
    section[style*="background-color: var(--primary-color)"] .container {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    section[style*="background-color: var(--primary-color)"] h1 {
        font-size: 1.75rem !important;
    }
    section[style*="background-color: var(--primary-color)"] .lead {
        font-size: 1rem !important;
    }
    .navbar-logo {
        height: 44px;
    }
    .hero-section {
        padding: 80px 0;
        margin-bottom: 40px;
        border-radius: 0 0 40px 40px;
    }
    .hero-section h1 {
        font-size: 2.25rem;
        margin-bottom: 16px;
    }
    .hero-section .lead {
        font-size: 1.1rem !important;
    }
    section.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    .container.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    h2.display-6, .display-6 {
        font-size: 1.75rem;
    }
    .insta-slider {
        padding: 40px 0;
    }
    .insta-slider .container.mb-4 {
        margin-bottom: 1.5rem !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .navbar-logo {
        height: 40px;
    }
    .navbar-custom .navbar-collapse {
        background: var(--card-bg);
        margin: 0.75rem -0.5rem -0.75rem;
        padding: 0.5rem 0.5rem 1rem;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }
    .nav-link {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .navbar-nav .btn-primary-custom {
        min-height: 44px;
        justify-content: center;
        margin-top: 0.25rem;
    }
    .hero-section {
        padding: 60px 0 50px;
        margin-bottom: 2rem;
        border-radius: 0 0 30px 30px;
    }
    .hero-section h1 {
        font-size: 1.85rem;
        margin-bottom: 12px;
        line-height: 1.25;
    }
    .hero-section .lead {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    .hero-section .d-flex.flex-column.flex-sm-row .btn,
    .hero-section .d-flex.flex-column.flex-sm-row .btn-primary-custom {
        width: 100%;
        text-align: center;
        min-height: 48px;
    }
    .hero-section .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem !important;
    }
    /* Chi sono / Index - immagine e testo */
    .row.g-5 {
        gap: 1.5rem !important;
    }
    .row.g-5 .text-center img[style*="border-radius: 30px"],
    .row.align-items-center .text-center .position-relative img {
        max-height: 280px !important;
    }
    .row.g-5.align-items-center .col-lg-5 img.img-fluid.rounded-4 {
        max-height: 280px !important;
        object-fit: cover;
        object-position: 25% center;
    }
    /* Cards */
    .card-custom {
        margin-bottom: 0;
    }
    .card-custom:hover {
        transform: none;
    }
    .icon-box {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }
    .card-custom .icon-box.m-0.me-3 {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }
    .card-custom h4 {
        font-size: 1.1rem;
    }
    /* Servizi - immagine "Essere cane per un giorno" */
    .row.g-5.align-items-center.mb-5 .col-md-6 img {
        height: 220px !important;
        object-position: center top;
    }
    /* Instagram slider - slide più piccoli su mobile */
    .insta-track {
        width: calc(160px * 32);
        animation: scroll-mobile 35s linear infinite;
    }
    .insta-slide {
        width: 160px;
        padding: 0 6px;
    }
    .insta-slider {
        padding: 32px 0;
    }
    .insta-slider .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    .insta-slider .btn-outline-custom {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
    /* Servizi - box Dogsportal / Volontariato */
    .d-flex.p-4.border.rounded-4 {
        padding: 1rem !important;
    }
    .d-flex.p-4.border.rounded-4 .fa-solid.fs-1,
    .d-flex.p-4.border.rounded-4 .fa-solid.fs-1.text-secondary {
        font-size: 1.5rem !important;
    }
    /* Articoli Dogsportal - card più strette su tablet/mobile */
    .dogsportal-article-card {
        flex: 0 0 280px;
        max-width: 280px;
        padding: 1rem;
    }
    .dogsportal-article-card h3 {
        font-size: 0.95rem;
    }
    /* Footer */
    footer .row.g-4 {
        gap: 2rem;
    }
    footer .row.mt-5.pt-3 {
        flex-direction: column;
        gap: 1rem;
        text-align: center !important;
    }
    footer .row.mt-5.pt-3 .col-md-6 {
        text-align: center !important;
    }
    footer .border-top a {
        display: inline-block;
        margin: 0.25rem !important;
    }
}

@keyframes scroll-mobile {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-160px * 16)); }
}

/* Mobile piccolo */
@media (max-width: 575px) {
    .hero-section {
        padding: 50px 0 40px;
    }
    .hero-section h1 {
        font-size: 1.6rem;
    }
    section[style*="background-color: var(--primary-color)"] .container {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }
    section[style*="background-color: var(--primary-color)"] h1 {
        font-size: 1.45rem !important;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    section.py-5 .container.py-4,
    section.py-5 .container.py-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    h2.fw-bold:not(.display-6) {
        font-size: 1.5rem;
    }
    h3.fw-bold {
        font-size: 1.35rem;
    }
    .insta-slide {
        width: 140px;
        padding: 0 5px;
    }
    .insta-track {
        width: calc(140px * 32);
        animation: scroll-mobile-sm 35s linear infinite;
    }
    .dogsportal-article-card {
        flex: 0 0 260px;
        max-width: 260px;
    }
    .dogsportal-articles-section .d-flex.flex-wrap.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
    }
    /* Banner cookie su mobile */
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .cookie-banner-text {
        min-width: 0;
    }
    .cookie-banner-actions {
        justify-content: center;
    }
}

@keyframes scroll-mobile-sm {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-140px * 16)); }
}