/* 
 * Stili Mobile-First per Ragazzo di Campagna
 * Colori del logo aziendale
 */

:root {
    /* Colori Brand - dal logo */
    --verde: #319866;
    --verde-scuro: #287a52;
    --verde-chiaro: #3db07a;
    --rosso: #ea2040;
    --rosso-scuro: #c41835;
    --nero: #0f0b0c;
    --bianco: #ffffff;

    /* Colori secondari */
    --grigio: #f5f5f5;
    --grigio-scuro: #333;
    --ombra: 0 4px 15px rgba(15, 11, 12, 0.15);
    --raggio: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f4f7f5;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(49, 152, 102, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(49, 152, 102, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #f8faf9 0%, #f0f4f2 50%, #e8eeea 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--nero);
    line-height: 1.6;
}

/* =====================
   HEADER (MODERN GLASSMORPHISM)
===================== */
.header {
    background: linear-gradient(135deg,
            rgba(26, 92, 61, 0.85) 0%,
            rgba(40, 122, 82, 0.9) 50%,
            rgba(58, 157, 110, 0.8) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--bianco);
    padding: 12px 18px;
    z-index: 100;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.25),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

/* Sfumatura sottile in basso */
.header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(26, 92, 61, 0.3), transparent);
    pointer-events: none;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-brand .profile-logo-container {
    width: clamp(80px, 15vw, 110px);
    height: clamp(80px, 15vw, 110px);
    /* Forza altezza uguale per evitare ovali */
    aspect-ratio: 1 / 1;
    background: var(--bianco);
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--bianco);
    position: relative;
    margin-bottom: -55px;
    /* Sovrapposizione bilanciata */
    z-index: 101;
    flex-shrink: 0;
    overflow: hidden;
    /* Garantisce che l'immagine non esca dai bordi tondi */
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-brand img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.header h1 {
    font-size: clamp(1.1rem, 4vw, 1.6rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: var(--bianco);
}

.header p {
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    margin: 2px 0 0 0;
    opacity: 0.95;
    line-height: 1.2;
    color: var(--bianco);
}

.header-contact {
    text-align: right;
    margin-left: 10px;
}

.header-contact a {
    color: var(--bianco);
    text-decoration: none;
    font-weight: bold;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    display: block;
}

.header-contact .btn-chiama {
    display: inline-block;
    background: var(--rosso);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    margin-top: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* Fix per mobile - Header minimale */
@media (max-width: 600px) {
    .header {
        padding: 12px 15px;
    }

    .header-inner {
        display: flex;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px;
    }

    /* Logo GRANDE senza bordi */
    .header-brand {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .header-brand .profile-logo-container {
        width: 80px;
        height: 80px;
        background: transparent;
        border: none !important;
        box-shadow: none;
        padding: 0;
        margin-bottom: 0;
    }

    .header-brand img {
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    /* Nascondi titoli su mobile */
    .header-titles {
        display: none !important;
    }

    /* Nascondi numero, mostra solo bottone */
    .header-contact>a:not(.btn-chiama) {
        display: none;
    }

    .header-contact {
        flex-shrink: 0;
    }

    /* Bottone CHIAMA - Modern Style */
    .header-contact .btn-chiama {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 24px;
        font-size: 1rem;
        border-radius: 50px;
        font-weight: 700;
        background: linear-gradient(135deg, #ea2040 0%, #ff4060 50%, #ea2040 100%);
        background-size: 200% 200%;
        box-shadow:
            0 4px 20px rgba(234, 32, 64, 0.5),
            0 0 0 2px rgba(255, 255, 255, 0.2) inset;
        white-space: nowrap;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        transition: all 0.3s ease;
        animation: pulse-glow 2s infinite;
    }

    .header-contact .btn-chiama:hover {
        transform: scale(1.05);
        box-shadow:
            0 6px 25px rgba(234, 32, 64, 0.6),
            0 0 0 3px rgba(255, 255, 255, 0.3) inset;
    }

    @keyframes pulse-glow {

        0%,
        100% {
            box-shadow: 0 4px 20px rgba(234, 32, 64, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.2) inset;
        }

        50% {
            box-shadow: 0 4px 30px rgba(234, 32, 64, 0.7), 0 0 0 2px rgba(255, 255, 255, 0.3) inset;
        }
    }
}

/* =====================
   HERO SLIDER (REFINED)
===================== */
.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #000;
    border-radius: 16px;
}

/* Mobile: hero full-width ma con angoli stondati */
@media (max-width: 600px) {
    .hero-container {
        padding: 0;
        max-width: 100%;
    }

    .hero-slider {
        height: 220px;
        border-radius: 12px;
    }

    .hero-img-main {
        object-position: center center;
    }
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
}

/* Sfondo sfocato per le foto non proporzionate */
.hero-bg-blur {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(20px) brightness(0.5);
    z-index: 1;
}

/* Immagine principale nitida sopra */
.hero-img-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    transition: transform 0.5s ease;
}

/* Animazione zoom al passaggio slide */
.hero-slide.active .hero-img-main {
    animation: heroZoom 8s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* Sfumatura cinematografica sottile (nero dal basso) */
.hero-slider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.4) 0%,
            rgba(0, 0, 0, 0.15) 50%,
            transparent 100%);
    z-index: 3;
    pointer-events: none;
    border-radius: 0 0 16px 16px;
}

/* Ombra elegante sullo slider */
.hero-slider {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.hero-overlay {
    display: none;
}

/* Rimosso testo benvenuti come richiesto */

/* Area profilo integrata nell'header fluttuante/overlap */
.profile-area {
    display: none;
}

/* Shading overlay for modern look */
.hero-shading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 4;
    pointer-events: none;
}

/* =====================
   SOCIAL ICONS ROW
===================== */
.social-row {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
}

/* Facebook button styling */
button.social-icon {
    border: none;
    cursor: pointer;
}

/* Facebook Popup */
.fb-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    margin-bottom: 10px;
    z-index: 100;
}

.fb-popup.show {
    display: flex;
    animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.fb-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--nero);
    font-weight: 500;
    transition: background 0.2s;
}

.fb-popup-item:hover {
    background: #f0f0f0;
}

.fb-popup-icon {
    font-size: 1.3rem;
}

.social-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: var(--ombra);
    transition: transform 0.3s;
    text-decoration: none;
    font-size: 1.8rem;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon.fb {
    color: #1877F2;
}

.social-icon.ig {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: white;
}

.social-icon.wa {
    color: #25D366;
}

.social-icon.call {
    background: var(--rosso);
    color: white;
}

/* Media query rimosse: gestite tramite clamp e flex-wrap */

/* =====================
   CATEGORY GRID (NEW)
===================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--nero);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--verde) 0%, var(--verde-scuro) 100%);
    color: white;
}

.cat-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.cat-icon-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.cat-name {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    font-weight: 600;
    line-height: 1.2;
}

/* =====================
   CONTAINER
===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* =====================
   PULSANTI (GRANDI!)
===================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: var(--raggio);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 60px;
    width: 100%;
    margin-bottom: 15px;
    box-shadow: var(--ombra);
}

.btn-grande {
    padding: 25px 40px;
    font-size: 1.4rem;
    min-height: 80px;
}

.btn-verde {
    background: linear-gradient(135deg, var(--verde-chiaro) 0%, var(--verde) 100%);
    color: var(--bianco);
}

.btn-verde:hover,
.btn-verde:active {
    background: linear-gradient(135deg, var(--verde) 0%, var(--verde-scuro) 100%);
    transform: translateY(-2px);
}

.btn-arancione {
    background: linear-gradient(135deg, #f04060 0%, var(--rosso) 100%);
    color: var(--bianco);
}

.btn-arancione:hover,
.btn-arancione:active {
    background: linear-gradient(135deg, var(--rosso) 0%, var(--rosso-scuro) 100%);
    transform: translateY(-2px);
}

.btn-rosso {
    background: linear-gradient(135deg, #f04060 0%, var(--rosso) 100%);
    color: var(--bianco);
}

.btn-rosso:hover,
.btn-rosso:active {
    background: linear-gradient(135deg, var(--rosso) 0%, var(--rosso-scuro) 100%);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: var(--bianco);
}

.btn-telefono {
    background: linear-gradient(135deg, #2196f3 0%, #1565c0 100%);
    color: var(--bianco);
}

/* =====================
   GRIGLIA PRODOTTI
===================== */
.prodotti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.prodotto-card {
    background: var(--bianco);
    border-radius: var(--raggio);
    overflow: hidden;
    box-shadow: var(--ombra);
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.prodotto-card:hover {
    transform: translateY(-5px);
}

.prodotto-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.prodotto-info {
    padding: 20px;
}

.prodotto-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--grigio-scuro);
}

.prodotto-prezzo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--verde);
}

.prodotto-categoria {
    display: inline-block;
    background: var(--grigio);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* =====================
   FORM
===================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--grigio-scuro);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: var(--raggio);
    background: var(--bianco);
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--verde);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Upload foto */
.upload-box {
    border: 3px dashed var(--verde);
    border-radius: var(--raggio);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fff9;
}

.upload-box:hover {
    background: #e8f5e9;
    border-color: var(--verde-scuro);
}

.upload-box input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2rem;
    color: var(--verde);
    font-weight: 600;
}

.preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--raggio);
    margin-top: 15px;
    display: none;
}

/* =====================
   PAGINA DETTAGLIO
===================== */
.dettaglio {
    background: var(--bianco);
    border-radius: var(--raggio);
    overflow: hidden;
    box-shadow: var(--ombra);
    margin-top: 20px;
}

.dettaglio img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.dettaglio-info {
    padding: 25px;
}

.dettaglio-info h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.dettaglio-info .prezzo {
    font-size: 2rem;
    color: var(--verde);
    font-weight: bold;
    margin-bottom: 20px;
}

.dettaglio-info .descrizione {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

.contatti-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

/* =====================
   LOGIN
===================== */
.login-box {
    max-width: 400px;
    margin: 50px auto;
    background: var(--bianco);
    padding: 40px;
    border-radius: var(--raggio);
    box-shadow: var(--ombra);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--verde);
}

/* =====================
   DASHBOARD ADMIN
===================== */
.dashboard-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.stat-box {
    background: var(--bianco);
    padding: 25px;
    border-radius: var(--raggio);
    text-align: center;
    box-shadow: var(--ombra);
}

.stat-numero {
    font-size: 3rem;
    font-weight: bold;
    color: var(--verde);
}

.stat-label {
    font-size: 1.1rem;
    color: #666;
}

.lista-prodotti {
    margin-top: 30px;
}

.lista-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bianco);
    padding: 15px;
    border-radius: var(--raggio);
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lista-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.lista-item-info {
    flex: 1;
}

.lista-item-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.lista-item-info .prezzo {
    color: var(--verde);
    font-weight: bold;
}

.lista-item-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 50px;
    height: 50px;
    min-height: 50px;
    padding: 0;
    font-size: 1.5rem;
    border-radius: 50%;
    margin: 0;
}

/* =====================
   MESSAGGI
===================== */
.messaggio {
    padding: 20px;
    border-radius: var(--raggio);
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.messaggio-successo {
    background: #e8f5e9;
    color: var(--verde-scuro);
    border: 2px solid var(--verde);
}

.messaggio-errore {
    background: #ffebee;
    color: #c62828;
    border: 2px solid var(--rosso);
}

/* =====================
   VUOTO
===================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #666;
}

/* =====================
   FOOTER
===================== */
.footer {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 0.9rem;
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.3rem;
    }

    .prodotti-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 15px 20px;
        font-size: 1.1rem;
    }

    .btn-grande {
        padding: 20px 30px;
        font-size: 1.3rem;
    }
}

/* =====================
   MOBILE ESTREMO (360px - 400px)
===================== */
@media (max-width: 400px) {
    .container {
        padding: 15px 10px;
    }

    /* Filtri TUTTI/NUOVO/USATO */
    .filters-row {
        display: flex;
        gap: 6px;
        margin-bottom: 15px;
        flex-wrap: nowrap;
    }

    .filters-row .btn,
    .filters-row .btn-grande {
        padding: 10px 6px;
        font-size: 0.75rem;
        min-height: 45px;
        flex: 1;
        margin-bottom: 0;
    }

    .btn {
        padding: 12px 10px;
        font-size: 0.9rem;
        min-height: 50px;
        gap: 6px;
    }

    .btn-grande {
        padding: 12px 8px;
        font-size: 0.85rem;
        min-height: 50px;
    }

    /* Griglia categorie: 2 colonne su mobile stretto */
    .category-grid-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .category-grid-mobile .btn {
        padding: 12px 8px;
        font-size: 0.8rem;
        min-height: 50px;
    }

    /* Header ottimizzato */
    .header {
        padding: 8px 10px;
    }

    .header-inner {
        gap: 6px;
    }

    .header-brand .profile-logo-container {
        width: 55px;
        height: 55px;
        margin-bottom: -25px;
    }

    .header h1 {
        font-size: 1rem;
    }

    .header p {
        font-size: 0.65rem;
    }

    .header-contact .btn-chiama {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    /* Social row più compatta */
    .social-row {
        gap: 12px;
        padding: 0 10px;
        margin: 15px auto;
    }

    .social-icon {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }
}

/* =====================
   MOBILE ESTREMO (< 360px)
===================== */
@media (max-width: 360px) {

    /* Header: mantieni orizzontale anche su 360px */
    .header-inner {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px;
    }

    .header-brand .profile-logo-container {
        width: 80px;
        height: 80px;
    }

    .header-contact .btn-chiama {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* Filtri: wrapping abilitato */
    .filters-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .filters-row .btn,
    .filters-row .btn-grande {
        flex: 1 1 30%;
        min-width: 80px;
    }

    /* Categoria: 1 colonna */
    .category-grid-mobile {
        grid-template-columns: 1fr !important;
    }

    .btn {
        font-size: 0.8rem;
        padding: 10px 6px;
    }

    .btn-grande {
        font-size: 0.75rem;
        padding: 10px 5px;
    }
}