/* ============================================================
   style.css — Foglio di stile globale
   Sito: Lavanderia L'ApeGreen
   Include: variabili, reset, tipografia, layout base, utility
   ============================================================ */

/* ------------------------------------------------------------
   VARIABILI
   ------------------------------------------------------------ */
:root {

    /* Colori sfondo */
    --bg-page:          #FAF9F7;   /* bianco caldo — sfondo pagina */
    --bg-card:          #F0EEE9;   /* bianco leggermente più scuro — cards */
    --bg-header:        #FFFFFF;   /* bianco puro — header */

    /* Testo */
    --color-text:       #1A1A1A;   /* nero principale */
    --color-text-muted: #6B6B6B;   /* grigio testo secondario */

    /* Pulsanti */
    --btn-bg:           #2563EB;   /* blu principale */
    --btn-bg-hover:     #1D4ED8;   /* blu scuro — hover */
    --btn-bg-active:    #1E40AF;   /* blu più scuro — active/click */
    --btn-text:         #FFFFFF;   /* testo pulsante bianco */

    /* Bordi */
    --border-color:     #E2DFDA;   /* bordo sottile neutro */
    --border-radius-card: 12px;    /* arrotondamento cards */
    --border-radius-btn:  6px;     /* arrotondamento pulsanti */

    /* Ombre */
    --shadow-card:      0 2px 8px rgba(0, 0, 0, 0.08),
                        0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.12),
                         0 2px 6px rgba(0, 0, 0, 0.07);

    /* Tipografia */
    --font-main:        'Segoe UI', Arial, sans-serif;
    --font-size-base:   16px;
    --line-height-base: 1.65;

    /* Spaziature */
    --spacing-xs:   0.4rem;
    --spacing-sm:   0.75rem;
    --spacing-md:   1.25rem;
    --spacing-lg:   2rem;
    --spacing-xl:   3rem;

    /* Larghezza massima contenuto */
    --max-width:    1140px;

    /* Breakpoint (solo riferimento — usare nelle media query) */
    /* mobile:  < 576px  */
    /* tablet:  576px — 991px */
    /* desktop: >= 992px */
}

/* ------------------------------------------------------------
   RESET
   ------------------------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--color-text);
    line-height: var(--line-height-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ------------------------------------------------------------
   TIPOGRAFIA
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

p:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------
   LAYOUT — CONTAINER
   ------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-card);
    padding: var(--spacing-lg);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* ------------------------------------------------------------
   PULSANTI
   ------------------------------------------------------------ */
.btn {
    display: inline-block;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    border-radius: var(--border-radius-btn);
    padding: 0.6rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
    user-select: none;
}

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

.btn:active {
    background-color: var(--btn-bg-active);
    transform: translateY(0);
}

/* ------------------------------------------------------------
   WHATSAPP — pulsante flottante
   ------------------------------------------------------------ */
.wa-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 999;
    text-decoration: none;
}

.wa-tooltip {
    background: #1A1A1A;
    color: #FFFFFF;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: relative;
}

.wa-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right: none;
    border-left-color: #1A1A1A;
}

.wa-float:hover .wa-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.wa-btn {
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.wa-float:hover .wa-btn {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.wa-btn i {
    font-size: 28px;
    color: #FFFFFF;
}

@media (max-width: 575px) {
    .wa-float {
        bottom: 1.2rem;
        right: 1.2rem;
    }

    .wa-tooltip {
        display: none;
    }
}
/* ------------------------------------------------------------
   TOAST NOTIFICATIONS
   ------------------------------------------------------------ */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #FFFFFF;
    border: 0.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    animation: toast-in 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: all;
}

.toast.hiding { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}

.toast-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 15px; font-weight: 700;
}

.toast.toast-success .toast-icon { background: #D1FAE5; color: #065F46; }
.toast.toast-error   .toast-icon { background: #FEE2E2; color: #991B1B; }
.toast.toast-warning .toast-icon { background: #FEF3C7; color: #92400E; }
.toast.toast-info    .toast-icon { background: #DBEAFE; color: #1E40AF; }

.toast-body { flex: 1; }

.toast-title {
    font-size: 13px; font-weight: 600;
    color: var(--color-text); margin: 0 0 2px;
}

.toast-msg {
    font-size: 12px; color: var(--color-text-muted);
    margin: 0; line-height: 1.4;
}

.toast-close {
    background: none; border: none;
    cursor: pointer; color: var(--color-text-muted);
    font-size: 18px; padding: 0; line-height: 1; flex-shrink: 0;
}

.toast-progress {
    position: absolute; bottom: 0; left: 0;
    height: 3px; border-radius: 0 0 10px 10px;
    animation: toast-progress 4s linear forwards;
}

.toast.toast-success .toast-progress { background: #10B981; }
.toast.toast-error   .toast-progress { background: #EF4444; }
.toast.toast-warning .toast-progress { background: #F59E0B; }
.toast.toast-info    .toast-progress { background: #3B82F6; }

@keyframes toast-progress {
    from { width: 100%; }
    to   { width: 0%; }
}

@media (max-width: 575px) {
    #toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
    .toast { min-width: auto; max-width: 100%; }
}

/* ------------------------------------------------------------
   UTILITY
   ------------------------------------------------------------ */
.text-muted   { color: var(--color-text-muted); }
.text-right   { text-align: right; }
.mt-sm        { margin-top: var(--spacing-sm); }
.mt-md        { margin-top: var(--spacing-md); }
.mt-lg        { margin-top: var(--spacing-lg); }
.mb-sm        { margin-bottom: var(--spacing-sm); }
.mb-md        { margin-bottom: var(--spacing-md); }
.mb-lg        { margin-bottom: var(--spacing-lg); }

/* ------------------------------------------------------------
   RESPONSIVE — TIPOGRAFIA E SPAZIATURE
   ------------------------------------------------------------ */
@media (max-width: 991px) {
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
}

@media (max-width: 575px) {
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.1rem; }

    .btn {
        width: 100%;
        padding: 0.75rem 1rem;
    }
}

/* ------------------------------------------------------------
   ANIMAZIONI SCROLL-REVEAL
   Attivate da scripts.js (classe .visible aggiunta allo scroll)
   ------------------------------------------------------------ */
.anim-fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.anim-slide-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-slide-right {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-fade-up.visible,
.anim-fade.visible,
.anim-slide-left.visible,
.anim-slide-right.visible {
    opacity: 1;
    transform: none;
}

.anim-delay-1.visible { transition-delay: 0.1s; }
.anim-delay-2.visible { transition-delay: 0.2s; }
.anim-delay-3.visible { transition-delay: 0.3s; }
