/* 01. VARIABLES & THEMING (Colori e Variabili globali)*/
:root {
    --brand-teal: #d0e7e9;
    --brand-dark-teal: #026769;
    --brand-dark-gray: #444444;
    --brand-darker-teal: #004D4A;
    --brand-active-teal: #9ECBC9;
    --brand-coral: #e1705f;
    --brand-dark-coral: #a03f31;
    --text-main: #1a1c1c;
    --text-muted: #56423f;
    --surface-light: #f9f9f9;
    --surface-white: #ffffff;
    --service-yellow: #ffffc4;
}

/* 02. BASE (Stili base dei tag HTML) */
body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--brand-teal);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 03. TYPOGRAPHY & ICONS (Testi, Font, Pesi e Icone globali)*/
/* -- Icone Material -- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
}
.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1;
}

/* -- Dimensioni Testo Normalizzate (Text Size) -- */
.ts-32 { font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }
.ts-21 { font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; }
.ts-16 { font-size: 16px; line-height: 1.4; }
.ts-14 { font-size: 14px; line-height: 1.4; }
.ts-12 { font-size: 12px; line-height: 1.4; letter-spacing: 0.02em; }

/* -- Pesi Testo Normalizzati (Text Weight) -- */
.tw-light { font-weight: 300; }
.tw-medium  { font-weight: 500; }
.tw-bold  { font-weight: 700; }

/* 04. UTILITIES (Classi di "aiuto" usate ovunque: margini, colori testo, ecc.)*/
.text-brand-darker-teal{ color: var(--brand-dark-teal); }
.text-brand-dark-gray { color: var(--brand-dark-gray); }
.text-brand-coral { color: var(--brand-coral); }
.text-uppercase-tracked { text-transform: uppercase; letter-spacing: 0.1em; }

.mtop-8p { margin-top: 8px; }
.mtop-4p { margin-top: 4px; }
.mbottom-0 { margin-bottom: 0; }
.mbottom-8p { margin-bottom: 8px; }

.tab05 { padding-left: 0.5rem; }
.tab1 { padding-left: 1rem; }

.link-effect { text-decoration: underline; }
.line-height-default { line-height: 1; }

/* 05. LAYOUT (Struttura della pagina: Header, Main, Nav)*/
/* -- Header -- */
.app-header {
    background-color: var(--brand-teal);
    padding: 1rem 1.25rem;
    z-index: 1040;
    flex-shrink: 0;
}

.header-div { width: 100%; }

.header-badge {
    width: 50px;
    height: 50px;
    border: 2px solid var(--brand-dark-teal);
    color: var(--brand-dark-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-btn {
    width: 54px;
    height: 54px;
    background-color: var(--brand-dark-teal);
    color: var(--brand-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}
.header-btn:active { transform: scale(0.95); }
.header-btn svg {
    width: 1000%;
    height: 100%;
    display: block;
    transform: scale(1.25); 
    transform-origin: center;
}

/* -- Main Area (Slider/Pagine) -- */
#main-slider {
    display: block; 
    height: calc(100vh - 120px);
    overflow-y: auto; 
}
.slider-page {
    display: none; 
    width: 100%;
    padding-bottom: 2rem;
    animation: fadeIn 0.3s ease-out; 
}
.slider-page.active { display: block; }
.page-content { padding: 0.5rem 1.25rem 2rem; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -- Bottom Nav -- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background-color: rgba(197, 229, 227, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(70, 100, 98, 0.2);
    display: flex;
    z-index: 3100;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--brand-dark-teal);
    transition: all 0.3s;
    height: 100%;
    padding: 0;
}
.nav-btn.border-x {
    border-left: 1px solid rgba(70, 100, 98, 0.2);
    border-right: 1px solid rgba(70, 100, 98, 0.2);
}
.nav-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    transition: fill 0.3s;
}
.nav-btn.active {
    background-color: var(--brand-active-teal);
    color: var(--brand-darker-teal);
    
}
.nav-btn.active span{
    font-weight: 500;
}
.nav-btn.active svg {
    fill: currentColor;
}

#nav-language .material-symbols-outlined {
    transition: transform 0.3s ease;
    display: inline-block;
}

.nav-btn.is-open .material-symbols-outlined:last-child {
    transform: rotate(180deg);
}

/* 06. COMPONENTS (Card, Bottoni, Toggles, Selettori quantità)*/
/* -- Bottoni Standard -- */
.btn-coral {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--brand-coral);
    color: white;
    border: none;
    min-width: 80px;
    height: 30px; 
    border-radius: 999px;
    padding: 0 1.25rem; 
    transition: all 0.2s;
    cursor: pointer;
    line-height: 1; 
}
.btn-coral:active {
    transform: scale(0.95);
    background-color: var(--brand-dark-coral);
}

/* -- Bottoni Conferma Modal -- */
.box-buttons-confirm {
    display: flex;
    align-items:center;
    justify-content: center
}
.cancel-button-confirm {
    border: 1.5px solid var(--brand-dark-teal);
    color: var(--brand-dark-teal);
    border-radius: 999px;
    background: transparent;
    height: 34px; 
    min-width: 8rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
}
.confirm-button-confirm {
    border: 1.5px solid var(--brand-dark-teal);
    background-color: var(--brand-coral);
    color: white;
    border: none;
    border-radius: 999px;
    height: 34px; 
    min-width: 8rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

/* -- Stepper Quantità -- */
.card-action-row {
    display: flex;
    align-items: center;
    gap: 1rem; 
    flex-wrap: wrap; 
}
.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border: 1.5px solid var(--brand-dark-teal);
    border-radius: 999px;
    padding: 2px 8px;
    min-width: 105px;
    height: 30px;
}
.qty-btn {
    background: none;
    border: none;
    color: var(--brand-dark-teal);
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    padding: 0 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* -- Product Card -- */
.product-card {
    background-color: var(--surface-white);
    border-radius: 1.5rem;
    padding: 0;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex; 
    flex-direction: row; 
    align-items: stretch !important; 
}
.product-card > .flex-grow-1 {
    padding: 1.25rem 1rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; 
    flex: 1 1 auto;
}
.product-img-wrapper {
    width: 110px; 
    background: linear-gradient(to bottom, #ffffff, #ececec);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.glass-icon-badge {
    position: absolute;
    bottom: 10px;   /* Distanza dal basso */
    right: 10px;    /* Distanza da destra */
    width: 42px;   /* Dimensione del cerchietto */
    height: 42px;
    background-color: white;
    border-radius: 50%;
    display: none; /* Nascosto di default (modalità bottiglia) */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: scale(1.25); 
    z-index: 2;
}
.product-card.is-glass-mode .glass-icon-badge {
    display: block;
}

.glass-icon-badge svg {
    width: 100%;
    height: 100%;
}

/* Colori interni dell'SVG del calice */
.glass-icon-badge .cls-1 { fill: #ffffff; }
.glass-icon-badge .cls-2 { fill: var(--brand-dark-teal); }

.product-img-wrapper img {
    height: 120px; 
    max-height: 90%;
    width: auto;
    object-fit: fill;
    overflow: hidden;
    filter: drop-shadow(0px 5px 5px rgba(0,0,0,0.1));
}

/* -- Summary Card -- */
.summary-card {
    background-color: var(--surface-white);
    border-radius: 1.5rem;
    padding-left: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    overflow: hidden;
}
.summary-header {
    padding: 0.6rem;
    padding-left: 0.8rem;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}
.summary-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.summary-card.active .summary-content { max-height: 500px; }
.summary-card.active .chevron-icon { transform: rotate(180deg); }
.chevron-icon { transition: transform 0.3s; }

/* -- Service / Promo Cards -- */
.service-card {
    background-color: var(--service-yellow);
    border-radius: 1.5rem;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
}
.promo-card { border-radius: 0.75rem; padding: 1.5rem; }
.promo-coral { background-color: var(--brand-coral); color: white; }
.promo-teal { background-color: var(--brand-dark-teal); color: white; }
.promo-icon-bg {
    background-color: rgba(255,255,255,0.2);
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: inline-block;
    margin-bottom: 1rem;
}
.experience-img {
    width: 256px;
    height: 320px;
    border-radius: 1rem;
    object-fit: cover;
}

/* -- Language Toggle Switch -- */

.lang-card {
    background-color: var(--surface-white);
    border-radius: 1.5rem;
    padding: 1.5rem;
}
.toggle-switch {
    width: 48px;
    height: 24px;
    background-color: transparent;
    border: 1.5px solid var(--brand-dark-teal);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}
.toggle-switch.active { background-color: var(--brand-dark-teal); }
.toggle-knob {
    width: 18px;
    height: 18px;
    background-color: var(--brand-dark-teal);
    border-radius: 50%;
    position: absolute;
    top: 1.5px;
    left: 1.5px;
    transition: transform 0.3s, background-color 0.3s;
}
.toggle-switch.active .toggle-knob {
    transform: translateX(24px);
    background-color: var(--surface-white);
}

/* OVERLAYS E MODALS (Finestre sovrapposte, Popups)*/
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150; 
    background-color: var(--brand-teal);
    padding-top: 72px; 
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.custom-modal.show { transform: translateY(0); }

.btn-close-modal {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-left: auto;
    padding-right: 1rem;
}
body.modal-open #main-close-btn {
    display: block !important;
}

.language-overlay {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 4000; /* Valore molto alto per stare sopra la Bottom Nav (1030) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.language-overlay.show {
    opacity: 1;
    visibility: visible;
}

.language-sheet {
    background: var(--surface-white);
    border-radius: 2.5rem 2.5rem 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* "Impostarlo con un'altezza minima o fissa per coprire molto */
    min-height: 75vh; 
    padding-bottom: env(safe-area-inset-bottom);
}

.language-overlay.show .language-sheet {
    transform: translateY(0);
}
/*LOGICA TOGGLE */
.toggle-switch {
    width: 44px;
    height: 22px;
    background-color: transparent;
    border: 1.5px solid var(--brand-dark-teal); /* Bordino teal come in foto */
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-knob {
    width: 16px;
    height: 16px;
    background-color: var(--brand-dark-teal); /* Cerchietto teal */
    border-radius: 50%;
    position: absolute;
    top: 1.5px;
    left: 2px;
    transition: transform 0.3s, background-color 0.3s;
}

/* Quando il toggle è attivo (selezionato) */
.toggle-switch.active {
    background-color: var(--brand-dark-teal);
}

.toggle-switch.active .toggle-knob {
    transform: translateX(22px);
    background-color: white; /* Il cerchietto diventa bianco sullo sfondo teal */
}

/* Colore riga attiva */
.lang-row.selected span {
    color: var(--brand-dark-teal);
    font-weight: 600;
}


/* MEDIA QUERIES */
@media screen and (max-width: 380px) {
    .card-action-row {
        gap: 0.5rem; 
    }
    .qty-control {
        min-width: 90px; 
    }
    .btn-coral {
        min-width: 70px;
        padding: 0 1rem;
    }
}