/* ==========================================================
   REJNA - Stili comuni a tutto il sito
   Le classi con prefisso "r-" sono i componenti del nuovo
   sistema visivo; le altre restano per compatibilita' con le
   pagine esistenti (navbar admin, card, login, ...).
   ========================================================== */

/* ==========================
   RESET E BASE
   ========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--page-bg);
    color: var(--text-color-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.15;
    text-wrap: balance;
}

h4, h5, h6 {
    font-family: var(--font-main);
    font-weight: 700;
}

a {
    color: var(--forest);
}

a:hover {
    color: var(--forest-dark);
}

img {
    max-width: 100%;
}

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

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="search"], input[type="date"], input[type="url"],
select, textarea {
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--border-radius);
    background-color: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(45, 90, 69, 0.15);
}

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

/* Sulle superfici scure il contorno torna all'oro chiaro, che li' contrasta */
.r-promo,
.r-footer,
.r-cookie,
.navbar {
    --focus-ring: var(--gold);
}

/* "Vai al contenuto": primo elemento raggiungibile con Tab, visibile solo col focus */
.r-skip {
    position: absolute;
    left: 0.75rem;
    top: -100px;
    z-index: 1000;
    padding: 0.6rem 1rem;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    --focus-ring: var(--gold);
}
.r-skip:focus {
    top: 0.75rem;
}

table {
    border-collapse: collapse;
}

/* ==========================
   COMPONENTI DEL SISTEMA VISIVO
   ========================== */
.r-container {
    width: 100%;
    max-width: calc(var(--site-width) + 2 * var(--site-gutter));
    margin: 0 auto;
    padding-left: var(--site-gutter);
    padding-right: var(--site-gutter);
}

.r-serif {
    font-family: var(--font-serif);
    font-weight: 500;
}

.r-eyebrow {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gold-text);
}

.r-muted {
    color: var(--moss);
}

.r-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ---- Bottoni ---- */
.btn,
.r-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0 1.6rem;
    border-radius: var(--radius-pill);
    border: 0;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    background-color: var(--forest);
    color: #fff;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn:hover,
.r-btn:hover {
    background-color: var(--forest-dark);
    color: #fff;
}

.r-btn:active,
.btn:active {
    transform: translateY(1px);
}

.r-btn--ink { background-color: var(--ink); color: var(--paper); }
.r-btn--ink:hover { background-color: #26332C; color: var(--paper); }

.r-btn--ghost {
    background-color: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1.5px var(--ink);
}
.r-btn--ghost:hover { background-color: var(--ink); color: var(--paper); }

.r-btn--gold { background-color: var(--gold); color: var(--ink); }
.r-btn--gold:hover { background-color: #A5801F; color: var(--ink); }

.r-btn--light { background-color: var(--paper); color: var(--ink); }
.r-btn--light:hover { background-color: #fff; color: var(--ink); }

.r-btn--danger { background-color: var(--danger); color: #fff; }
.r-btn--danger:hover { background-color: var(--danger-dark); color: #fff; }

.r-btn--sm {
    min-height: 40px;
    padding: 0 1.1rem;
    font-size: 0.875rem;
}

.r-btn--block { width: 100%; }

.r-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    border: 0;
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.r-icon-btn:hover {
    background-color: var(--sage);
    color: var(--ink);
}

/* ---- Chip, pill, badge ---- */
.r-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.r-chip:hover { background: var(--sage); color: var(--ink); }

.r-chip.is-active,
.r-chip--on {
    background: var(--ink);
    color: var(--paper);
    box-shadow: none;
}

.r-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 26px;
    padding: 0 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--sage);
    color: var(--forest);
    white-space: nowrap;
}

.r-pill--gold { background: var(--gold-soft); color: var(--gold-deep); }
.r-pill--neutral { background: #EEF0EC; color: var(--moss); }
.r-pill--danger { background: var(--danger-soft); color: var(--danger-dark); }

.r-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 1;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    background: var(--ink);
    color: var(--paper);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
}

.r-stars {
    color: var(--gold);
    letter-spacing: 1px;
}

/* ---- Superfici ---- */
.r-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 var(--line);
    padding: clamp(1.25rem, 3vw, 2rem);
}

.r-hair {
    height: 1px;
    background: var(--line);
    border: 0;
}

/* ---- Spazio per foto/video (segnaposto elegante con logo in filigrana) ---- */
.r-media {
    position: relative;
    overflow: hidden;
    background: var(--sage-strong);
    display: flex;
    align-items: center;
    justify-content: center;
}

.r-media > img.r-media__img,
.r-media > video,
.r-media > picture,
.r-media > picture > img.r-media__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.r-media__wm {
    width: 34%;
    max-width: 160px;
    opacity: 0.08;
    pointer-events: none;
}

.r-media__tag {
    position: absolute;
    left: 12px;
    bottom: 12px;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--forest);
    background: rgba(255, 255, 255, 0.82);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-pill);
}

/* ---- Percorso di navigazione ---- */
.r-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--moss);
}

.r-breadcrumb a {
    color: var(--moss);
    text-decoration: none;
}

.r-breadcrumb a:hover { color: var(--ink); }

.r-breadcrumb [aria-current] {
    color: var(--ink);
    font-weight: 600;
}

.r-breadcrumb .r-icon {
    width: 14px;
    height: 14px;
}

/* ---- Intestazione di pagina ---- */
.r-page-head {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(1rem, 3vw, 1.75rem);
}

.r-page-head h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 400;
}

.r-page-head p {
    color: var(--moss);
    font-size: 1.05rem;
    max-width: 60ch;
}

.r-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.r-section-head h2 {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    font-weight: 400;
    margin-top: 0.4rem;
}

.r-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--forest);
}

.r-link-arrow .r-icon { width: 18px; height: 18px; transition: transform 0.2s ease; }
.r-link-arrow:hover .r-icon { transform: translateX(3px); }

/* ---- Messaggi ---- */
.r-alert {
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
    background: var(--sage);
    color: var(--forest-dark);
}

.r-alert--error { background: var(--danger-soft); color: var(--danger-dark); }
.r-alert--gold { background: var(--gold-soft); color: var(--gold-deep); }

/* Testo solo per screen reader */
.r-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================
   CARD PRODOTTO (catalogo, home, vetrina)
   ========================== */
.r-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
}

.r-pcard {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.r-pcard__media {
    display: flex;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    text-decoration: none;
}

.r-pcard__media img.r-media__img {
    transition: transform 0.5s ease;
}

.r-pcard:hover .r-pcard__media img.r-media__img {
    transform: scale(1.03);
}

.r-pcard__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.25rem;
    flex: 1;
}

.r-pcard__cat {
    font-size: 0.6875rem;
}

.r-pcard__name {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.3rem;
    line-height: 1.2;
}

.r-pcard__name a {
    color: var(--ink);
    text-decoration: none;
}

.r-pcard__name a:hover { color: var(--forest); }

.r-pcard__desc {
    color: var(--moss);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.r-pcard__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.r-price {
    font-weight: 800;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.r-price small {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--moss);
}

.r-pcard__add {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-pill);
    background: var(--forest);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.r-pcard__add:hover { background: var(--forest-dark); color: #fff; }
.r-pcard__add .r-icon { width: 19px; height: 19px; }

@keyframes rCardRise {
    from { opacity: 0.001; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.r-rise {
    animation: rCardRise 0.45s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .r-rise { animation: none; }
    .r-pcard:hover .r-pcard__media img.r-media__img { transform: none; }
}

@media (max-width: 1100px) {
    .r-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .r-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.75rem; }
    .r-pcard__name { font-size: 1.1rem; }
    .r-pcard__desc { display: none; }
}

/* ==========================
   HEADER DEL SITO (fragments/header.html)
   ========================== */
.r-promo {
    background: var(--ink);
    color: #E6ECE3;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.4rem var(--site-gutter);
    text-align: center;
}

.r-promo__dot { color: var(--gold); }

.r-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface-alt);
    border-bottom: 1px solid #E1E6DE;
}

.r-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 80px;
}

.r-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
}

.r-header__brand:hover { color: var(--ink); }

/* Logo con scritta (albero + REJNA COSMETICS): l'altezza decide tutto,
   la larghezza segue le proporzioni dell'immagine */
.r-header__logo {
    display: block;
    width: auto;
    height: 60px;
}

.r-header__nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.4vw, 2.1rem);
}

.r-header__nav a {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    text-decoration: none;
    padding: 0.35rem 0;
    box-shadow: inset 0 -2px 0 transparent;
    transition: box-shadow 0.2s ease;
}

.r-header__nav a:hover,
.r-header__nav a.is-active {
    box-shadow: inset 0 -2px 0 var(--gold);
    color: var(--ink);
}

.r-header__tools {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.r-header__count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    background: var(--gold);
    color: var(--ink);
    font-size: 0.6875rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.r-header__admin {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 36px;
    padding: 0 0.9rem;
    margin-right: 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--gold-soft);
    color: var(--gold-deep);
    font-weight: 700;
    font-size: 0.8125rem;
    text-decoration: none;
}

.r-header__admin:hover { background: var(--gold); color: var(--ink); }
.r-header__admin .r-icon { width: 17px; height: 17px; }

.r-header__logout {
    margin: 0;
}

.r-header__menu-btn { display: none; }

/* Selettore lingua (usa js/language-selector.js) */
.r-header .language-selector {
    position: relative;
    margin: 0;
}

.r-header .lang-dropdown-btn {
    height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.7rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
}

.r-header .lang-dropdown-btn:hover { background: var(--sage); }
.r-header .lang-dropdown-btn .r-icon { width: 20px; height: 20px; }

.r-header .lang-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lift);
    padding: 0.4rem;
    z-index: 1001;
}

.r-header .language-selector.open .lang-dropdown-content { display: block; }

.r-header .lang-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.r-header .lang-dropdown-content a:hover { background: var(--paper); }
.r-header .lang-dropdown-content a.active { background: var(--sage); color: var(--forest-dark); font-weight: 700; }

.r-header .fi {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(22, 32, 27, 0.08);
}

/* Menu mobile a scomparsa */
.r-drawer {
    display: none;
}

/* Schermi medi: voci del menu piu' vicine, cosi' restano su una riga
   anche con "I miei ordini" e le icone dell'account */
@media (min-width: 1025px) and (max-width: 1240px) {
    .r-header__nav { gap: 0.9rem; }
    .r-header__nav a { font-size: 0.875rem; }
    .r-header__bar { gap: 1rem; }
    .r-header__logo { height: 52px; }
    .r-header__admin { padding: 0 0.6rem; }
    /* Admin: solo l'icona, la scritta resta per i lettori di schermo */
    .r-header__admin span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (max-width: 1024px) {
    .r-header__nav,
    .r-header__tools .r-hide-mobile {
        display: none;
    }

    .r-header__menu-btn { display: inline-flex; }

    .r-header__bar {
        min-height: 64px;
        gap: 0.5rem;
    }

    .r-header__logo { height: 44px; }

    .r-promo { font-size: 0.75rem; gap: 0.75rem; min-height: 34px; }
    .r-promo .r-promo__extra { display: none; }

    .r-drawer.is-open {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem var(--site-gutter) 1.25rem;
        border-top: 1px solid var(--line);
        background: var(--surface-alt);
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .r-drawer a,
    .r-drawer button.r-drawer__link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-height: 48px;
        padding: 0 0.5rem;
        border-radius: var(--radius-sm);
        color: var(--ink);
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        background: none;
        border: 0;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }

    .r-drawer a:hover,
    .r-drawer button.r-drawer__link:hover { background: var(--sage); }

    .r-drawer__langs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 0.5rem 0;
    }

    .r-drawer__langs a {
        min-height: 38px;
        width: auto;
        padding: 0 0.8rem;
        border-radius: var(--radius-pill);
        box-shadow: inset 0 0 0 1px var(--line-strong);
        font-size: 0.875rem;
    }

    .r-drawer__langs a.active { background: var(--ink); color: var(--paper); box-shadow: none; }
}

/* ==========================
   FOOTER DEL SITO (fragments/footer.html)
   ========================== */
.r-footer {
    background: var(--ink);
    color: #C9D2C6;
    margin-top: clamp(3rem, 6vw, 5rem);
    padding: clamp(2.5rem, 6vw, 4rem) 0 2rem;
}

.r-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2.5rem;
}

.r-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 320px;
}

.r-footer__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--paper);
    text-decoration: none;
}

/* Versione chiara del logo con scritta, gia' bianca e oro: nessun filtro */
.r-footer__logo img {
    display: block;
    width: auto;
    height: 64px;
}

.r-footer__brand p {
    font-size: 0.875rem;
    line-height: 1.6;
}

.r-footer__col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.r-footer__col .r-eyebrow { color: var(--gold); margin-bottom: 0.25rem; }

.r-footer a {
    color: #C9D2C6;
    font-size: 0.875rem;
    text-decoration: none;
}

.r-footer a:hover { color: #fff; }

.r-footer__social {
    display: flex;
    gap: 0.4rem;
}

.r-footer__social a {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-pill);
    box-shadow: inset 0 0 0 1px #3A463F;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--paper);
}

.r-footer__social a:hover { background: #26332C; }
.r-footer__social .r-icon { width: 19px; height: 19px; }

.r-footer__bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2C3832;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
}

.r-footer__trust {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.r-footer__trust .r-icon { width: 18px; height: 18px; }

@media (max-width: 900px) {
    .r-footer__grid { grid-template-columns: 1fr 1fr; }
    .r-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .r-footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ==========================
   NAVBAR (area admin e pagine non ancora migrate)
   ========================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 5%;
    background-color: var(--nav-bg);
    color: var(--text-color-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 0.75rem;
}

/* Barra admin scura: si usa l'albero chiaro (logo_circle_light.png) */
.navbar .logo {
    height: clamp(38px, 6vw, 52px);
}

.navbar .left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.navbar .left p {
    margin: 0;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    color: var(--text-color-light);
}

.cart-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(0.85rem, 2vw, 1rem);
    background: rgba(255, 255, 255, 0.12);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.cart-badge:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.navbar .right {
    display: flex;
    align-items: center;
}

.navbar .right a {
    color: var(--text-color-light);
    text-decoration: none;
    margin-left: var(--spacing);
    font-weight: 600;
    font-size: clamp(0.875rem, 1.6vw, 0.95rem);
    transition: color 0.2s ease;
}

.navbar .right a:hover {
    color: #D9BD6A;
}

.navbar .right form {
    margin-left: var(--spacing);
}

.logout-btn,
.navbar .right form button {
    background-color: var(--forest);
    color: var(--text-color-light);
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.5rem 1rem;
    font-size: clamp(0.85rem, 1.8vw, 0.9rem);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.logout-btn:hover,
.navbar .right form button:hover {
    background-color: var(--forest-light);
}

.btn-home-top {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 1rem;
    border-radius: var(--radius-pill);
    background: var(--forest);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.8vw, 0.9rem);
    transition: background 0.2s ease;
}

.btn-home-top:hover {
    background: var(--forest-light);
    color: #fff;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    padding: 0.25rem;
    flex-shrink: 0;
}

.navbar .language-selector {
    position: relative;
    display: inline-block;
    margin-left: var(--spacing);
}

.navbar .lang-dropdown-btn {
    background-color: transparent;
    color: var(--text-color-light);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.7rem;
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    /* senza "all": il contorno del focus deve comparire subito */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.navbar .lang-dropdown-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar .lang-dropdown-btn .arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.navbar .language-selector.open .arrow {
    transform: rotate(180deg);
}

.navbar .lang-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    min-width: 170px;
    box-shadow: var(--shadow-lift);
    border-radius: var(--radius-md);
    margin-top: 0.4rem;
    overflow: hidden;
    z-index: 1001;
    padding: 0.35rem;
}

.navbar .language-selector.open .lang-dropdown-content {
    display: block;
}

.navbar .lang-dropdown-content a {
    color: var(--text-color-dark) !important;
    padding: 0.55rem 0.8rem;
    text-decoration: none;
    display: block;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
    font-size: 0.9rem;
    margin: 0 !important;
}

.navbar .lang-dropdown-content a:hover {
    background-color: var(--paper);
}

.navbar .lang-dropdown-content a.active {
    background-color: var(--sage);
    color: var(--forest-dark) !important;
    font-weight: 700;
}

.language-selector .fi {
    font-size: 1.15em;
    margin-right: 0.4rem;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 0.6rem 4%;
    }

    .hamburger {
        display: block;
    }

    .cart-badge {
        margin-left: auto;
    }

    .navbar .right {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 0.5rem;
        background-color: var(--nav-bg);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.5rem;
    }

    .navbar .right.show {
        display: flex;
    }

    .navbar .right a,
    .navbar .right form button {
        margin: 0;
        width: 100%;
        text-align: left;
        padding: 0.65rem 1rem;
        font-size: 1rem;
    }

    .navbar .right form {
        margin-left: 0;
        width: 100%;
    }

    .navbar .right form button {
        border-radius: 0;
        background: transparent;
    }

    .navbar .right form button:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .navbar .language-selector {
        width: 100%;
        margin: 0;
    }

    .navbar .lang-dropdown-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0.65rem 1rem;
        border: none;
        border-radius: 0;
    }

    .navbar .lang-dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        margin-top: 0;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 3%;
    }

    .cart-badge {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* ==========================
   CARD / FORM LOGIN (compatibilita')
   ========================== */
.login-container {
    max-width: 420px;
    margin: 5% auto;
    padding: 2rem;
    background-color: var(--card-bg);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-lg);
}

.login-container h2 {
    margin-bottom: var(--spacing);
    color: var(--text-color-dark);
    font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.login-container input,
.login-container button {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.login-container button {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-container button:hover {
    background-color: var(--primary-hover);
}

.login-container .error,
.login-container .logout {
    color: var(--danger-color);
    margin-bottom: 1rem;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
}

/* ==========================
   CONTENUTO PRINCIPALE (compatibilita')
   ========================== */
.content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    padding: var(--spacing);
}

.card {
    background-color: var(--card-bg);
    box-shadow: 0 1px 0 var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 2rem);
    width: 100%;
    max-width: 880px;
    transition: box-shadow 0.2s ease;
}

.card h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    margin-bottom: 0.75rem;
}

.card p {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-bottom: 0.75rem;
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card ul li {
    margin-bottom: 0.5rem;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

@media (max-width: 768px) {
    .card {
        max-width: 100%;
    }

    .content {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 0.5rem;
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }
}

/* Stelle nella card prodotto (media voti) */
.r-pcard__rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--moss);
}

.r-pcard__rating .r-stars {
    font-size: 0.875rem;
}
