/**
 * Foglio di Stile Personalizzato - Maticaffè Custom Site
 * Design Aesthetics: Premium Coffee Gold & Sleek Charcoal Dark Mode
 */

/* 1. Variabili di Design (Tema Cream & Coffee - Strict Mode v3.1) */
:root {
    --bg-dark: #fffaf4;            /* Sfondo principale (Crema chiaro e caldo) */
    --bg-card: #ffffff;            /* Sfondo dei box/prodotti (Bianco puro) */
    --bg-card-hover: #fff3e0;      /* Hover sui box (Nocciola chiarissimo) */
    --text-light: #2c241f;         /* Testo principale (Marrone caffè scuro) */
    --text-muted: #6f625a;         /* Testo secondario (Marrone desaturato) */
    --color-primary: #c6924b;      /* Oro antico / Caramello per dettagli e bottoni */
    --color-primary-hover: #4b2a17;/* Marrone testa di moro per gli hover */
    --color-accent: #8d6e63;       /* Marrone cappuccino per accenti secondari */
    --font-headings: 'Josefin Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-color: rgba(75, 42, 23, 0.12); /* Bordi morbidi e caldi */
    --wa-green: #2f6b4f;           /* Verde coordinato al tema */
}

/* 2. Reset e Regole Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* 3. Header & Navigazione */
.site-header {
    background-color: rgba(255, 250, 244, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-headings);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-mati {
    color: var(--text-light);
}

.logo-caffe {
    color: var(--color-primary);
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.5px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary);
}

.main-nav a.active {
    border-bottom-color: var(--color-primary);
}

.btn-acquamatic {
    background-color: var(--color-primary);
    color: var(--bg-dark) !important;
    padding: 8px 18px !important;
    border-radius: 4px;
    font-weight: 700 !important;
    border: none !important;
    transition: transform 0.2s ease, background-color 0.3s ease !important;
}

.btn-acquamatic:hover {
    background-color: var(--color-primary-hover) !important;
    transform: translateY(-2px);
}

/* 4. Layout Contenuto Principale */
.site-content-wrapper {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 5. Home Page: Hero Section & Vetrina */
.hero-section {
    text-align: center;
    padding: 80px 20px;
    background: radial-gradient(circle, rgba(141,110,99,0.15) 0%, rgba(18,18,18,0) 70%);
    border-radius: 12px;
    margin-bottom: 60px;
}

.hero-section h1 {
    font-family: var(--font-headings);
    font-size: 48px;
    color: var(--color-primary);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.hero-section p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 30px auto;
}

.btn-primary {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--bg-dark);
    padding: 12px 30px;
    border-radius: 4px;
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* Griglia Prodotti */
.section-title {
    font-family: var(--font-headings);
    font-size: 32px;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 10px auto 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.product-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #2c1e1a 0%, #1e1e1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 20px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.product-img-placeholder::after {
    content: '☕';
    font-size: 40px;
    opacity: 0.15;
    position: absolute;
}

.product-img-wrapper {
    height: 200px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    position: relative;
    padding: 6px;
    box-sizing: border-box;
}

.product-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 6px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.04);
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-cat {
    font-size: 12px;
    color: var(--color-primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-title {
    font-family: var(--font-headings);
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-family: var(--font-headings);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
}

.btn-card {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-card:hover {
    background-color: var(--color-primary);
    color: var(--bg-dark);
}

/* 6. Form Contatti & Pagine statiche */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    margin-top: 20px;
}

.contact-info-panel {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-info-panel h2 {
    font-family: var(--font-headings);
    color: var(--color-primary);
    margin-bottom: 25px;
}

.info-item {
    margin-bottom: 20px;
}

.info-item h4 {
    color: var(--color-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.contact-form-panel {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.alert-success {
    background-color: rgba(37, 211, 102, 0.1);
    color: var(--wa-green);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--wa-green);
    margin-bottom: 20px;
}

/* Filtri Catalogo */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn-filter {
    background-color: var(--bg-card);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-headings);
    font-size: 15px;
    transition: all 0.3s ease;
}

.btn-filter:hover,
.btn-filter.active {
    background-color: var(--color-primary);
    color: var(--bg-dark);
    border-color: var(--color-primary);
}

/* 7. Footer (Tema Cream & Coffee - Strict Mode v3.1) */
.site-footer {
    background-color: #1e1510;
    border-top: 1px solid var(--border-color);
    padding: 50px 20px 20px 20px;
    margin-top: 80px;
    color: #e5c29f;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 0.8fr;
    gap: 30px;
}

.footer-section h3 {
    font-family: var(--font-headings);
    color: #ffd794;
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-info p {
    color: #d0c4b8;
    font-size: 14px;
    line-height: 1.8;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #d0c4b8;
    font-size: 14px;
}

.footer-links a:hover {
    color: #ffd794;
}

.social-icons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-icons a {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d0c4b8;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.social-icons a:hover {
    background-color: var(--color-primary);
    color: #1e1510;
    border-color: var(--color-primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #a09080;
    font-size: 13px;
}

/* 8. Widget Fluttuante WhatsApp */
.floating-contact-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.widget-icon-wa {
    background-color: var(--wa-green);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;
}

.widget-pulse {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--wa-green);
    border-radius: 50%;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .hero-section h1 {
        font-size: 36px;
    }
}

/* 9. Comodato Overlay Styles */
.comodato-image-wrapper {
    position: relative;
    max-width: 100%; /* Adatta l'immagine alla grandezza della pagina */
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.comodato-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.comodato-overlay-btn {
    position: absolute;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.comodato-overlay-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

/* 10. Home Page Layout Enhancements */
.services-section {
    padding: 60px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    margin-bottom: 60px;
}

.service-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.service-icon {
    font-size: 48px;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.service-card h3 {
    font-family: var(--font-headings);
    font-size: 26px;
    color: var(--text-light);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.service-features {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

.service-features li {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 12px;
    position: relative;
    padding-left: 25px;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

/* Sezione Features / Punti di Forza */
.features-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 60px;
    text-align: center;
}

.feature-item {
    padding: 10px;
}

.feature-item-icon {
    font-size: 32px;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.feature-item h4 {
    font-family: var(--font-headings);
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Modifiche per mobile */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    .features-strip {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 11. Servizio Overlay Styles */
.servizio-image-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.servizio-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.servizio-overlay-btn {
    position: absolute;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.servizio-overlay-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}
