/* ========================================
   COMPONENTS.CSS, Giardini Fioriti
   Reusable UI components
   ======================================== */

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 4rem;
    padding-left: max(4rem, env(safe-area-inset-left));
    padding-right: max(4rem, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
    background: linear-gradient(135deg, #FDFCF7 0%, #F4F8F0 50%, #F0F6EC 100%);
}

.nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--orange) 0%,
        var(--yellow) 15%,
        var(--light-green) 30%,
        var(--grass) 45%,
        var(--pink) 60%,
        var(--dark-green) 75%,
        var(--violet) 90%,
        var(--grass) 100%
    );
}

.nav.scrolled {
    background: linear-gradient(135deg, #FDFCF7 0%, #F4F8F0 50%, #F0F6EC 100%);
    box-shadow: 0 4px 20px rgba(0, 111, 59, 0.08);
}

.logo {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.logo-img {
    height: 42px;
    width: auto;
}

.nav-center {
    display: flex;
    gap: 0.5rem;
}

.nav-pill {
    padding: 0.55rem 1.1rem;
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-pill:hover,
.nav-pill.active {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-icon {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-lang-wrap {
    position: relative;
}
.nav-lang {
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}
.nav-lang:hover,
.nav-lang[aria-expanded="true"] {
    background: var(--primary);
    color: white;
}
.nav-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 0.4rem;
    min-width: 170px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 1002;
}
.nav-lang-wrap:hover .nav-lang-menu,
.nav-lang-wrap:focus-within .nav-lang-menu,
.nav-lang[aria-expanded="true"] + .nav-lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-lang-menu a {
    display: block;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    color: var(--text-dark, #2d4a2b);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.nav-lang-menu a:hover {
    background: var(--cream, #f5f7f2);
}

.nav-mobile-langs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    margin-top: 0.5rem;
}
.nav-mobile-langs a {
    padding: 0.4rem 0.8rem !important;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    font-size: 0.8rem;
    opacity: 0.7;
}
.nav-mobile-langs a.active {
    background: rgba(255,255,255,0.15);
    opacity: 1;
}

.nav-cta {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 20px;
    font-size: 0.88rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: var(--dark-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 111, 59, 0.3);
}

/* Mobile Toggle */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    z-index: 1001;
}

.nav-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.nav-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(253, 252, 247, 0.98);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-mobile-menu.open {
    opacity: 1;
    visibility: visible;
}

.nav-mobile-menu a {
    font-family: 'EB Garamond', serif;
    font-size: 1.8rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-mobile-menu a:hover {
    color: var(--primary);
}

.nav-mobile-menu .nav-cta {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    margin-top: 1rem;
}

/* ---- Buttons ---- */
.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 111, 59, 0.25);
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 1.5px solid var(--text-dark);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* ---- Service Cards ---- */
.service-card {
    background: white;
    border-radius: 20px;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.service-card:nth-child(1)::before { background: linear-gradient(90deg, var(--grass), var(--light-green)); }
.service-card:nth-child(2)::before { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.service-card:nth-child(3)::before { background: linear-gradient(90deg, var(--pink), var(--violet)); }
.service-card:nth-child(4)::before { background: linear-gradient(90deg, var(--primary), var(--dark-green)); }
.service-card:nth-child(5)::before { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.service-card:nth-child(6)::before { background: linear-gradient(90deg, var(--violet), var(--pink)); }
.service-card:nth-child(7)::before { background: linear-gradient(90deg, var(--light-green), var(--grass)); }
.service-card:nth-child(8)::before { background: linear-gradient(90deg, var(--yellow), var(--light-green)); }

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.service-card:hover::before {
    opacity: 1;
}

.service-number {
    font-family: 'EB Garamond', serif;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.15;
}

.service-card:nth-child(1) .service-number { color: var(--grass); }
.service-card:nth-child(2) .service-number { color: var(--orange); }
.service-card:nth-child(3) .service-number { color: var(--pink); }
.service-card:nth-child(4) .service-number { color: var(--primary); }
.service-card:nth-child(5) .service-number { color: var(--yellow); }
.service-card:nth-child(6) .service-number { color: var(--violet); }

.service-card h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    padding: 0 1.5rem;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.5rem;
}

.service-tag {
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    background: var(--cream);
    color: var(--text-medium);
}

.service-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 0;
    margin-bottom: 1.5rem;
    background: var(--background-green);
}

.service-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    margin-top: 0.5rem;
    padding: 0 1.5rem 1.5rem;
    transition: gap 0.3s ease;
}

.service-card-link:hover {
    gap: 0.8rem;
}

/* ---- Featured Items ---- */
.featured-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.featured-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.featured-item-number {
    font-family: 'EB Garamond', serif;
    font-size: 1.6rem;
    font-weight: 600;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--light-green);
}

.featured-item-text h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.featured-item-text p {
    font-size: 0.85rem;
    opacity: 0.75;
}

.featured-stat {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.8rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.featured-stat-number {
    font-family: 'EB Garamond', serif;
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.featured-stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ---- Process Steps ---- */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
}

.process-step-img-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.process-step-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: var(--background-green);
    transition: transform 0.5s ease;
}

.process-step:hover .process-step-img {
    transform: scale(1.06);
}

/* Gradient line connecting the number circles */
.process-steps::before {
    content: '';
    position: absolute;
    /* 150px img + 1rem gap + 28px half-circle */
    top: calc(150px + 1rem + 28px);
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg,
        var(--orange),
        var(--yellow),
        var(--grass),
        var(--pink)
    );
    z-index: 0;
}

.process-step {
    text-align: center;
    position: relative;
}

.process-step-number {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'EB Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.process-step:nth-child(1) .process-step-number { color: var(--orange); border: 2px solid var(--orange); }
.process-step:nth-child(2) .process-step-number { color: var(--yellow); border: 2px solid var(--yellow); }
.process-step:nth-child(3) .process-step-number { color: var(--grass); border: 2px solid var(--grass); }
.process-step:nth-child(4) .process-step-number { color: var(--pink); border: 2px solid var(--pink); }

.process-step h4 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.process-step p {
    font-size: 0.9rem;
    color: var(--text-medium);
}

/* ---- Forms ---- */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    background: white;
    border: 1.5px solid rgba(45, 74, 43, 0.18);
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px; /* iOS Safari: previene auto-zoom sul focus */
    color: var(--text-dark);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(45, 74, 43, 0.4);
    opacity: 1;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: rgba(45, 74, 43, 0.45);
    background: var(--cream);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(45, 74, 43, 0.14);
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.form-group select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23006F3B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-group .error-message {
    display: none;
    font-size: 0.8rem;
    color: var(--orange);
    margin-top: 0.3rem;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: var(--orange);
}

.form-group.has-error .error-message {
    display: block;
}

.contact-form-card {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.contact-form-title {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.contact-form-card .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    justify-content: center;
}

/* ---- Footer ---- */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 4rem;
    padding-bottom: max(4rem, calc(2rem + env(safe-area-inset-bottom)));
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr auto 1.2fr;
    gap: 3rem;
    align-items: start;
}

.footer-areas h4 {
    color: rgba(255, 255, 255, 0.95);
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.85rem;
    letter-spacing: 0.02em;
}

.footer-areas ul {
    list-style: none;
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.9;
}

.footer-areas a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-areas a:hover {
    color: var(--grass);
}

.footer-brand {
    line-height: 0;
}

.footer-brand .logo-img {
    height: 36px;
    width: auto;
}

.footer-social {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-social svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.8);
}

.footer-social a:hover svg {
    fill: white;
}

.footer-colors {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding-top: 1rem;
}

.footer-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.footer-address {
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.9;
    font-size: 0.95rem;
}

.footer-address a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-hours {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85em;
    opacity: 0.7;
}

/* Map placeholder (consent-aware) */
.contatti-map-wrapper {
    margin-top: 2rem;
}
.contatti-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    height: 250px;
    background: var(--cream, #f5f7f2);
    border: 1.5px dashed var(--primary, #2d5016);
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    color: var(--primary, #2d5016);
    transition: background 0.2s, border-color 0.2s;
}
.contatti-map-placeholder:hover,
.contatti-map-placeholder:focus {
    background: rgba(106, 138, 79, 0.08);
    border-color: var(--dark-green, #1a3a1a);
    outline: none;
}
.contatti-map-cta {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
}
.contatti-map-note {
    font-size: 0.75rem;
    opacity: 0.65;
    max-width: 32ch;
    line-height: 1.4;
}

/* Privacy disclaimer dentro form */
.form-disclaimer {
    font-size: 0.8rem;
    color: var(--text-dark, #333);
    opacity: 0.75;
    line-height: 1.45;
    margin: 0 0 0.6rem 0;
}
.form-disclaimer a {
    color: var(--primary, #2d5016);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.form-disclaimer a:hover {
    color: var(--dark-green, #1a3a1a);
}

.footer-address a:hover {
    color: var(--grass);
}

.footer-bottom {
    max-width: 1400px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--grass);
}

/* ---- Contact Info ---- */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.contact-text {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.8rem;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-value {
    color: var(--text-dark);
    font-size: 1.05rem;
    font-weight: 500;
}

.contact-value a {
    color: inherit;
    text-decoration: none;
}

.contact-value a:hover {
    color: var(--primary);
}

/* ---- Responsive Components ---- */
@media (max-width: 992px) {
    .nav {
        padding: 1rem 1.5rem;
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }

    .nav-center,
    .nav-right {
        display: none;
    }

    .nav-mobile-toggle {
        display: block;
    }

    .nav-mobile-menu {
        display: flex;
    }

    .process-steps {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .process-steps::before {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .footer-address {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-areas {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        text-align: center;
        justify-content: center;
    }
}
