/* ==========================================================================
   MigliorCashback.it - Components
   ========================================================================== */

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    min-height: 48px; /* touch-friendly */
    padding: 12px 24px;
    font-size: var(--font-size-base);
    line-height: 1;
}

.btn:active {
    transform: scale(0.97);
}

/* Sizes */
.btn-sm {
    min-height: 40px;
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

.btn-lg {
    min-height: 56px;
    padding: 16px 32px;
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
}

/* Variants */
.btn-primary {
    background: var(--color-cashback);
    color: var(--color-white);
    border-color: var(--color-cashback);
}

.btn-primary:hover {
    background: var(--color-cashback-dark);
    border-color: var(--color-cashback-dark);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-cashback);
    color: var(--color-cashback);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

/* Disabled */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Promise Cards ──────────────────────────────────────────────── */
.promise-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--color-border-light);
    transition: box-shadow 0.2s;
}

.promise-card:hover {
    box-shadow: var(--shadow-md);
}

.promise-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.promise-icon-green {
    background: var(--color-cashback-light);
    color: var(--color-cashback);
}

.promise-icon-accent {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.promise-icon-teal {
    background: #e0f7fa;
    color: #00897b;
}

.promise-title {
    font-size: var(--font-size-lg);
    margin-bottom: 8px;
}

.promise-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ── Form fields ────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text-primary);
}

.form-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    font-size: var(--font-size-base);
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--color-cashback);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--color-coral);
    margin-top: 4px;
}

/* ── Checkbox / Toggle ──────────────────────────────────────────── */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--color-cashback);
}

/* ── Card general ───────────────────────────────────────────────── */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 20px;
    transition: box-shadow 0.2s;
}

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    box-shadow: var(--shadow-md);
}

/* ── Badge ──────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1;
}

.badge-cashback {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
}

.badge-super {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.badge-new {
    background: var(--color-coral-light);
    color: var(--color-coral);
}

/* ── Chip (categorie) ───────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
}

.chip:hover,
.chip-active {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    border-color: var(--color-cashback);
}

/* ── Flash messages ─────────────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: 16px;
}

.flash-success {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
}

.flash-error {
    background: var(--color-coral-light);
    color: var(--color-coral);
}

/* ── Link ──────────────────────────────────────────────────────────── */
.link {
    color: var(--color-cashback);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link:hover {
    color: var(--color-cashback-dark);
}

/* ── Form row (affiancamento) ──────────────────────────────────────── */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 0;
}

@media (min-width: 480px) {
    .form-row {
        flex-direction: row;
        gap: 12px;
    }
    .form-row .form-group {
        flex: 1;
    }
}

.form-consents {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* ── Button block ──────────────────────────────────────────────────── */
.btn-block {
    width: 100%;
}

/* ── Auth pages (login / register) ─────────────────────────────────── */
.auth-page {
    padding: 40px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: calc(100vh - 56px - 180px);
}

.auth-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 32px 24px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-sm);
}

.auth-card-sm {
    max-width: 420px;
}

.auth-title {
    font-size: var(--font-size-2xl);
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    font-size: var(--font-size-sm);
}

.auth-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ── Header logout form ────────────────────────────────────────────── */
/* ── Dashboard ─────────────────────────────────────────────────────── */
.dashboard {
    width: 100%;
    max-width: 100%;
    padding: 24px 0 48px;
}

@media (max-width: 767px) {
    .dashboard {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.dashboard-header {
    margin-bottom: 24px;
}

/* ── Pagina segnalazione cashback più alto (scoped) ───────────────── */
.page-higher-cashback-create {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.page-higher-cashback-create .form-row {
    gap: 24px;
}

@media (max-width: 768px) {
    .page-higher-cashback-create {
        padding: 20px 16px;
    }

    .page-higher-cashback-create .form-row {
        gap: 0;
    }
}

.dashboard-greeting {
    font-size: var(--font-size-2xl);
    margin-bottom: 4px;
}

.dashboard-email {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.dashboard-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.dashboard-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-active {
    background: var(--color-cashback-light);
    color: var(--color-cashback);
}

.icon-pending {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
}

.icon-wallet {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.dashboard-card-body {
    flex: 1;
}

.dashboard-card-body h3 {
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.status-active {
    font-size: var(--font-size-sm);
    color: var(--color-cashback);
    font-weight: 600;
}

.status-pending {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.status-error {
    font-size: var(--font-size-sm);
    color: var(--color-coral);
}

.wallet-row {
    display: flex;
    gap: 24px;
    margin: 12px 0;
}

.wallet-item {
    display: flex;
    flex-direction: column;
}

.wallet-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.wallet-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.wallet-value-confirmed {
    color: var(--color-cashback);
}

.wallet-value-pending {
    color: var(--color-text-secondary);
}

.wallet-placeholder-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 8px;
}

.dashboard-actions {
    margin-top: 24px;
}

/* ── Section (generica) ───────────────────────────────────────────── */
.section {
    padding: 32px 16px;
    --section-inner-px: 16px;
}

.section-highlight {
    background: var(--color-cashback-light);
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: var(--font-size-xl);
    margin-bottom: 20px;
}

/* ── Gufy section icons ───────────────────────────────────── */
.section-title-gufy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.section-title-gufy img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.section-title-gufy:hover img {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (max-width: 767px) {
    .section-title-gufy img {
        width: 26px;
        height: 26px;
    }
}

.section-title-sm {
    font-size: var(--font-size-lg);
    margin-bottom: 16px;
}
.section-subtitle-sm {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}
html.dark-mode .section-subtitle-sm {
    color: #94a3b8;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

/* ── Hero search ──────────────────────────────────────────────────── */
.hero-search {
    margin-bottom: 24px;
}

.hero-search-form {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.hero-search-input {
    flex: 1;
}

/* ── Mobile Command Bar (compatto a due stati + breadcrumb) ─── */
.mobile-cmd-bar {
    display: none;
}

.mobile-cmd-spacer {
    display: none;
}

@media (max-width: 767px) {
    /* Nascondi header top solo sul frontend pubblico */
    .public-layout .site-header {
        display: none;
    }

    /* Nascondi breadcrumb in-page (spostato nella command bar) */
    .public-layout .breadcrumb {
        display: none;
    }

    /* ── Contenitore principale ────────────────────────────── */
    .mobile-cmd-bar {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        bottom: 0;
        bottom: env(safe-area-inset-bottom);
        z-index: 350;
        background: transparent;
    }

    .mobile-cmd-body {
        background: var(--color-cashback);
        box-shadow: 0 -6px 20px rgba(0, 184, 148, 0.3);
    }

    /* ── Breadcrumb mobile (thin strip) ────────────────────── */
    .mobile-cmd-breadcrumb {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid var(--color-border-light);
        padding: 0 12px;
        background: var(--color-bg);
        box-sizing: border-box;
        max-width: 100%;
    }

    .mobile-cmd-breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .mobile-cmd-breadcrumb-list {
        display: flex;
        align-items: center;
        gap: 4px;
        height: 28px;
        font-size: 11px;
        white-space: nowrap;
        color: var(--color-text-muted);
    }

    .mobile-cmd-breadcrumb-item a {
        color: var(--color-text-secondary);
        text-decoration: none;
    }

    .mobile-cmd-breadcrumb-item a:hover {
        color: var(--color-cashback);
    }

    .mobile-cmd-breadcrumb-item span[aria-current="page"] {
        color: var(--color-text-primary);
        font-weight: 600;
    }

    .mobile-cmd-breadcrumb-item:not(:last-child)::after {
        content: "/";
        margin-left: 4px;
        color: var(--color-text-muted);
        opacity: 0.4;
    }

    /* ── Barra principale — stato normale ───────────────────── */
    .mobile-cmd-main {
        position: relative;
        max-width: 480px;
        margin: 0 auto;
    }

    .mobile-cmd-normal {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 12px;
        gap: 6px;
    }

    /* ── Pulsanti icona sinistra ────────────────────────────── */
    .mobile-cmd-actions-left {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .mobile-command-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.15);
        color: var(--color-white);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        transition:
            background 0.15s ease,
            border-color 0.15s ease,
            transform 0.12s ease;
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }

    .mobile-command-icon:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .mobile-command-icon:active {
        transform: scale(0.92);
    }

    /* ── Logo MC premium bianco (centrato assoluto forzato) ─── */
    .mobile-command-logo-mark {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        width: 52px;
        height: 52px;
        border-radius: 999px;
        background: #fff;
        border: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-weight: 900;
        font-size: 18px;
        letter-spacing: -0.07em;
        line-height: 1;
        transition:
            transform 0.15s ease,
            box-shadow 0.15s ease;
        flex-shrink: 0;
    }

    .mobile-command-logo-mark:active {
        transform: translate(-50%, -50%) scale(0.93);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .mobile-command-logo-mark:focus-visible {
        outline: 2px solid var(--color-cashback);
        outline-offset: 3px;
    }

    /* ── Pulsanti destra ────────────────────────────────────── */
    .mobile-cmd-actions-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    /* ── Account popover ─────────────────────────────────────── */
    .mobile-account-menu {
        position: absolute;
        bottom: calc(100% + 8px);
        left: 12px;
        z-index: 9;
        min-width: 170px;
        background: #fff;
        border: 1px solid var(--color-border);
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
        padding: 6px;
        overflow: hidden;
        animation: accountMenuIn 0.18s ease;
    }

    .mobile-account-menu[hidden] {
        display: none;
    }

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

    .mobile-account-menu-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        color: var(--color-text-primary);
        text-decoration: none;
        cursor: pointer;
        background: none;
        border: none;
        width: 100%;
        text-align: left;
        font-family: inherit;
        line-height: 1;
        transition: background 0.12s ease;
    }

    .mobile-account-menu-item:hover {
        background: var(--color-bg);
    }

    .mobile-account-menu-item:active {
        background: var(--color-border-light);
    }

    .mobile-account-menu-register {
        color: var(--color-cashback);
        font-weight: 700;
    }

    .mobile-account-menu-logout {
        color: var(--color-coral);
    }

    .mobile-account-menu-form {
        margin: 0;
    }

    .mobile-account-menu-item svg {
        flex-shrink: 0;
    }

    /* ── Stato ricerca aperta ───────────────────────────────── */
    .mobile-cmd-search {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        background: var(--color-cashback);
        z-index: 10;
        padding: 0 8px;
    }

    .mobile-cmd-search-form {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .mobile-cmd-search-icon {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--color-white);
        cursor: pointer;
        padding: 0;
    }

    .mobile-cmd-search-input {
        flex: 1;
        height: 38px;
        border: none;
        border-radius: 0;
        background: transparent;
        font-size: 16px;
        color: var(--color-white);
        outline: none;
        padding: 0;
        -webkit-appearance: none;
    }

    .mobile-cmd-search-input::placeholder {
        color: rgba(255, 255, 255, 0.55);
    }

    .mobile-cmd-search-close {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.15);
        color: var(--color-white);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        border: none;
        transition: background 0.15s ease;
    }

    .mobile-cmd-search-close:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .mobile-cmd-search-close:active {
        transform: scale(0.92);
    }

    /* ── Transizioni di apertura/chiusura ricerca ──────────── */
    .mobile-cmd-search[hidden] {
        display: none;
    }

    .mobile-cmd-search:not([hidden]) {
        animation: cmdSearchIn 0.2s ease;
    }

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

    /* ── Schermi molto stretti (< 360px) ────────────────────── */
    @media (max-width: 360px) {
        .mobile-cmd-normal {
            height: 52px;
            gap: 3px;
            padding: 0 8px;
        }
        .mobile-command-icon {
            width: 44px;
            height: 44px;
            border-radius: 14px;
        }
        .mobile-command-logo-mark {
            width: 48px;
            height: 48px;
            font-size: 17px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        .mobile-cmd-actions-right {
            gap: 6px;
        }
        .mobile-cmd-actions-left {
            gap: 0;
        }
        .mobile-account-menu {
            left: 8px;
            min-width: 150px;
        }
    }

    /* Nascondi la ricerca nell'hero su mobile */
    .hero-search {
        display: none;
    }

    /* Spacer per la command bar (28px breadcrumb + 56px barra) */
    .mobile-cmd-spacer {
        display: block;
        height: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Merchant Card — Layout unico premium ────────────────────────── */
/* Stessa card identica in homepage/carousel/listing/negozi simili */
.merchant-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    transition:
        box-shadow 0.2s,
        transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

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

/* ── Category Background ├╦ la card parte da qui ──────────────── */
.merchant-card-bg {
    position: relative;
    display: block;
    width: 100%;
    height: 160px;
    min-height: 160px;
    margin: 0;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.merchant-card-bg-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.merchant-card-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.25) 100%
    );
    pointer-events: none;
}

/* ── Logo overlay ──────────────────────────────────────────────── */
.merchant-card-logo {
    position: relative;
    z-index: 2;
    width: 180px;
    height: 88px;
    margin: -44px auto 18px auto;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--color-white);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.merchant-card-logo img {
    display: block;
    max-width: 92%;
    max-height: 82%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.merchant-card-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92%;
    max-height: 82%;
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    background: transparent;
}

@media (max-width: 767px) {
    .merchant-card-logo {
        width: 160px;
        height: 78px;
        margin: -39px auto 16px auto;
        padding: 9px 12px;
    }
}

/* ── Body categoria/meta ────────────────────────────────────────── */
.merchant-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 2px 20px 14px;
    text-align: center;
    flex: 1;
}

.merchant-card-name {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text-primary);
}

.merchant-card-category {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.3;
}

/* ── Meta info ─────────────────────────────────────────────────── */
.merchant-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    margin-top: 4px;
    min-height: 18px;
}

.merchant-card-meta-item {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.4;
    white-space: nowrap;
}

/* ── Cashback in fondo ─────────────────────────────────────────── */
.merchant-card-cashback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 18px 20px 16px;
    gap: 2px;
    border-top: 1px solid var(--color-border-light);
    flex-shrink: 0;
    margin-top: auto;
}

.cashback-percent {
    display: block;
    font-size: 40px;
    font-weight: 900;
    color: var(--color-cashback);
    line-height: 1;
    white-space: nowrap;
    letter-spacing: -1px;
}

.cashback-percent small {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.cashback-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1;
    min-height: 16px;
}

.merchant-card-badge-row {
    min-height: 28px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.merchant-card-badge-row--empty {
    visibility: hidden;
}

.badge-super {
    margin-top: 0;
}

.merchant-card-rating {
    margin-top: 3px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.merchant-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    line-height: 1.2;
}

.merchant-rating-stars {
    color: #f59e0b;
    letter-spacing: 1px;
    font-size: 14px;
}

.merchant-rating-value {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 13px;
}

/* ── Merchant Card Compact (lista verticale per 1-3 elementi) ──── */
.home-mobile-merchant-list-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.merchant-card-compact {
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px 12px !important;
    border-radius: 18px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text-primary);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 4px !important;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.merchant-card-compact:hover,
.merchant-card-compact:focus-visible {
    border-color: var(--color-cashback);
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.15);
    outline: none;
}

.merchant-card-compact:active {
    background: var(--color-bg);
}

.mcc-logo {
    width: 120px !important;
    height: 120px !important;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-white);
}

.mcc-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mcc-logo-placeholder {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    background: var(--color-white);
    border-radius: 14px;
}

.mcc-info {
    min-width: 0;
    text-align: center;
    width: 100%;
}

.mcc-name {
    display: none;
}

.mcc-category {
    font-size: 14px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.mcc-cashback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.mcc-cashback .cashback-percent {
    font-size: 20px;
    font-weight: 900;
    color: var(--color-cashback);
    line-height: 1;
    white-space: nowrap;
}

.mcc-cashback .cashback-percent small {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.mcc-cashback .badge-super {
    font-size: 10px;
    padding: 2px 6px;
    line-height: 1.2;
}

/* Schermi molto piccoli: compact card rimpicciolita */
@media (max-width: 360px) {
    .merchant-card-compact {
        min-height: 0;
        padding: 8px;
        gap: 3px;
    }

    .mcc-logo {
        width: 84px;
        height: 84px;
        border-radius: 12px;
    }

    .mcc-logo-placeholder {
        width: 84px;
        height: 84px;
        border-radius: 12px;
    }

    .mcc-cashback .cashback-percent {
        font-size: 17px;
    }
}

/* ── Similar Merchants Card Variant (sezione "Negozi simili") ──── */
/* Card pulita senza immagine categoria di sfondo, logo protagonista */
.merchant-card--similar {
    padding-top: 28px;
    border-radius: 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.merchant-card--similar:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.merchant-card--similar .merchant-card-bg {
    display: none !important;
}

.merchant-card--similar .merchant-card-logo {
    position: relative;
    z-index: 1;
    width: 140px;
    height: 80px;
    margin: 0 auto 14px;
    padding: 12px;
    border-radius: 14px;
    background: var(--color-white);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.merchant-card--similar .merchant-card-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.merchant-card--similar .merchant-card-body {
    padding: 0 20px 8px;
    gap: 2px;
    flex: 0 0 auto;
}

.merchant-card--similar .merchant-card-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.merchant-card--similar .merchant-card-rating {
    margin-top: 0;
    min-height: 20px;
}

.merchant-card--similar .merchant-card-meta {
    gap: 3px 8px;
    margin-top: 2px;
    min-height: 0;
}

.merchant-card--similar .merchant-card-meta-item {
    font-size: 10px;
}

.merchant-card--similar .merchant-card-cashback {
    padding: 10px 20px 12px;
    gap: 1px;
}

.merchant-card--similar .cashback-percent {
    font-size: 30px;
}

.merchant-card--similar .cashback-label {
    font-size: 10px;
    letter-spacing: 1.2px;
}

.merchant-card--similar .merchant-card-badge-row {
    min-height: 20px;
    margin-top: 3px;
}

@media (max-width: 767px) {
    .merchant-card--similar {
        padding-top: 24px;
    }

    .merchant-card--similar .merchant-card-logo {
        width: 120px;
        height: 70px;
        margin: 0 auto 12px;
        padding: 10px;
    }

    .merchant-card--similar .cashback-percent {
        font-size: 26px;
    }

    .merchant-card--similar .merchant-card-cashback {
        padding: 8px 16px 10px;
    }

    .merchant-card--similar .merchant-card-body {
        padding: 0 16px 6px;
    }
}

@media (max-width: 480px) {
    .merchant-card--similar {
        padding-top: 18px;
    }

    .merchant-card--similar .merchant-card-logo {
        width: 100px;
        height: 60px;
        margin: 0 auto 10px;
        padding: 8px;
    }

    .merchant-card--similar .merchant-card-logo img {
        max-width: 95%;
        max-height: 90%;
    }

    .merchant-card--similar .cashback-percent {
        font-size: 22px;
    }
}

/* ── Merchant Card Mobile (compatta per paged carousel 2×2) ────── */
.merchant-card-mobile {
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px !important;
    border-radius: 20px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text-primary);
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.merchant-card-mobile:hover,
.merchant-card-mobile:focus-visible {
    border-color: var(--color-cashback);
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.15);
    outline: none;
}

.merchant-card-mobile:active {
    background: var(--color-bg);
}

.mcm-logo {
    width: 100px !important;
    height: 100px !important;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-white);
    align-self: center;
}

.mcm-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mcm-logo-placeholder {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    background: var(--color-white);
    border-radius: 16px;
}

.mcm-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: center;
    align-items: center;
    width: 100%;
}

.mcm-name {
    display: none;
}

.mcm-category {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcm-cashback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-top: 0;
}

.mcm-cashback .cashback-percent {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-cashback);
    line-height: 1;
}

.mcm-cashback .cashback-percent small {
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.mcm-cashback .badge-super {
    font-size: 10px;
    padding: 2px 6px;
    line-height: 1.2;
}

/* Schermi molto piccoli: merchant card compatta */
@media (max-width: 360px) {
    .merchant-card-mobile {
        min-height: 0;
        padding: 8px;
    }

    .mcm-logo {
        width: 70px;
        height: 70px;
    }

    .mcm-logo-placeholder {
        width: 70px;
        height: 70px;
        font-size: 0.8125rem;
    }

    .mcm-cashback .cashback-percent {
        font-size: var(--font-size-base);
    }
}

/* ── Merchant Carousel / Grid Responsive ─────────────────────────── */
.merchant-carousel-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 8px;
    margin-left: calc(-1 * var(--section-inner-px, 16px));
    margin-right: calc(-1 * var(--section-inner-px, 16px));
    padding-left: var(--section-inner-px, 16px);
    padding-right: var(--section-inner-px, 16px);
}

.merchant-carousel-scroll::-webkit-scrollbar {
    display: none;
}

.merchant-carousel-scroll .merchant-card {
    flex: 0 0 auto;
    width: 275px;
    scroll-snap-align: start;
}

/* Mobile: nascondi grid desktop dentro sezioni con paged carousel */
@media (max-width: 767px) {
    .merchant-carousel-scroll {
        display: none;
    }
}

.merchant-grid,
.merchant-grid-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .merchant-grid,
    .merchant-grid-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1100px) {
    .merchant-grid,
    .merchant-grid-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* Desktop: passa a grid */
@media (min-width: 768px) {
    .merchant-carousel-scroll {
        display: grid;
        gap: 12px;
        overflow: visible;
        scroll-snap-type: none;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        scrollbar-width: auto;
    }

    .merchant-carousel-scroll .merchant-card {
        width: auto;
        scroll-snap-align: none;
    }

    .merchant-carousel-scroll {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1100px) {
    .merchant-carousel-scroll {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Listing page ────────────────────────────────────────────────── */
.listing-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

.listing-header {
    margin-bottom: 24px;
}

.listing-title {
    font-size: var(--font-size-2xl);
    margin-bottom: 4px;
}

.listing-count,
.listing-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.listing-description {
    margin-bottom: 8px;
}

/* ── Sort bar ──────────────────────────────────────────────────── */
.listing-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.listing-sort-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.listing-sort-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.listing-sort-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 20px;
    text-decoration: none;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
    cursor: pointer;
    line-height: 1.3;
}

.listing-sort-btn:hover {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    border-color: var(--color-cashback);
}

.listing-sort-btn.is-active {
    background: var(--color-cashback);
    color: var(--color-white);
    border-color: var(--color-cashback);
    font-weight: 600;
}

.listing-sort-btn.is-active:hover {
    background: var(--color-cashback-dark);
    border-color: var(--color-cashback-dark);
}

.listing-sort-btn:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: 2px;
}

.listing-filters {
    margin-bottom: 24px;
}

.listing-filter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 640px) {
    .listing-filter-form {
        flex-direction: row;
        align-items: center;
    }
    .listing-filter-form .form-input {
        flex: 1;
        min-width: 150px;
    }
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ── Pagination (category pages) ──────────────────────────────────── */
.category-pagination {
    margin-top: 32px;
    margin-bottom: 8px;
}

.pagination-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
}

@media (min-width: 640px) {
    .pagination-list {
        display: flex;
    }
}

.pagination-item {
    margin: 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #1f2937);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s;
    line-height: 1;
    white-space: nowrap;
}

.pagination-link:hover {
    background: var(--color-bg-hover, #f3f4f6);
    border-color: var(--color-border-hover, #9ca3af);
    color: var(--color-text, #1f2937);
}

.pagination-link--active {
    background: var(--color-primary, #00b894);
    border-color: var(--color-primary, #00b894);
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.pagination-link--active:hover {
    background: var(--color-primary-hover, #00a37e);
    border-color: var(--color-primary-hover, #00a37e);
    color: #fff;
}

.pagination-link--nav {
    gap: 4px;
    padding: 0 12px;
}

.pagination-arrow {
    font-size: 0.75rem;
    line-height: 1;
}

.pagination-label {
    font-size: 0.875rem;
}

.pagination-item--ellipsis {
    padding: 0 4px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--color-text-secondary, #6b7280);
    font-size: 0.875rem;
    user-select: none;
}

/* Paginazione mobile compatta */
.pagination-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding: 0 16px;
}

@media (min-width: 640px) {
    .pagination-mobile {
        display: none;
    }
}

.pagination-mobile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    color: var(--color-primary, #00b894);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.pagination-mobile-link:hover {
    background: var(--color-bg-hover, #f3f4f6);
    border-color: var(--color-primary, #00b894);
}

.pagination-mobile-link--disabled {
    color: var(--color-text-disabled, #d1d5db);
    border-color: var(--color-border, #e5e7eb);
    cursor: default;
    pointer-events: none;
}

.pagination-mobile-info {
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6b7280);
    font-weight: 500;
    white-space: nowrap;
}

/* Dark mode pagination */
html.dark-mode .pagination-link {
    background: var(--color-surface, #1e293b);
    border-color: var(--color-border, #334155);
    color: var(--color-text, #e2e8f0);
}

html.dark-mode .pagination-link:hover {
    background: #334155;
    border-color: #475569;
}

html.dark-mode .pagination-link--active {
    background: var(--color-primary, #00b894);
    border-color: var(--color-primary, #00b894);
    color: #fff;
}

html.dark-mode .pagination-link--active:hover {
    background: var(--color-primary-hover, #00a37e);
    border-color: var(--color-primary-hover, #00a37e);
}

html.dark-mode .pagination-mobile-link {
    background: var(--color-surface, #1e293b);
    border-color: var(--color-border, #334155);
    color: var(--color-primary, #00b894);
}

html.dark-mode .pagination-mobile-link:hover {
    background: #334155;
    border-color: var(--color-primary, #00b894);
}

html.dark-mode .pagination-mobile-link--disabled {
    color: #475569;
    border-color: #334155;
}

html.dark-mode .pagination-ellipsis {
    color: #94a3b8;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-text-secondary);
}

.empty-state .btn {
    margin-top: 16px;
}

/* ── Merchant Detail ─────────────────────────────────────────────── */
.merchant-detail-header {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-bottom: 32px;
}

.merchant-detail-logo {
    width: 112px;
    height: 112px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-white);
}

.merchant-detail-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.merchant-detail-logo-placeholder {
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-3xl);
    color: var(--color-text-muted);
    background: var(--color-white);
    border-radius: var(--radius-lg);
}

.merchant-detail-info {
    flex: 1;
    min-width: 0;
}

.merchant-detail-name {
    font-size: var(--font-size-3xl);
    margin-bottom: 6px;
    line-height: 1.2;
}

.merchant-detail-cashback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cashback-value-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-cashback);
    line-height: 1;
}

.merchant-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.meta-link {
    color: var(--color-cashback);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Mobile CTA nella testata merchant ──────────────────────────── */
.merchant-detail-mobile-cta {
    display: none;
}

@media (max-width: 1023px) {
    .merchant-detail-mobile-cta {
        display: block;
        margin: 14px 0 20px;
    }

    .merchant-detail-mobile-cta-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 52px;
        padding: 14px 24px;
        font-size: var(--font-size-lg);
        font-weight: 700;
        border-radius: var(--radius-md);
        text-decoration: none;
        transition: opacity 0.2s;
    }

    .merchant-detail-mobile-cta-btn:active {
        opacity: 0.9;
    }

    .merchant-detail-mobile-cta .cta-microcopy {
        text-align: center;
        font-size: var(--font-size-xs);
        color: var(--color-text-muted);
        margin-top: 6px;
    }
}

/* ── Cashback list (detail) ──────────────────────────────────────── */
.cashback-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Cashback item (base / mobile-first) ─────────────────────────── */
.cashback-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
    padding: 10px 14px;
}

/* Su tablet si allarga un po' */
@media (min-width: 768px) {
    .cashback-item {
        padding: 10px 18px;
        gap: 10px 16px;
    }
}

/* Desktop: griglia orizzontale compatta */
@media (min-width: 1024px) {
    .cashback-item {
        display: grid;
        grid-template-columns: 80px minmax(0, 1fr) max-content;
        gap: 16px;
        align-items: center;
        padding: 10px 20px;
        flex-wrap: nowrap;
    }
}

/* ── Cashback value ─────────────────────────────────────────── */
.cashback-item-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-cashback);
    flex-shrink: 0;
    min-width: 60px;
    line-height: 1.2;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .cashback-item-value {
        min-width: auto;
        font-size: var(--font-size-xl);
        text-align: center;
    }
}

/* ── Cashback info ──────────────────────────────────────────── */
.cashback-item-info {
    flex: 1;
    min-width: 0;
}

.cashback-item-category {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 1px;
    line-height: 1.3;
}

.cashback-item-description {
    font-size: var(--font-size-sm);
    margin-bottom: 1px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.cashback-item-info .text-muted {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ── Cashback date ─────────────────────────────────────────── */
.text-cashback-date {
    font-size: var(--font-size-xs);
    color: var(--color-cashback-dark);
    font-weight: 500;
}

@media (min-width: 1024px) {
    .text-cashback-date {
        white-space: nowrap;
        display: inline;
        padding-left: 16px;
    }
}

/* ── Cashback active / primary state ─────────────────────────────── */
.cashback-item--active {
    position: relative;
    border-color: #b8e6da;
    border-width: 1.5px;
    background: var(--color-cashback-light);
    overflow: visible;
    padding-top: 28px;
}

.cashback-item--active .cashback-item-value {
    font-size: 1.2rem;
    color: var(--color-cashback-dark);
}

@media (min-width: 1024px) {
    .cashback-item--active .cashback-item-value {
        font-size: 1.35rem;
    }
}

/* Badge "OFFERTA ATTIVA" — centrato sul bordo superiore della card */
.cashback-item-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    background: var(--color-cashback);
    color: var(--color-white);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 184, 148, 0.25);
}

@media (min-width: 768px) {
    .cashback-item-badge {
        font-size: 10px;
        padding: 3px 10px;
        top: -14px;
    }
}

.cashback-item--active .cashback-item-info {
    padding-right: 4px;
}

/* ── Cashback secondary state ────────────────────────────────────── */
.cashback-item--secondary {
    opacity: 0.85;
    border-color: var(--color-border-light);
    background: var(--color-bg-card);
}

.cashback-item--secondary .cashback-item-value {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

@media (min-width: 1024px) {
    .cashback-item--secondary .cashback-item-value {
        font-size: var(--font-size-sm);
    }
}

/* ── Cashback item CTA ─────────────────────────────────────────── */
.cashback-item-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 130px;
    padding: 6px 18px;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

@media (max-width: 1023px) {
    .cashback-item-cta {
        width: 100%;
        min-width: 0;
        margin-top: 2px;
    }
}

.text-muted-secondary {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-style: italic;
}

/* ── Cashback section divider ────────────────────────────────────── */
.cashback-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    margin-top: 4px;
}

.cashback-section-divider::before,
.cashback-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border-light);
}

.cashback-section-divider span {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cashback-section-divider--collapsible {
    display: flex;
}

.cashback-list:not(.cashback-list-expanded)
    .cashback-section-divider--collapsible {
    display: none;
}

/* ── Mobile extra (≤767px) ──────────────────────────────────────── */
@media (max-width: 767px) {
    .cashback-item--active {
        border-width: 2px;
        box-shadow: 0 2px 12px rgba(0, 184, 148, 0.15);
    }

    .cashback-item--active .cashback-item-value {
        font-size: 1.25rem;
    }

    .cashback-item--secondary {
        opacity: 0.7;
    }

    .cashback-item--secondary .cashback-item-value {
        font-size: var(--font-size-sm);
    }
}

/* ── Higher Cashback link ─────────────────────────────────────────── */
.merchant-detail-higher-cb {
    margin-top: 32px;
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
}

/* ── Merchant Stats Section ───────────────────────────────────── */
.merchant-stats-section {
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    .merchant-stats-section {
        display: none;
    }
}

.merchant-cashback-section {
    padding-top: 4px;
    margin-top: 0;
}

/* ── Info footer tra offerte e descrizione ────────────────────── */
.merchant-info-footer {
    padding: 0;
    margin: 0;
}

.merchant-info-footer .merchant-stats-note {
    margin-top: 0;
}

.merchant-info-footer .merchant-detail-higher-cb {
    margin-top: 8px;
}

.merchant-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 640px) {
    .merchant-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.merchant-stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.merchant-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.merchant-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Info tooltip ───────────────────────────────────────────────── */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    font-family: serif;
    cursor: pointer;
    line-height: 1;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}

.info-tooltip-trigger:hover,
.info-tooltip-trigger:focus-visible {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    border-color: var(--color-cashback);
    outline: none;
}

.info-tooltip-trigger:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: 2px;
}

.info-tooltip-content {
    display: block;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    font-family: var(--font-family);
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 8px;
    max-width: 240px;
    width: max-content;
    text-align: left;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.15s ease,
        visibility 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus-within .info-tooltip-content {
    opacity: 1;
    visibility: visible;
}

.merchant-stats-note {
    margin-top: 10px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.4;
}

/* ── Merchant tips (consigli) ────────────────────────────────────── */
.merchant-tips-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.merchant-tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.merchant-tips-list li {
    padding-left: 22px;
    position: relative;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.merchant-tips-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--color-cashback);
    font-weight: 700;
    font-size: 14px;
}

/* ── Merchant SEO text ──────────────────────────────────────────── */
.merchant-seo-content {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.8;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 16px;
}

.merchant-seo-content h3 {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin: 16px 0 6px;
    color: var(--color-text-primary);
}

.merchant-seo-content h3:first-of-type {
    margin-top: 0;
}

.merchant-seo-content p {
    margin: 0 0 10px;
}

.merchant-seo-content p:last-child {
    margin-bottom: 0;
}

.merchant-seo-content a {
    color: var(--color-cashback);
    text-decoration: underline;
}

.merchant-seo-content a:hover {
    color: var(--color-cashback-dark);
}

/* ── Merchant detail description ─────────────────────────────────── */
.merchant-description,
.merchant-terms {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 16px;
}

/* ── Merchant description in main content ────────────────────────── */
.merchant-info-description__content {
    font-size: var(--font-size-base);
    color: var(--color-text);
    line-height: 1.8;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}

.merchant-info-description__content p {
    margin-bottom: 12px;
}

.merchant-info-description__content p:last-child {
    margin-bottom: 0;
}

/* Dark mode: ereditato da color-bg-card e color-text */

.cta-placeholder-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.cta-placeholder-text a {
    color: var(--color-cashback);
    font-weight: 600;
    text-decoration: underline;
}

.cta-microcopy {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* ── Home Categorie Mobile (griglia compatta + bottom sheet) ──── */
.home-categories {
    padding-bottom: 12px;
}

.home-categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.home-categories-header .section-title {
    margin-bottom: 0;
}

.categories-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text-primary);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-weight: 700;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    transition:
        border-color 0.2s,
        background 0.2s;
    cursor: pointer;
    line-height: 1.2;
    min-height: 38px;
}

.categories-open-btn:hover {
    border-color: var(--color-cashback);
    color: var(--color-cashback);
}

.categories-open-btn:active {
    background: var(--color-bg);
}

/* ── Paged Carousel Mobile (pagine con griglia 2 colonne) ───────── */
.home-mobile-paged-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 10px;
    margin-left: calc(-1 * var(--section-inner-px, 16px));
    margin-right: calc(-1 * var(--section-inner-px, 16px));
    padding-left: var(--section-inner-px, 16px);
    padding-right: var(--section-inner-px, 16px);
}

.home-mobile-paged-carousel::-webkit-scrollbar {
    display: none;
}

.home-mobile-carousel-page {
    flex: 0 0 calc(100% - 32px);
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    align-content: start;
    grid-auto-rows: auto;
    height: auto;
}

/* ── Category Card Mobile (2 colonne, paged carousel) ───────────── */
.category-card-mobile {
    width: 100%;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-white);
    color: var(--color-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.category-card-mobile:hover,
.category-card-mobile:focus-visible {
    border-color: var(--color-cashback);
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.15);
    outline: none;
}

.category-card-mobile:active {
    background: var(--color-bg);
}

.category-card-mobile span:first-child {
    flex: 1;
    font-size: 15px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--color-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.category-card-mobile span:last-child {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 1.1em;
}

/* Schermi molto piccoli */
@media (max-width: 360px) {
    .home-mobile-carousel-page {
        gap: 10px;
    }

    .category-card-mobile {
        min-height: 68px;
        padding: 10px;
    }

    .category-card-mobile span:first-child {
        font-size: 14px;
    }
}

/* ── Bottom Sheet Categorie ─────────────────────────────────────── */
.categories-sheet {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.categories-sheet[hidden] {
    display: none;
}

.categories-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
    animation: categoriesFadeIn 0.25s ease;
}

.categories-sheet-panel {
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    max-height: 82vh;
    background: var(--color-white);
    border-radius: 28px 28px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: categoriesSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes categoriesFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes categoriesSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.categories-sheet-header {
    flex-shrink: 0;
    padding-bottom: 8px;
}

.categories-sheet-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
    color: var(--color-text-muted);
}

.categories-sheet-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 4px;
    padding-bottom: 16px;
    flex: 1;
    min-height: 0;
}

/* ── Bottom bar: cerca + chiudi (mobile first) ───────────────── */
.categories-sheet-bottom-bar {
    flex-shrink: 0;
    padding: 12px 20px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--color-border-light);
    background: var(--color-white);
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.categories-sheet-bottom-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories-sheet-search {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    font-size: var(--font-size-base);
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.categories-sheet-search:focus {
    border-color: var(--color-cashback);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.12);
}

.categories-sheet-search::placeholder {
    color: var(--color-text-muted);
}

.categories-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.categories-sheet-close:hover {
    background: var(--color-border-light);
}

.categories-sheet-close:active {
    background: var(--color-border);
}

/* Nascondi elementi mobile su desktop, e viceversa */
.categories-sheet-header-search,
.categories-sheet-header .categories-sheet-close {
    display: none;
}

/* Desktop: ripristino layout classico */
@media (min-width: 1024px) {
    .categories-sheet-bottom-bar {
        display: none;
    }

    .categories-sheet-header-search,
    .categories-sheet-header .categories-sheet-close {
        display: block;
    }

    .categories-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .categories-sheet-header h2 {
        font-size: var(--font-size-xl);
        font-weight: 700;
        color: var(--color-text-primary);
        flex-shrink: 0;
    }

    .categories-sheet-header-search {
        flex: 1;
        min-width: 0;
    }

    .categories-sheet-header .categories-sheet-close {
        display: inline-flex;
        width: 44px;
        height: 44px;
        border-radius: var(--radius-full);
        border: none;
        background: var(--color-bg);
        flex-shrink: 0;
    }

    .categories-sheet-header .categories-sheet-search {
        flex: none;
        width: 100%;
        padding: 12px 16px;
        margin: 0;
    }

    .categories-sheet-list {
        padding-bottom: 4px;
    }
}

.categories-sheet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: background 0.15s;
    gap: 8px;
}

.categories-sheet-item:hover,
.categories-sheet-item:focus-visible {
    background: var(--color-bg);
    outline: none;
}

.categories-sheet-item:active {
    background: var(--color-border-light);
}

.categories-sheet-item span:first-child {
    flex: 1;
    word-break: break-word;
}

.categories-sheet-item-arrow {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 0.9em;
}

.categories-sheet-item:hover .categories-sheet-item-arrow {
    color: var(--color-cashback);
}

.categories-sheet-empty {
    padding: 32px 12px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
}

.categories-sheet-empty p {
    color: inherit;
}

/* Nascondi categorie nella lista filtrata */
.categories-sheet-item.is-hidden {
    display: none;
}

/* Desktop: mostra chip-row categorie, nascondi carousel e bottone */
@media (min-width: 768px) {
    .home-mobile-paged-carousel {
        display: none;
    }

    .categories-open-btn {
        display: none;
    }

    .home-categories-all {
        display: block;
    }
}

@media (min-width: 768px) {
    .home-mobile-merchant-list-compact {
        display: none;
    }
}

/* Mobile: nascondi chip-row (sostituito da carousel + bottom sheet) */
@media (max-width: 767px) {
    .home-categories-all {
        display: none;
    }

    .home-categories-header .section-title {
        font-size: var(--font-size-xl);
    }
}

/* ── Category Grid (existing) ───────────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 24px 16px;
    text-align: center;
    transition: box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
}

.category-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-cashback-light);
    color: var(--color-cashback);
}

.category-card-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.category-card-count {
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.3;
}

@media (min-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.breadcrumb {
    margin-bottom: 16px;
}

/* ── Breadcrumb Wrapper (solo pagina merchant) ──────────────────── */
.merchant-breadcrumb-wrapper {
    padding-top: 16px;
    padding-bottom: 8px;
}

@media (max-width: 768px) {
    .merchant-breadcrumb-wrapper {
        padding-top: 12px;
        padding-bottom: 6px;
    }
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.breadcrumb-item:not(:last-child)::after {
    content: "/";
    margin-left: 4px;
    color: var(--color-text-muted);
}

.breadcrumb-item a {
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--color-cashback);
}

.breadcrumb-item span[aria-current="page"] {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* ── Balance Card ────────────────────────────────────────────────── */
.balance-card {
    background: linear-gradient(135deg, var(--color-cashback) 0%, #009977 100%);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 16px;
    color: white;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.balance-label {
    font-size: var(--font-size-sm);
    opacity: 0.85;
    margin-bottom: 16px;
}

.balance-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.pill-confirmed {
    background: rgba(255, 255, 255, 0.25);
}

.pill-pending {
    background: rgba(255, 255, 255, 0.15);
}

.pill-total {
    background: rgba(255, 255, 255, 0.1);
}

/* ── Dashboard Subnav ────────────────────────────────────────────── */
.dashboard-subnav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

/* ── Dashboard Section ───────────────────────────────────────────── */
.dashboard-section {
    margin-bottom: 24px;
}

.dashboard-section-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text-primary);
}

/* ── List Items ──────────────────────────────────────────────────── */
.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 14px 16px;
}

.list-item-body {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-sub {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.list-item-right {
    text-align: right;
    flex-shrink: 0;
}

.list-item-amount {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 700;
}

.list-item-status {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.status-awaiting {
    color: var(--color-text-secondary);
    background: var(--color-bg-alt);
}

.status-confirmed {
    color: var(--color-cashback-dark);
    background: var(--color-cashback-light);
}

.status-cancelled {
    color: var(--color-coral);
    background: var(--color-coral-light);
}

.amount-positive {
    color: var(--color-cashback);
}

.amount-negative {
    color: var(--color-text-secondary);
}

.list-item-balance {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ── Notification Badge (header) ─────────────────────────────────── */
.header-notif-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-coral);
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: var(--radius-full);
}

/* ── Notification List (centro notifiche) ────────────────────────── */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 16px;
}

.notification-unread {
    border-left: 3px solid var(--color-cashback);
    background: var(--color-cashback-light);
}

.notification-body {
    flex: 1;
}

.notification-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-cashback);
    flex-shrink: 0;
}

.notification-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    line-height: 1.5;
}

.notification-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.notification-action {
    flex-shrink: 0;
}

.notif-dot-list {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-cashback);
    flex-shrink: 0;
    margin-top: 6px;
}

.list-item-unread {
    border-left: 3px solid var(--color-cashback);
}

/* ── Dashboard section header ─────────────────────────────────────── */
.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* ── Content Page ─────────────────────────────────────────────────── */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

.content-header {
    margin-bottom: 32px;
}

.content-title {
    font-size: var(--font-size-2xl);
    margin-bottom: 8px;
}

.content-body {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    line-height: 1.8;
}

.content-body p {
    margin-bottom: 16px;
}

.content-body ul,
.content-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.content-body li {
    margin-bottom: 8px;
}

.content-body a {
    color: var(--color-cashback);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.content-body h2,
.content-body h3,
.content-body h4 {
    margin-top: 28px;
    margin-bottom: 12px;
}

.content-version {
    margin-top: 32px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ── Legal Notice (fallback) ──────────────────────────────────────── */
.legal-notice {
    padding: 24px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--color-text-secondary);
}

/* ── FAQ Accordion ────────────────────────────────────────────────── */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.faq-item[open] {
    box-shadow: var(--shadow-sm);
}

.faq-question {
    padding: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: "+";
    font-size: var(--font-size-xl);
    color: var(--color-cashback);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-item[open] .faq-question::after {
    content: "−";
}

.faq-answer {
    padding: 0 16px 16px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ── Steps List (how it works) ────────────────────────────────────── */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-cashback);
    color: white;
    font-weight: 700;
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: var(--font-size-lg);
    margin-bottom: 4px;
}

.step-content p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ── Info Box ─────────────────────────────────────────────────────── */
.info-box {
    padding: 20px;
    border-radius: var(--radius-lg);
    margin: 24px 0;
}

.info-box h3 {
    font-size: var(--font-size-base);
    margin-bottom: 12px;
}

.info-box ul {
    padding-left: 20px;
    margin: 0;
}

.info-box li {
    font-size: var(--font-size-sm);
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-box-warning {
    background: #fff8e6;
    border: 1px solid #fde68a;
    color: #92400e;
}

.info-box-info {
    background: var(--color-cashback-light);
    border: 1px solid #a7f3d0;
    color: var(--color-text-primary);
}

/* ── Content CTA ──────────────────────────────────────────────────── */
.content-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin: 32px 0;
}

@media (min-width: 480px) {
    .content-cta {
        flex-direction: row;
        justify-content: center;
    }
}

/* ── Detail Table ─────────────────────────────────────────────────── */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.detail-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-table td:first-child {
    color: var(--color-text-muted);
    width: 40%;
    font-weight: 500;
}

.detail-table td:last-child {
    color: var(--color-text-primary);
}

.list-item-clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.list-item-clickable:hover {
    box-shadow: var(--shadow-sm);
}

/* ── Order card (area-utente/ordini) ─────────────────────────── */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 16px 20px;
}
.order-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
}
.order-card-info {
    flex: 1;
    min-width: 0;
}
.order-card-merchant {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-card-details {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.order-card-cashback {
    text-align: center;
    flex-shrink: 0;
    min-width: 80px;
}
.order-card-amount {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 700;
    text-align: center;
}
.order-card-cashback-label {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 1px;
}
.order-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.order-card-status {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.order-card-review-btn {
    white-space: nowrap;
}
.order-card-xp {
    font-weight: 400;
    opacity: 1;
}

@media (max-width: 640px) {
    .order-card-main {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .order-card-cashback {
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 6px;
    }
    .order-card-cashback-label {
        display: inline;
    }
    .order-card-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .order-card-review-btn {
        width: 100%;
        text-align: center;
    }
}

/* ── Admin Table ─────────────────────────────────────────────────── */
.admin-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.admin-table th {
    background: var(--color-bg-alt);
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.admin-table tbody tr:hover {
    background: var(--color-cashback-light);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Admin Header ─────────────────────────────────────────────────── */
.admin-body {
    background: #f5f7fa;
}

.admin-header {
    background: #1a1a2e;
    border-bottom: 1px solid #333;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-logo {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.3px;
}

.admin-logo:hover {
    color: #00b894;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-email {
    color: #999;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
    padding: 6px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.admin-nav-link {
    color: #999;
    font-size: var(--font-size-sm);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition:
        color 0.15s,
        background 0.15s;
    line-height: 1.3;
}

.admin-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.admin-nav-active {
    color: #fff !important;
    background: rgba(20, 184, 166, 0.15) !important;
    font-weight: 700 !important;
    box-shadow: inset 0 -2px 0 #14b8a6;
}

.admin-nav-monitor {
    color: #00b894;
    font-weight: 600;
}

.admin-nav-highlight {
    color: #fbbf24;
    font-weight: 600;
}

.admin-nav-workbench {
    color: #ffc107;
    font-weight: 600;

    .admin-nav-active {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.12) !important;
    }

    .admin-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        font-size: 11px;
        font-weight: 700;
        color: #1a1a2e;
        background: #fbbf24;
        border-radius: 9px;
        vertical-align: middle;
        line-height: 1;
    }
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: calc(100vh - 120px);
}

/* ── Admin Header: schermi stretti ──────────────────────────────── */
@media (max-width: 640px) {
    .admin-topbar {
        padding: 6px 12px;
    }
    .admin-nav {
        padding: 4px 12px;
        gap: 1px 0;
    }
    .admin-nav-link {
        padding: 5px 8px;
        font-size: 0.8125rem;
    }
    .admin-content {
        padding: 16px 12px;
    }
    .admin-email {
        font-size: 0.75rem;
    }
}

/* ── Admin Header: tablet ───────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 1023px) {
    .admin-topbar {
        padding: 8px 16px;
    }
    .admin-nav {
        padding: 6px 16px;
    }
}

/* ========================================================================
   Merchant Detail - Layout e componenti
   ======================================================================== */

.merchant-detail {
    /* padding gestito da hero e sezioni interne */
}

/* Desktop: griglia a 2 colonne per hero + sidebar allineati */
@media (min-width: 1024px) {
    .merchant-detail {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 32px;
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 32px;
    }

    .merchant-detail-hero {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .merchant-detail-layout {
        grid-column: 1;
        grid-row: 2;
    }

    .merchant-detail-sidebar {
        grid-column: 2;
        grid-row: 1 / span 10;
        align-self: start;
    }
}

.merchant-detail-main {
    min-width: 0;
}

/* ── Sidebar CTA ──────────────────────────────────────────────────── */
.merchant-detail-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .merchant-detail-sidebar {
        display: flex;
        flex-direction: column;
        gap: 16px;
        position: sticky;
        top: calc(var(--site-header-height, 64px) + 16px);
        z-index: 75;
    }
}

.merchant-cta-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

@media (min-width: 768px) {
    .merchant-detail-main .merchant-cta-card {
        max-width: 420px;
    }
}

.merchant-cta-card-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.merchant-cta-card-cashback {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-cashback);
    line-height: 1.1;
}

.merchant-cta-card .cta-microcopy {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 0;
}

.merchant-cta-card-category {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-top: -6px;
    line-height: 1.3;
}

/* ── Sidebar card generica ───────────────────────────────────── */
.merchant-sidebar-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 16px;
}

.merchant-sidebar-card-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.merchant-sidebar-card-title--gufy {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

/* ── Checklist card ──────────────────────────────────────────── */
.merchant-sidebar-checklist-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.merchant-sidebar-checklist-list li {
    position: relative;
    padding-left: 20px;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.45;
}

.merchant-sidebar-checklist-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-cashback);
    font-weight: 700;
    font-size: 12px;
}

/* ── Trust card ──────────────────────────────────────────────── */
.merchant-sidebar-trust-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.merchant-sidebar-trust-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.merchant-sidebar-trust-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.merchant-sidebar-trust-value {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-primary);
    text-align: right;
}

.gufy-badge-sm {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--color-cashback-dark);
    background: var(--color-cashback-light);
    border: 1px solid #b8e6da;
    border-radius: var(--radius-full);
    line-height: 1.4;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* ── Gufy compatto sidebar ──────────────────────────────────── */
.gufy-sidebar-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.gufy-sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    gap: 8px;
}

.gufy-sidebar-row--our {
    font-weight: 600;
}

.gufy-sidebar-label {
    color: var(--color-text-secondary);
}

.gufy-sidebar-value {
    color: var(--color-cashback-dark);
    font-weight: 700;
}

.gufy-card-microcopy {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

/* ── Gufy sidebar accordion ─────────────────────────────────── */
.gufy-sidebar-accordion {
    /* eredita .merchant-sidebar-card */
}

.gufy-sidebar-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.gufy-sidebar-title {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
    margin: 0;
}

.gufy-sidebar-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.gufy-sidebar-body {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
}

.gufy-sidebar-accordion.is-expanded .gufy-sidebar-body {
    display: block;
}

.gufy-sidebar-body-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gufy-sidebar-body-inner .gufy-card-microcopy {
    margin-top: 6px;
    font-size: 0.625rem;
}

.gufy-sidebar-comp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

.gufy-sidebar-comp-name {
    color: var(--color-text-secondary);
    min-width: 0;
}

.gufy-sidebar-comp-value {
    color: var(--color-cashback-dark);
    font-weight: 700;
    white-space: nowrap;
}

.gufy-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-cashback);
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.gufy-sidebar-toggle:hover {
    background: var(--color-cashback-light);
}

.gufy-sidebar-toggle:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: 2px;
}

/* Text swap: default "Mostra tutti", expanded "Nascondi" */
.gufy-sidebar-toggle-text-open {
    display: none;
}

.gufy-sidebar-accordion.is-expanded .gufy-sidebar-toggle-text-closed {
    display: none;
}

.gufy-sidebar-accordion.is-expanded .gufy-sidebar-toggle-text-open {
    display: inline;
}

/* Chevron rotation */
.gufy-sidebar-chevron {
    flex-shrink: 0;
    color: var(--color-cashback);
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.gufy-sidebar-accordion.is-expanded .gufy-sidebar-chevron {
    transform: rotate(180deg);
}

/* ── Gufy expanded groups (competitor lines) ──────────────────── */
.gufy-sidebar-comp-group + .gufy-sidebar-comp-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
}

.gufy-sidebar-comp-group-name {
    font-weight: 700;
    font-size: 0.6875rem;
    color: var(--color-text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.gufy-sidebar-comp-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

.gufy-sidebar-comp-label {
    color: var(--color-text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gufy-sidebar-comp-value {
    color: var(--color-cashback-dark);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Gufy showdown (box sintesi) ─────────────────────────────── */
.gufy-showdown {
    background: var(--color-cashback-light);
    border: 1px solid rgba(0, 184, 148, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gufy-showdown-our {
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 184, 148, 0.15);
}

.gufy-showdown-our .gufy-showdown-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.gufy-showdown-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-cashback-dark);
    line-height: 1.1;
    margin-bottom: 2px;
}

.gufy-showdown-sub {
    display: block;
    font-size: 0.625rem;
    color: var(--color-text-muted);
}

.gufy-showdown-competitor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gufy-showdown-competitor .gufy-showdown-label {
    font-size: 0.625rem;
    color: var(--color-text-muted);
}

.gufy-showdown-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.gufy-showdown-advantage {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 184, 148, 0.15);
}

.gufy-showdown-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--color-cashback);
    color: var(--color-white);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.gufy-showdown-advantage-text {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-cashback-dark);
}

/* ── Gufy compact details (lista espandibile) ───────────────── */
.gufy-compact-details {
    border-bottom: 1px solid var(--color-border-light);
    padding: 6px 0;
}

.gufy-compact-details:last-child {
    border-bottom: none;
}

.gufy-compact-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 2px 0;
}

.gufy-compact-summary::-webkit-details-marker {
    display: none;
}

.gufy-compact-name {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.gufy-compact-meta {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gufy-compact-meta strong {
    color: var(--color-text-secondary);
    font-weight: 600;
}

.gufy-compact-chevron {
    flex-shrink: 0;
    color: var(--color-cashback);
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.gufy-compact-details[open] .gufy-compact-chevron {
    transform: rotate(180deg);
}

.gufy-compact-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 2px 0;
}

.gufy-compact-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.625rem;
    line-height: 1.4;
}

.gufy-compact-line-label {
    color: var(--color-text-secondary);
    min-width: 0;
    overflow-wrap: break-word;
}

.gufy-compact-line-value {
    color: var(--color-cashback-dark);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.gufy-card-microcopy--note {
    margin-top: 8px;
    font-size: 0.5625rem;
    text-align: center;
}

/* ── Report card ─────────────────────────────────────────────── */
.merchant-sidebar-report-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
}

.merchant-sidebar-report-link {
    width: 100%;
    justify-content: center;
}

/* ── Checklist header con avatar ────────────────────────────── */
.merchant-sidebar-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.merchant-sidebar-checklist-header .merchant-sidebar-card-title {
    margin-bottom: 0;
}

.merchant-sidebar-checklist-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: contain;
    background: var(--color-cashback-light);
    border: 2px solid #d1f2eb;
    padding: 2px;
}

/* ── Trust header con avatar ────────────────────────────────── */
.merchant-sidebar-trust-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.merchant-sidebar-trust-header .merchant-sidebar-card-title {
    margin-bottom: 0;
}

.merchant-sidebar-trust-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: contain;
    background: var(--color-cashback-light);
    border: 2px solid #d1f2eb;
    padding: 2px;
}

/* ── Gufy title avatar ──────────────────────────────────────── */
.merchant-sidebar-gufy-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: contain;
    background: var(--color-cashback-light);
    border: 2px solid #d1f2eb;
    padding: 2px;
}

/* ── Sidebar descrizione con icona ──────────────────────────── */
.merchant-sidebar-desc-with-icon {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.merchant-sidebar-desc-icon {
    flex-shrink: 0;
    color: var(--color-cashback);
    background: var(--color-cashback-light);
    border-radius: 50%;
    padding: 4px;
    margin-top: 2px;
}

.merchant-sidebar-desc-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: contain;
    background: transparent;
    border: none;
}

.merchant-sidebar-card .merchant-description {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.merchant-sidebar-desc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.merchant-sidebar-desc-header .merchant-sidebar-card-title {
    margin-bottom: 0;
}

.merchant-sidebar-desc-with-icon .merchant-description {
    flex: 1;
    min-width: 0;
}

/* ── Sidebar: Come viene tracciato il tuo cashback ─────────── */
.merchant-sidebar-tracking {
    border-color: #e0f2fe;
}

.merchant-sidebar-tracking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.merchant-sidebar-tracking-header .merchant-sidebar-card-title {
    margin-bottom: 0;
}

.merchant-sidebar-tracking-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.merchant-sidebar-tracking-text p {
    margin: 0 0 8px;
}

.merchant-sidebar-tracking-text p:last-child {
    margin-bottom: 0;
}

.tracking-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

.tracking-badge--automatic {
    background: #d1fae5;
    color: #065f46;
}

.tracking-badge--manual {
    background: #fef3c7;
    color: #92400e;
}

.tracking-badge--unknown {
    background: #f3f4f6;
    color: #6b7280;
}

.tracking-badge--green {
    background: #d1fae5;
    color: #065f46;
}

.tracking-badge--yellow {
    background: #fef3c7;
    color: #92400e;
}

.tracking-badge--red {
    background: #fee2e2;
    color: #991b1b;
}

.tracking-badge--manual {
    background: #dbeafe;
    color: #1e40af;
}

.tracking-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-xs);
}

.tracking-detail-row:last-child {
    border-bottom: none;
}

.tracking-detail-label {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.tracking-detail-value {
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: right;
}

.tracking-tips {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    font-size: 11px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.tracking-tips-title {
    font-weight: 700;
    font-size: 11px;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.tracking-tips ul {
    margin: 0;
    padding-left: 16px;
}

.tracking-tips li {
    margin-bottom: 2px;
}

.tracking-tips li:last-child {
    margin-bottom: 0;
}

html.dark-mode .merchant-sidebar-tracking {
    border-color: #1e3a5f;
}

html.dark-mode .tracking-badge--automatic {
    background: #064e3b;
    color: #6ee7b7;
}

html.dark-mode .tracking-badge--manual {
    background: #78350f;
    color: #fcd34d;
}

html.dark-mode .tracking-badge--green {
    background: #064e3b;
    color: #6ee7b7;
}

html.dark-mode .tracking-badge--yellow {
    background: #78350f;
    color: #fcd34d;
}

html.dark-mode .tracking-badge--red {
    background: #7f1d1d;
    color: #fca5a5;
}

html.dark-mode .tracking-badge--manual {
    background: #1e3a5f;
    color: #93c5fd;
}

html.dark-mode .tracking-tips {
    background: #1e293b;
}

html.dark-mode .tracking-detail-row {
    border-bottom-color: #334155;
}

/* ── Sidebar offerte compatte ──────────────────────────────────── */
/* ── Sidebar logo piccolo ───────────────────────────────────── */
.merchant-sidebar-logo-wrap {
    margin-bottom: 10px;
}

.merchant-sidebar-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    border: 1px solid var(--color-border-light);
    background: var(--color-white);
}

.merchant-sidebar-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
}

/* ── Sidebar offerte compatte ──────────────────────────────────── */
.sidebar-offer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-offer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
}

.sidebar-offer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.sidebar-offer-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-cashback-dark);
    line-height: 1.2;
}

.sidebar-offer-cat {
    font-size: 0.6875rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.sidebar-offer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 90px;
    padding: 5px 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-cashback);
    border-radius: var(--radius-sm);
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    transition: background 0.2s ease;
}

@media (hover: hover) {
    .sidebar-offer-cta:hover {
        background: var(--color-cashback-dark);
    }
}

.sidebar-offer-all {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-cashback-dark);
    text-decoration: none;
    line-height: 1.3;
    padding: 2px 0;
    transition: color 0.2s ease;
}

@media (hover: hover) {
    .sidebar-offer-all:hover {
        color: var(--color-cashback);
        text-decoration: underline;
    }
}

/* ── Gufy AI Comparison Card ──────────────────────────────────────── */
/* ==========================================================================
   Gufy Tip — Componente suggerimento leggero riutilizzabile
   ========================================================================== */

.gufy-tip {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin: 12px 0;
    transition: box-shadow 0.2s ease;
}

.gufy-tip:hover {
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.08);
}

.gufy-tip-avatar-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
}

.gufy-tip-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--color-cashback-light);
    border: 2px solid #d1f2eb;
    padding: 3px;
    display: block;
}

.gufy-tip-content {
    flex: 1;
    min-width: 0;
}

.gufy-tip-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.gufy-tip-text {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
    margin: 0;
}

/* ── Varianti ──────────────────────────────────────────────────── */

.gufy-tip--info {
    border-left: 3px solid var(--color-cashback);
    background: var(--color-white);
}

.gufy-tip--success {
    border-left: 3px solid var(--color-cashback-dark);
    background: var(--color-cashback-light);
}

.gufy-tip--success .gufy-tip-title {
    color: var(--color-cashback-dark);
}

.gufy-tip--warning {
    border-left: 3px solid #e17055;
    background: #fff5f0;
}

.gufy-tip--warning .gufy-tip-title {
    color: #c0392b;
}

.gufy-tip--warning .gufy-tip-avatar {
    border-color: #fadbd8;
    background: #fff0ed;
}

/* ── Compact (per mobile e spazi ridotti) ──────────────────────── */
.gufy-tip--compact {
    padding: 10px 12px;
    gap: 10px;
    margin: 8px 0;
    border-left: none;
    border: 1px solid var(--color-border);
    background: #fafffe;
}

.gufy-tip--compact .gufy-tip-avatar {
    width: 32px;
    height: 32px;
    padding: 2px;
    border-width: 1.5px;
}

.gufy-tip--compact .gufy-tip-title {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.gufy-tip--compact .gufy-tip-text {
    font-size: 0.75rem;
    line-height: 1.45;
}

/* ── Mobile: compatta ulteriormente su schermi piccoli ─────────── */
@media (max-width: 480px) {
    .gufy-tip:not(.gufy-tip--compact) {
        padding: 12px 14px;
        gap: 10px;
    }

    .gufy-tip:not(.gufy-tip--compact) .gufy-tip-avatar {
        width: 36px;
        height: 36px;
        padding: 2px;
    }

    .gufy-tip:not(.gufy-tip--compact) .gufy-tip-title {
        font-size: 0.75rem;
    }

    .gufy-tip:not(.gufy-tip--compact) .gufy-tip-text {
        font-size: 0.75rem;
    }
}

/* ── Allineamento nei listing (categorie / merchant) ───────────── */
.listing-page .gufy-tip {
    margin-top: 0;
    margin-bottom: 16px;
}

.listing-filters + .gufy-tip {
    margin-top: 0;
}

.gufy-tip + .merchant-grid,
.gufy-tip + .category-grid,
.gufy-tip + .category-merchant-list {
    margin-top: 0;
}

/* ── Empty state con Gufy ──────────────────────────────────────── */
.empty-state-gufy {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-gufy .gufy-tip-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--color-cashback-light);
    border: 3px solid #d1f2eb;
    padding: 5px;
    margin-bottom: 4px;
}

.empty-state-gufy .empty-state-gufy-msg {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    max-width: 400px;
}

.empty-state-gufy .empty-state-gufy-sub {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    max-width: 360px;
}

.empty-state-gufy .btn {
    margin-top: 8px;
}

/* ── Responsive empty state ────────────────────────────────────── */
@media (max-width: 480px) {
    .empty-state-gufy {
        padding: 32px 16px;
    }
    .empty-state-gufy .gufy-tip-avatar {
        width: 52px;
        height: 52px;
    }
    .empty-state-gufy .empty-state-gufy-msg {
        font-size: 0.9375rem;
    }
}

.gufy-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow:
        0 1px 4px rgba(0, 184, 148, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Hover solo desktop */
@media (hover: hover) {
    .gufy-card:hover {
        box-shadow:
            0 4px 16px rgba(0, 184, 148, 0.1),
            0 2px 6px rgba(0, 0, 0, 0.06);
        transform: translateY(-1px);
    }
}

.gufy-card-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.gufy-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--color-cashback-light);
    border: 2px solid #d1f2eb;
    padding: 3px;
    margin-top: 2px;
}

.gufy-card-title-group {
    flex: 1;
    min-width: 0;
}

.gufy-card-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.gufy-card-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
    margin: 0;
}

.gufy-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--color-cashback-dark);
    background: var(--color-cashback-light);
    border: 1px solid #b8e6da;
    border-radius: var(--radius-full);
    line-height: 1.3;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}

.gufy-card-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.45;
    margin: 0;
}

.gufy-card-microcopy {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

.gufy-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-cashback);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 184, 148, 0.2);
    line-height: 1.2;
}

@media (hover: hover) {
    .gufy-card-cta:hover {
        background: var(--color-cashback-dark);
        box-shadow: 0 2px 8px rgba(0, 184, 148, 0.3);
    }
}

.gufy-card-cta:active {
    transform: scale(0.97);
}

/* ── Gufy Desktop ─────────────────────────────────────────────────── */
.gufy-card-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .gufy-card-desktop {
        display: flex;
        margin-top: 16px;
        gap: 12px;
    }

    .gufy-card-desktop .gufy-card-cta {
        min-height: 44px;
        font-size: 0.8125rem;
    }
}

/* ── Gufy compact competitor list (desktop + mobile expanded) ──── */
.gufy-compact-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0 10px;
}

.gufy-compact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    padding: 6px 10px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.35;
}

.gufy-compact-name {
    font-weight: 600;
    color: var(--color-text-primary);
    flex-shrink: 0;
}

.gufy-compact-value {
    font-weight: 700;
    color: var(--color-cashback-dark);
    flex-shrink: 0;
}

.gufy-compact-label {
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gufy-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-cashback-dark);
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.gufy-card-link::after {
    content: "→";
    font-size: 0.8125rem;
    transition: transform 0.2s ease;
}

@media (hover: hover) {
    .gufy-card-link:hover {
        color: var(--color-cashback);
    }
    .gufy-card-link:hover::after {
        transform: translateX(2px);
    }
}

/* ── Gufy Mobile (accordion) ─────────────────────────────────────── */
.gufy-card-mobile {
    display: none;
}

@media (max-width: 1023px) {
    .gufy-card-mobile {
        display: block;
        margin: 4px 0 16px;
        border-top: 2px solid var(--color-cashback-light);
        background: var(--color-white);
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        overflow: hidden;
    }

    /* ── Toggle button (collapsed state) ───────────────────────── */
    .gufy-card-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 12px 14px;
        background: none;
        border: none;
        cursor: pointer;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
        font: inherit;
        color: inherit;
    }

    .gufy-card-toggle:focus-visible {
        outline: 2px solid var(--color-cashback);
        outline-offset: -2px;
        border-radius: var(--radius-md);
    }

    .gufy-card-mobile .gufy-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: contain;
        flex-shrink: 0;
        background: var(--color-cashback-light);
        border: 2px solid #d1f2eb;
        padding: 2px;
    }

    .gufy-toggle-text {
        flex: 1;
        font-size: 0.8125rem;
        font-weight: 700;
        color: var(--color-text-primary);
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .gufy-badge-sm {
        display: inline-flex;
        align-items: center;
        padding: 1px 6px;
        font-size: 0.5625rem;
        font-weight: 700;
        letter-spacing: 0.2px;
        color: var(--color-cashback-dark);
        background: var(--color-cashback-light);
        border: 1px solid #b8e6da;
        border-radius: var(--radius-full);
        line-height: 1.4;
        flex-shrink: 0;
    }

    .gufy-toggle-icon {
        flex-shrink: 0;
        color: var(--color-text-muted);
        transition: transform 0.25s ease;
        display: flex;
        align-items: center;
    }

    .gufy-card-mobile.is-expanded .gufy-toggle-icon {
        transform: rotate(180deg);
    }

    /* ── Body (expanded content) ───────────────────────────────── */
    .gufy-card-body {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.35s ease;
        padding: 0 14px;
    }

    .gufy-card-body > .gufy-card-body-inner {
        overflow: hidden;
        min-height: 0;
    }

    .gufy-card-mobile.is-expanded .gufy-card-body {
        grid-template-rows: 1fr;
    }

    .gufy-card-mobile .gufy-card-subtitle {
        font-size: 0.75rem;
        color: var(--color-text-secondary);
        line-height: 1.5;
        margin: 2px 0 8px;
    }

    .gufy-card-mobile .gufy-card-microcopy {
        font-size: 0.6875rem;
        color: var(--color-text-muted);
        font-style: italic;
        line-height: 1.4;
        margin: 0 0 10px;
    }

    .gufy-card-mobile .gufy-card-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 40px;
        padding: 8px 14px;
        margin-bottom: 14px;
        font-size: 0.8125rem;
        font-weight: 700;
        color: var(--color-white);
        background: var(--color-cashback);
        border-radius: var(--radius-md);
        text-decoration: none;
        transition: background 0.2s ease;
        line-height: 1.2;
    }
}

@media (max-width: 1023px) and (hover: hover) {
    .gufy-card-mobile .gufy-card-cta:hover {
        background: var(--color-cashback-dark);
    }

    .gufy-card-toggle:hover {
        background: var(--color-bg-alt);
    }
}

/* ── Gufy Check — accordion compatto (desktop + mobile) ────────── */
.gufy-check {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-white);
    overflow: hidden;
}

.gufy-check-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    font: inherit;
    color: inherit;
}

.gufy-check-toggle:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: -2px;
    border-radius: var(--radius-md);
}

.gufy-check-icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
    opacity: 0.6;
}

.gufy-check-text {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1.35;
}

.gufy-check-chevron {
    flex-shrink: 0;
    color: var(--color-text-muted);
    opacity: 0.5;
    transition: transform 0.25s ease;
}

.gufy-check.is-expanded .gufy-check-chevron {
    transform: rotate(180deg);
}

/* ── Body: hidden by default, shown on expand ──────────────────── */
.gufy-check-body {
    display: none;
    border-top: 1px solid var(--color-border-light);
}

.gufy-check.is-expanded .gufy-check-body {
    display: block;
}

.gufy-check-body-inner {
    padding: 8px 10px 10px;
}

.gufy-check-subtitle {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin: 0 0 8px;
}

/* ── Competitor list ───────────────────────────────────────────── */
.gufy-check-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.gufy-check-group + .gufy-check-group {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--color-border-light);
}

.gufy-check-name {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--color-text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
}

.gufy-check-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    margin: 1px 0;
}

.gufy-check-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: break-word;
}

.gufy-check-value {
    font-size: 0.75rem;
}

.gufy-check-not-affiliated {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.gufy-check-label-not-affiliated {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    background: var(--color-bg-muted, #f3f4f6);
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}

html.dark-mode .gufy-check-label-not-affiliated {
    background: #374151;
    color: #9ca3af;
}

.gufy-check-value {
    font-weight: 700;
    color: var(--color-cashback-dark);
    white-space: nowrap;
    text-align: right;
}

.gufy-check-note {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

/* ── Desktop: show in sidebar, hide on mobile ──────────────────── */
.gufy-check-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .gufy-check-desktop {
        display: block;
        margin-top: 16px;
    }
}

/* ── Mobile: show below hero, hide on desktop ──────────────────── */
.gufy-check-mobile {
    display: none;
}

@media (max-width: 1023px) {
    .gufy-check-mobile {
        display: block;
        margin: 4px 0 12px;
    }
}

/* ── Merchant detail mobile: bottom shell + CTA convivono ──── */
@media (max-width: 767px) {
    /* Sposta la CTA sopra la bottom shell */
    .merchant-detail {
        max-width: 100%;
        overflow-x: hidden;
        padding-bottom: calc(80px + 150px + env(safe-area-inset-bottom, 0px));
    }
    .merchant-bottom-bar {
        bottom: calc(150px + env(safe-area-inset-bottom, 0px));
        z-index: 400;
    }

    /* ── Hero mobile sticky ────────────────────────────────────── */
    .merchant-hero-sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 50;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-border-light);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        padding: 10px 0 8px;
    }

    /* ── Hero header compatto ──────────────────────────────────── */
    .merchant-hero-sticky .merchant-detail-header {
        display: flex;
        gap: 16px;
        align-items: flex-start;
        margin-bottom: 0;
        padding: 0;
    }

    .merchant-hero-sticky .merchant-detail-logo {
        width: 120px;
        height: 120px;
        border-radius: var(--radius-md);
    }
    .merchant-hero-sticky .merchant-detail-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .merchant-hero-sticky .merchant-detail-logo-placeholder {
        width: 120px;
        height: 120px;
        border-radius: var(--radius-md);
        font-size: var(--font-size-2xl);
    }

    .merchant-hero-sticky .merchant-detail-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .merchant-hero-sticky .merchant-detail-name {
        font-size: 26px;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .merchant-hero-sticky .merchant-detail-cashback {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 6px;
        margin-bottom: 4px;
        max-width: 100%;
        min-width: 0;
    }
    .merchant-hero-sticky .cashback-value-large {
        font-size: 36px;
        flex: 0 0 100%;
        line-height: 1.1;
        margin-bottom: 2px;
    }

    .merchant-hero-sticky .badge {
        display: inline-flex;
        align-items: center;
        padding: 3px 8px;
        font-size: 11px;
        font-weight: 600;
        border-radius: var(--radius-full);
        line-height: 1;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .merchant-hero-sticky .merchant-detail-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 10px;
        font-size: 12px;
        color: var(--color-text-secondary);
        line-height: 1.3;
    }
    .merchant-hero-sticky .merchant-detail-meta .meta-item {
        white-space: nowrap;
    }

    /* ── Mobile CTA dentro la hero sticky ───────────────────────── */
    .merchant-hero-sticky .merchant-detail-mobile-cta {
        display: block;
        margin: 10px 0 0;
    }
    .merchant-hero-sticky .merchant-detail-mobile-cta-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 52px;
        padding: 12px 24px;
        font-size: var(--font-size-lg);
        font-weight: 700;
        border-radius: var(--radius-md);
        text-decoration: none;
        transition: opacity 0.2s;
    }
    .merchant-hero-sticky .merchant-detail-mobile-cta-btn:active {
        opacity: 0.9;
    }
    .merchant-hero-sticky .cta-microcopy {
        text-align: center;
        font-size: 11px;
        color: var(--color-text-muted);
        margin-top: 4px;
        line-height: 1.3;
    }

    /* ── Contenuto sotto la hero non nascosto ───────────────────── */
    .merchant-detail-main .merchant-stats-section {
        margin-top: 4px;
    }
}

.merchant-cta-btn {
    min-height: 48px;
    font-size: var(--font-size-base);
    font-weight: 700;
    border-radius: var(--radius-md);
}

/* ── Meta link CTA nascosto su mobile ────────────────────────────── */
.meta-cta-link-desktop {
    display: none;
}

/* ── Hero card (desktop) ────────────────────────────────────── */
@media (min-width: 1024px) {
    .merchant-hero-sticky {
        padding: 12px 0;
        margin: 0;
    }

    .merchant-hero-sticky .merchant-detail-header {
        margin-bottom: 0;
        margin-top: 0;
    }

    .merchant-detail-main > :first-child {
        margin-top: 0;
    }

    .meta-cta-link-desktop {
        display: inline;
    }
}

/* ── Section padding ridotto nel merchant-detail ─────────────────── */
.merchant-detail-main .section {
    padding: 24px 0;
}

.merchant-detail-main .section:first-of-type {
    padding-top: 0;
}

/* ── Categorie accordion ──────────────────────────────────────────── */
.cashback-item-hidden {
    display: none;
}

.cashback-list-expanded .cashback-item-hidden {
    display: flex;
}

.cashback-toggle-btn {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-cashback);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: color 0.2s;
}

.cashback-toggle-btn:hover {
    color: var(--color-cashback-dark);
}

.cashback-toggle-btn::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
}

.cashback-toggle-btn[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* ========================================================================
   Bottom bar mobile
   ======================================================================== */

.merchant-bottom-bar {
    display: none;
}

@media (max-width: 1023px) {
    .merchant-detail {
        max-width: 100%;
        overflow-x: hidden;
        padding-bottom: 80px;
    }

    .merchant-bottom-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        z-index: 200;
        background: var(--color-bg-card);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .merchant-bottom-bar-inner {
        max-width: 480px;
        margin: 0 auto;
        padding: 0 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .merchant-bottom-bar-info {
        min-width: 0;
        flex: 0 1 auto;
    }

    .merchant-bottom-bar-label {
        display: block;
        font-size: var(--font-size-xs);
        font-weight: 600;
        color: var(--color-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        line-height: 1.1;
        margin-bottom: 2px;
    }

    .merchant-bottom-bar-value {
        display: block;
        font-size: var(--font-size-xl);
        font-weight: 800;
        color: var(--color-cashback);
        line-height: var(--line-height-tight);
        white-space: nowrap;
    }

    .merchant-bottom-bar-btn {
        flex: 0 0 auto;
        min-height: 48px;
        min-width: 160px;
        padding: 10px 24px;
        font-size: var(--font-size-base);
        font-weight: 700;
        border-radius: var(--radius-md);
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .merchant-bottom-bar-inner {
        gap: 8px;
        padding: 0 12px;
    }

    .merchant-bottom-bar-value {
        font-size: var(--font-size-lg);
    }

    .merchant-bottom-bar-btn {
        min-width: 140px;
        padding-left: 14px;
        padding-right: 14px;
        min-height: 44px;
    }
}

/* ==========================================================================
   User Area — Sidebar & Navigation
   ========================================================================== */

.user-sidebar {
    display: none;
}

.user-mobile-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 56px;
    z-index: 50;
    margin: 0 -16px;
    padding: 0 16px;
}

.user-mobile-nav::-webkit-scrollbar {
    display: none;
}

.user-mobile-nav-list {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    min-width: 100%;
}

.user-mobile-nav-item {
    flex: 0 0 auto;
}

.user-mobile-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
    transition:
        background 0.15s,
        color 0.15s;
    text-decoration: none;
    position: relative;
}

.user-mobile-link:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.user-mobile-link--active {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    font-weight: 600;
}

.user-mobile-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-mobile-icon svg {
    width: 18px;
    height: 18px;
}

.user-mobile-label {
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
}

.user-mobile-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--color-coral);
    color: var(--color-white);
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

@media (min-width: 768px) {
    .user-mobile-nav {
        display: none;
    }

    .user-sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        flex-shrink: 0;
        background: var(--color-white);
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border-light);
        padding: 16px 0;
        align-self: flex-start;
        position: sticky;
        top: 72px;
    }

    .user-content {
        flex: 1;
        min-width: 0;
    }

    .user-layout {
        display: flex;
        gap: 32px;
        align-items: flex-start;
        max-width: 1320px;
        margin: 0 auto;
        padding: 28px 32px;
    }
}

.user-sidebar-header {
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 8px;
}

.user-sidebar-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.user-nav-item {
    list-style: none;
}

.user-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
    position: relative;
}

.user-nav-link:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.user-nav-link--active {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    font-weight: 600;
}

.user-nav-link--active .user-nav-icon svg {
    stroke: var(--color-cashback-dark);
}

.user-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-nav-icon svg {
    width: 18px;
    height: 18px;
}

.user-nav-label {
    flex: 1;
}

.user-nav-badge {
    background: var(--color-coral);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    line-height: 1;
}

.user-sidebar-referral {
    padding: 16px;
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

.user-sidebar-referral-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.user-sidebar-referral-code {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 1px;
}

.user-sidebar-footer {
    padding: 12px 8px 0;
    border-top: 1px solid var(--color-border-light);
    margin-top: 8px;
}

.user-nav-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-coral);
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.user-nav-logout:hover {
    background: var(--color-coral-light);
}

.user-nav-logout svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Header — User Dropdown Button
   ========================================================================== */

.header-user-dropdown {
    position: relative;
    display: inline-flex;
}

.header-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    white-space: nowrap;
    min-height: 36px;
}

.header-user-btn:hover {
    border-color: var(--color-cashback);
    box-shadow: 0 1px 4px rgba(0, 184, 148, 0.12);
}

.header-user-btn:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: 2px;
}

.header-user-btn-text {
    line-height: 1;
}

.header-user-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--color-text-muted);
}

.header-user-chevron.is-open {
    transform: rotate(180deg);
}

/* ── Dropdown ────────────────────────────────── */

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    min-width: 260px;
    max-width: 300px;
}

.user-dropdown[hidden] {
    display: none;
}

.user-dropdown-arrow {
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
    z-index: 1;
}

.user-dropdown-body {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.user-dropdown-list {
    list-style: none;
    padding: 6px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-dropdown-item {
    list-style: none;
}

.user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
}

.user-dropdown-link:hover {
    background: var(--color-bg-alt);
    color: var(--color-text-primary);
}

.user-dropdown-link:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: -2px;
}

.user-dropdown-link--active {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    font-weight: 600;
}

.user-dropdown-link--active .user-dropdown-icon svg {
    stroke: var(--color-cashback-dark);
}

.user-dropdown-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown-icon svg {
    width: 18px;
    height: 18px;
}

.user-dropdown-label {
    flex: 1;
}

.user-dropdown-badge {
    background: var(--color-coral);
    color: var(--color-white);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: 0 6px;
}

.user-dropdown-referral {
    padding: 8px 6px;
}

.user-dropdown-copy-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.user-dropdown-copy-link:hover {
    background: var(--color-accent-light);
}

.user-dropdown-copy-link svg {
    flex-shrink: 0;
}

.user-dropdown-footer {
    padding: 6px;
}

.user-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-coral);
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.user-dropdown-logout:hover {
    background: var(--color-coral-light);
}

.user-dropdown-logout svg {
    flex-shrink: 0;
}

/* ── Header logout icon button (subtle) ──────── */

.header-logout-icon-form {
    display: inline-flex;
}

.header-logout-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition:
        color 0.2s,
        background 0.2s;
}

.header-logout-icon-btn:hover {
    color: var(--color-coral);
    background: var(--color-coral-light);
}

.header-logout-icon-btn:focus-visible {
    outline: 2px solid var(--color-coral);
    outline-offset: 2px;
}

.header-logout-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Update user-layout for no sidebar ───────── */

@media (min-width: 768px) {
    .user-layout {
        display: block;
        max-width: 1000px;
        margin: 0 auto;
        padding: 28px 32px;
    }

    .user-content {
        width: 100%;
    }
}

/* ── Dark mode: dropdown ─────────────────────── */

html.dark-mode .header-user-btn {
    background: var(--color-bg-card, #1e293b);
    border-color: #475569;
    color: #f1f5f9;
}

html.dark-mode .header-user-btn:hover {
    border-color: #00b894;
    box-shadow: 0 0 0 1px rgba(0, 184, 148, 0.15);
}

html.dark-mode .user-dropdown-body {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .user-dropdown-arrow {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .user-dropdown-link {
    color: #94a3b8;
}

html.dark-mode .user-dropdown-link:hover {
    background: #0f172a;
    color: #f8fafc;
}

html.dark-mode .user-dropdown-link--active {
    background: rgba(0, 184, 148, 0.15);
    color: #00b894;
}

html.dark-mode .user-dropdown-link--active .user-dropdown-icon svg {
    stroke: #00b894;
}

html.dark-mode .user-dropdown-divider {
    background: #334155;
}

html.dark-mode .user-dropdown-copy-link {
    color: #a78bfa;
}

html.dark-mode .user-dropdown-copy-link:hover {
    background: rgba(108, 92, 231, 0.15);
}

html.dark-mode .user-dropdown-logout {
    color: #f87171;
}

html.dark-mode .user-dropdown-logout:hover {
    background: rgba(255, 107, 107, 0.15);
}

/* Logout icon in dark mode: più elegante e secondario */
html.dark-mode .header-logout-icon-btn {
    color: #64748b;
    border: none;
    background: transparent;
    opacity: 0.7;
}

html.dark-mode .header-logout-icon-btn:hover {
    color: #fca5a5;
    background: rgba(255, 107, 107, 0.08);
    opacity: 1;
}

html.dark-mode .user-dropdown-badge {
    background: #dc2626;
}

/* ==========================================================================
   User Area — Dashboard Stat Cards
   ========================================================================== */

.dashboard-cards-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 480px) {
    .dashboard-cards-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dashboard-stat-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--color-border-light);
    transition: box-shadow 0.2s;
}

.dashboard-stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.dashboard-stat-card--primary {
    border-color: var(--color-cashback);
    background: linear-gradient(
        135deg,
        var(--color-cashback-light) 0%,
        var(--color-white) 100%
    );
}

.stat-card-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-bottom: 8px;
}

.stat-card-value--pending {
    color: var(--color-accent);
}

.stat-card-action {
    font-size: var(--font-size-sm);
    color: var(--color-cashback-dark);
    font-weight: 600;
    text-decoration: none;
}

.stat-card-action:hover {
    text-decoration: underline;
}

/* ==========================================================================
   User Area — Dashboard CTA Row
   ========================================================================== */

.dashboard-cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 480px) {
    .dashboard-cta-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .dashboard-cta-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dashboard-cta-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    text-decoration: none;
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
}

.dashboard-cta-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-cashback);
}

.dashboard-cta-card--highlight {
    border-color: var(--color-cashback);
    background: var(--color-cashback-light);
}

.dashboard-cta-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.dashboard-cta-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ==========================================================================
   User Area — List Item Avatar (merchant mini logo)
   ========================================================================== */

.list-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.merchant-mini-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.merchant-mini-logo[style*="display: none"] + .merchant-mini-logo-placeholder,
.merchant-mini-logo:not([src]) ~ .merchant-mini-logo-placeholder {
    display: flex;
}

.merchant-mini-logo-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-muted);
}

.list-item-avatar .merchant-mini-logo-placeholder:only-child {
    display: flex;
}

/* ==========================================================================
   User Area — Info Toggle (how it works)
   ========================================================================== */

.dashboard-info-toggle {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.dashboard-info-summary {
    padding: 16px;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.dashboard-info-summary::-webkit-details-marker {
    display: none;
}

.dashboard-info-summary::after {
    content: "+ Mostra";
    float: right;
    font-weight: 500;
    color: var(--color-cashback);
    font-size: var(--font-size-xs);
}

.dashboard-info-toggle[open] .dashboard-info-summary::after {
    content: "- Nascondi";
}

.dashboard-info-content {
    padding: 0 16px 16px;
}

/* Compact steps list */
.steps-list--compact .step-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.steps-list--compact .step-item:not(:last-child) {
    border-bottom: 1px solid var(--color-border-light);
}

.steps-list--compact .step-number {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-cashback);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    flex-shrink: 0;
}

.steps-list--compact .step-content h3 {
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
}

.steps-list--compact .step-content p {
    font-size: var(--font-size-xs);
    line-height: 1.5;
}

/* ==========================================================================
   User Area — Referral Page — Enhanced Promo Hero
   ========================================================================== */

/* ── Hero container ─────────────────────────────── */
.ref-hero {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    margin-bottom: 24px;
    overflow: hidden;
}

.ref-hero-main {
    display: flex;
    gap: 32px;
    align-items: center;
    padding: 40px 36px;
}

.ref-hero-text {
    flex: 1;
    min-width: 280px;
}

.ref-hero-headline {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.ref-hero-bonus {
    color: var(--color-cashback);
    font-weight: 900;
    white-space: nowrap;
}

/* ── Value card — dual benefits ────────────────── */
.ref-value-card {
    display: inline-flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    border-radius: var(--radius-lg);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    margin-bottom: 24px;
    overflow: hidden;
}

html.dark-mode .ref-value-card {
    background: rgba(30, 41, 59, 0.6);
}

.ref-value-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 28px;
    gap: 4px;
}

.ref-value-block-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.3;
    text-align: center;
}

.ref-value-block-amount {
    font-weight: 900;
    color: var(--color-cashback);
    line-height: 1;
    letter-spacing: -1px;
}

.ref-value-block--primary .ref-value-block-amount {
    font-size: 44px;
}

.ref-value-block--secondary .ref-value-block-amount {
    font-size: 34px;
    color: var(--color-text-secondary);
}

.ref-value-block-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.4;
    text-align: center;
    max-width: 220px;
}

.ref-value-divider {
    width: 1px;
    background: var(--color-border-light);
    flex-shrink: 0;
}

/* ── Hero subtitle ──────────────────────────────── */
.ref-hero-sub {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 520px;
}

/* ── Link box ───────────────────────────────────── */
.ref-link-box {
    margin-bottom: 16px;
}

.ref-link-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.ref-link-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.ref-link-input {
    flex: 1;
    min-width: 0;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: var(--font-size-sm);
    color: var(--color-cashback);
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    outline: none;
    cursor: default;
}

html.dark-mode .ref-link-input {
    background: #0f172a;
    border-color: var(--color-border);
    color: #34d399;
}

/* ── Copy CTA button ────────────────────────────── */
.ref-copy-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.ref-copy-btn.btn-lg {
    min-height: 52px;
    padding: 14px 28px;
    font-size: var(--font-size-base);
}

/* ── Share buttons row ──────────────────────────── */
.ref-share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.85;
}

.share-btn--whatsapp {
    background: #25d366;
    color: var(--color-white);
}

.share-btn--email {
    background: var(--color-text-secondary);
    color: var(--color-white);
}

/* ── Hero image ─────────────────────────────────── */
.ref-hero-image-wrap {
    flex-shrink: 0;
    position: relative;
}

.ref-hero-image {
    width: 220px;
    height: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.dark-mode .ref-hero-image {
    background: #1e293b;
}

.ref-hero-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ==========================================================================
   Referral Steps — Clean card style
   ========================================================================== */

.ref-steps-section {
    margin-bottom: 24px;
}

.ref-steps-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 24px 28px;
}

.ref-steps-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 20px;
}

.ref-steps-grid {
    display: flex;
    gap: 20px;
}

.ref-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.ref-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-cashback-light);
    color: var(--color-cashback);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.ref-step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ref-step-body strong {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.ref-step-body span {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   Referral Conditions — How to unlock
   ========================================================================== */

.ref-conditions {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.ref-conditions-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
}

.ref-conditions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ref-condition-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-cashback);
    background: var(--color-bg-alt);
}

html.dark-mode .ref-condition-card {
    background: rgba(30, 41, 59, 0.6);
}

.ref-condition-card:last-child {
    border-left-color: var(--color-text-muted);
}

.ref-condition-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ref-condition-label {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-primary);
    flex: 1;
}

.ref-condition-amount {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-cashback);
}

.ref-condition-card:last-child .ref-condition-amount {
    color: var(--color-text-muted);
}

.ref-condition-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.ref-condition-desc strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

.ref-conditions-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
}

/* ==========================================================================
   Referral — Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ref-hero-main {
        flex-direction: column-reverse;
        padding: 24px 20px;
        gap: 20px;
        text-align: center;
    }

    .ref-hero-text {
        width: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .ref-hero-headline {
        font-size: 22px;
    }

    .ref-hero-sub {
        font-size: var(--font-size-sm);
        max-width: 100%;
    }

    .ref-value-card {
        flex-direction: column;
        align-items: stretch;
    }

    .ref-value-block {
        padding: 18px 20px;
    }

    .ref-value-block--primary .ref-value-block-amount {
        font-size: 36px;
    }

    .ref-value-block--secondary .ref-value-block-amount {
        font-size: 28px;
    }

    .ref-value-block-note {
        max-width: 100%;
    }

    .ref-value-divider {
        width: auto;
        height: 1px;
        margin: 0 20px;
    }

    .ref-link-row {
        flex-direction: column;
    }

    .ref-copy-btn {
        width: 100%;
    }

    .ref-share-buttons {
        justify-content: center;
        width: 100%;
    }

    .ref-share-buttons .share-btn {
        flex: 1;
        justify-content: center;
    }

    .ref-hero-image-wrap {
        margin-bottom: 0;
    }

    .ref-hero-image {
        width: 140px;
        height: 140px;
    }

    /* Steps responsive */
    .ref-steps-card {
        padding: 20px 16px;
    }

    .ref-steps-grid {
        flex-direction: column;
        gap: 16px;
    }

    .ref-step-item {
        width: 100%;
    }

    /* Conditions responsive */
    .ref-conditions-grid {
        grid-template-columns: 1fr;
    }

    .ref-conditions {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .ref-hero-main {
        padding: 20px 16px;
    }

    .ref-value-block {
        padding: 16px 16px;
    }

    .ref-value-block--primary .ref-value-block-amount {
        font-size: 32px;
    }

    .ref-value-block--secondary .ref-value-block-amount {
        font-size: 26px;
    }

    .ref-value-divider {
        margin: 0 16px;
    }

    .ref-hero-headline {
        font-size: 20px;
    }

    .ref-hero-image {
        width: 120px;
        height: 120px;
    }

    .ref-share-buttons {
        flex-direction: column;
    }

    .ref-share-buttons .share-btn {
        width: 100%;
    }
}

/* ==========================================================================
   User Area — Referral Bonus Cards & Progress
   ========================================================================== */

.referral-info-box {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 20px 24px;
    margin-bottom: 24px;
    line-height: 1.7;
}

.referral-info-box p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.referral-info-box strong {
    color: var(--color-cashback);
}

/* Bonus cards grid */
.referral-bonus-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.referral-bonus-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 20px;
    transition: box-shadow 0.2s;
}

.referral-bonus-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.referral-bonus-type {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
}

.referral-bonus-amount {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-cashback);
    white-space: nowrap;
}

/* Status badges */
.referral-bonus-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.referral-bonus-status--pending {
    background: #fef3c7;
    color: #92400e;
}

html.dark-mode .referral-bonus-status--pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.referral-bonus-status--available {
    background: #dbeafe;
    color: #1e40af;
}

html.dark-mode .referral-bonus-status--available {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.referral-bonus-status--credited {
    background: #d1fae5;
    color: #065f46;
}

html.dark-mode .referral-bonus-status--credited {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.referral-bonus-status--expired {
    background: #f3f4f6;
    color: #6b7280;
}

html.dark-mode .referral-bonus-status--expired {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.referral-bonus-status--cancelled {
    background: #fce4ec;
    color: #9c27b0;
}

html.dark-mode .referral-bonus-status--cancelled {
    background: rgba(156, 39, 176, 0.15);
    color: #ce93d8;
}

/* Bonus body grid */
.referral-bonus-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

@media (max-width: 480px) {
    .referral-bonus-body {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.referral-bonus-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.referral-bonus-field-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.referral-bonus-field-value {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    font-weight: 500;
}

/* Progress bar */
.referral-progress {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.referral-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.referral-progress-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--color-cashback),
        var(--color-cashback-dark)
    );
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.referral-progress-bar-fill--complete {
    background: linear-gradient(90deg, #10b981, #059669);
}

.referral-progress-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.referral-progress-label strong {
    color: var(--color-cashback);
}

/* Bonus empty state */
.referral-bonus-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Dashboard referral summary card */
.dashboard-referral-summary {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-referral-summary-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-cashback-light);
    color: var(--color-cashback);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.dashboard-referral-summary-body {
    flex: 1;
    min-width: 200px;
}

.dashboard-referral-summary-body h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 4px;
}

.dashboard-referral-summary-body p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.dashboard-referral-summary-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.dashboard-referral-stat {
    text-align: center;
}

.dashboard-referral-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-cashback);
}

.dashboard-referral-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.dashboard-referral-summary-action {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .dashboard-referral-summary {
        flex-direction: column;
        text-align: center;
    }
    .dashboard-referral-summary-stats {
        width: 100%;
        justify-content: center;
    }
    .dashboard-referral-summary-action {
        width: 100%;
    }
    .dashboard-referral-summary-action .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   User Area — Profile Page
   ========================================================================== */

.profile-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    padding: 24px;
    margin-bottom: 24px;
}

.profile-section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-light);
}

.profile-info-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-info-table td {
    padding: 8px 0;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.profile-info-table td:first-child {
    font-weight: 600;
    color: var(--color-text-muted);
    width: 160px;
    padding-right: 16px;
}

.profile-info-table td:last-child {
    color: var(--color-text-primary);
}

.profile-info-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   User Area — Support / FAQ
   ========================================================================== */

.support-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.support-faq-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.support-faq-question {
    padding: 16px;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-faq-question::-webkit-details-marker {
    display: none;
}

.support-faq-question::after {
    content: "+";
    font-size: 18px;
    font-weight: 700;
    color: var(--color-cashback);
    transition: transform 0.2s;
}

.support-faq-item[open] .support-faq-question::after {
    content: "−";
}

.support-faq-answer {
    padding: 0 16px 16px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.support-cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .support-cta-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   User Area — Ticket detail
   ========================================================================== */

.ticket-message {
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: var(--font-size-sm);
    white-space: pre-wrap;
}

.ticket-admin-reply {
    background: var(--color-cashback-light);
    border: 1px solid var(--color-cashback);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.ticket-admin-reply-header {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-cashback-dark);
    margin-bottom: 8px;
}

.ticket-admin-reply-body {
    font-size: var(--font-size-sm);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ==========================================================================
   User Area — Breadcrumb
   ========================================================================== */

.user-breadcrumb {
    margin-bottom: 16px;
    font-size: var(--font-size-sm);
}

.user-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}

.user-breadcrumb li + li::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background: var(--color-text-muted);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E")
        center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E")
        center/contain no-repeat;
    flex-shrink: 0;
}

.user-breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.user-breadcrumb a:hover {
    color: var(--color-cashback);
}

.user-breadcrumb [aria-current="page"] {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* ==========================================================================
   User Area — Responsive layout for desktop
   ========================================================================== */

@media (min-width: 768px) {
    .main-content .dashboard:first-child {
        /* When inside user-layout */
    }
}

/* Inline info styles */
.info-box {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.info-box h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 8px;
}

.info-box ul {
    list-style: disc;
    padding-left: 20px;
    font-size: var(--font-size-sm);
}

.info-box li {
    margin-bottom: 4px;
    color: var(--color-text-secondary);
}

.info-box-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.info-box-info {
    background: var(--color-cashback-light);
    border: 1px solid var(--color-cashback);
    color: var(--color-text-primary);
}

.form-separator {
    height: 1px;
    background: var(--color-border-light);
    margin: 32px 0;
}

/* ==========================================================================
   Mega Menu Categorie Cashback (Desktop) — Restyling 2025
   ========================================================================== */

/* Nascondi su mobile (< 1024px) */
@media (max-width: 1023px) {
    .main-nav {
        display: none;
    }
}

@media (min-width: 1024px) {
    .main-nav {
        display: flex;
        flex: 0 1 auto;
        justify-content: center;
        margin: 0 8px;
        position: relative;
    }

    .main-nav-list {
        display: flex;
        align-items: center;
        gap: 4px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .main-nav-item {
        position: relative;
    }

    .main-nav-item--megamenu {
        position: static;
    }

    .main-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 6px 10px;
        font-size: var(--font-size-sm);
        font-weight: 600;
        color: var(--color-text-primary);
        text-decoration: none;
        border-radius: var(--radius-sm);
        transition:
            background 0.2s,
            color 0.2s;
        white-space: nowrap;
        background: none;
        border: none;
        cursor: pointer;
        line-height: 1.4;
    }

    .main-nav-link:hover {
        background: var(--color-bg);
        color: var(--color-cashback);
    }

    .main-nav-link:focus-visible {
        outline: 2px solid var(--color-cashback);
        outline-offset: 2px;
    }

    .main-nav-chevron {
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .main-nav-link--trigger[aria-expanded="true"] .main-nav-chevron {
        transform: rotate(180deg);
    }

    /* --- Mega menu: contenitore --- */
    .megamenu {
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%) translateY(4px);
        background: var(--color-white);
        border: 1px solid #e5e7eb;
        border-radius: 20px;
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.1),
            0 2px 8px rgba(0, 0, 0, 0.04);
        min-width: 620px;
        max-width: 940px;
        width: max-content;
        z-index: 200;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            opacity 0.25s ease,
            visibility 0.25s ease,
            transform 0.25s ease;
        transform-origin: top center;
    }

    @media (max-width: 1100px) {
        .megamenu {
            min-width: 500px;
            max-width: calc(100vw - 32px);
            border-radius: 16px;
        }
    }

    .megamenu.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
    }

    .megamenu-inner {
        padding: 14px 20px 8px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    /* --- Contenitore colonne (4 colonne CSS) --- */
    .megamenu-cols {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0 16px;
        align-items: start;
    }

    /* --- Lista alfabetica categorie --- */
    .megamenu-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .megamenu-list li {
        margin: 0;
        padding: 0;
    }

    .megamenu-link {
        display: block;
        padding: 5px 0;
        font-size: 0.875rem;
        font-weight: 400;
        color: #4b5563;
        text-decoration: none;
        border-radius: 4px;
        transition:
            color 0.15s ease,
            background 0.15s ease,
            padding-left 0.15s ease;
        line-height: 1.3;
    }

    .megamenu-link:hover {
        color: var(--color-cashback-dark);
        background: var(--color-cashback-light);
        padding-left: 6px;
    }

    .megamenu-link:focus-visible {
        outline: 2px solid var(--color-cashback);
        outline-offset: 1px;
    }

    /* --- Footer CTA --- */
    .megamenu-footer {
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #e5e7eb;
    }

    .megamenu-footer-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
}

/* ==========================================================================
   Header Search Desktop (visibile solo su >= 1024px)
   ========================================================================== */
.header-search-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .header-search-desktop {
        display: flex;
        flex: 1;
        max-width: 320px;
        margin: 0 8px;
    }

    .header-search-desktop-form {
        display: flex;
        align-items: center;
        width: 100%;
        position: relative;
    }

    .header-search-desktop-input {
        width: 100%;
        height: 38px;
        padding: 0 38px 0 14px;
        font-size: var(--font-size-sm);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-full);
        background: var(--color-bg);
        color: var(--color-text-primary);
        outline: none;
        transition:
            border-color 0.2s,
            box-shadow 0.2s;
    }

    .header-search-desktop-input::placeholder {
        color: var(--color-text-muted);
    }

    .header-search-desktop-input:focus {
        border-color: var(--color-cashback);
        box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
        background: var(--color-white);
    }

    .header-search-desktop-btn {
        position: absolute;
        right: 2px;
        top: 50%;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border: none;
        background: transparent;
        color: var(--color-text-muted);
        cursor: pointer;
        border-radius: var(--radius-full);
        transition:
            color 0.2s,
            background 0.2s;
    }

    .header-search-desktop-btn:hover {
        color: var(--color-cashback);
        background: var(--color-cashback-light);
    }
}

/* ==========================================================================
   Merchant Detail — Nuovo layout a griglia
   ========================================================================== */
.merchant-detail-layout {
    display: block;
}

@media (min-width: 1024px) {
    .merchant-detail-layout {
        max-width: none;
        padding: 0;
    }
}

/* ── Hero area clean ──────────────────────────────────────────── */
.merchant-detail-hero {
    position: relative;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border-light);
    padding: 16px 28px;
    overflow: hidden;
    transition:
        box-shadow 0.3s ease,
        padding 0.3s ease;
}

/* Sfondo decorativo categoria */
.merchant-detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--merchant-hero-bg, none);
    background-size: cover;
    background-position: center;
    opacity: 1;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 0;
    pointer-events: none;
}

.merchant-detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.42) 0%,
        rgba(255, 255, 255, 0.34) 35%,
        rgba(255, 255, 255, 0.22) 65%,
        rgba(255, 255, 255, 0.1) 100%
    );
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1;
    pointer-events: none;
}

.merchant-detail-hero > * {
    position: relative;
    z-index: 2;
}

/* Leggera ombra testo per leggibilità su sfondo */
.merchant-detail-hero h1,
.merchant-detail-name {
    text-shadow: 0 1px 8px rgba(255, 255, 255, 0.65);
}

/* Su desktop la hero NON e' piu sticky — la floating bar la sostituisce */

/* scroll-margin-top per sezioni con anchor */
#merchant-cashback-section {
    scroll-margin-top: calc(
        var(--site-header-height, 64px) +
            var(--merchant-sticky-hero-height, 136px) + 24px
    );
}
.section {
    scroll-margin-top: calc(
        var(--site-header-height, 64px) +
            var(--merchant-sticky-hero-height, 136px) + 16px
    );
}

.merchant-detail-hero-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ── Hero main wrapper (logo + info + CTA) ─────────────────── */
.merchant-hero-main {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

@media (max-width: 767px) {
    .merchant-hero-main {
        gap: 16px;
    }
}

/* Desktop: hero inside .merchant-detail grid — no double padding */
@media (min-width: 1024px) {
    .merchant-detail-hero .site-container {
        max-width: none;
        padding: 0;
    }

    .merchant-detail-hero-inner {
        display: flex;
        align-items: center;
        gap: 24px;
    }

    .merchant-hero-main {
        width: 100%;
    }
}

/* Card bianca grande che copre tutto il contenuto hero (logo + info + CTA) */
.merchant-hero-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 30px;
    padding: 20px 28px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    width: 100%;
    position: relative;
    z-index: 3;
}

@media (max-width: 767px) {
    .merchant-hero-content {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px 18px 14px;
        border-radius: 20px;
        justify-items: center;
    }
}

html.dark-mode .merchant-hero-content {
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.merchant-detail-hero .merchant-detail-logo {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-white);
    border: none;
    outline: none;
    box-shadow: none;
    filter: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.merchant-detail-hero .merchant-detail-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    outline: none;
}

.merchant-detail-hero .merchant-detail-logo-placeholder {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-2xl);
    color: var(--color-text-muted);
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: none;
    outline: none;
    box-shadow: none;
    filter: none;
}

/* ── Hero mobile rimpicciolito ───────────────────────────────────── */
@media (max-width: 767px) {
    .merchant-detail-hero {
        padding: 12px 12px 8px;
    }
    .merchant-detail-hero::before {
        opacity: 1;
        filter: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background-position: center 20%;
    }
    .merchant-detail-hero::after {
        background: rgba(255, 255, 255, 0.48);
        filter: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .merchant-detail-hero-inner {
        flex-wrap: wrap;
        gap: 0;
    }

    /* ── Logo molto più grande, dominante ─────────────────────────── */
    .merchant-detail-hero .merchant-detail-logo {
        width: clamp(150px, 46vw, 200px);
        height: clamp(100px, 28vw, 130px);
        border-radius: var(--radius-md);
        justify-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
    }
    .merchant-detail-hero .merchant-detail-logo img {
        width: auto;
        height: auto;
        max-width: 96%;
        max-height: 96%;
        object-fit: contain;
        display: block;
    }
    .merchant-detail-hero .merchant-detail-logo-placeholder {
        width: clamp(150px, 46vw, 200px);
        height: clamp(100px, 28vw, 130px);
        font-size: var(--font-size-2xl);
        border-radius: var(--radius-md);
    }

    .merchant-detail-hero .merchant-detail-name {
        font-size: 21px;
        margin-bottom: 4px;
        text-align: center;
    }
    .merchant-detail-hero .cashback-value-large {
        font-size: 1.35rem;
    }
    .merchant-detail-hero .merchant-detail-cashback {
        gap: 6px;
        margin-bottom: 4px;
        justify-content: center;
    }
    .merchant-detail-hero .merchant-detail-meta {
        gap: 4px 10px;
        font-size: 0.75rem;
        justify-content: center;
    }
}

.merchant-detail-hero .merchant-detail-info {
    flex: 1;
    min-width: 0;
    max-width: 620px;
}

.merchant-detail-hero .merchant-detail-name {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .merchant-detail-hero .merchant-detail-name {
        font-size: var(--font-size-3xl);
    }
}

.merchant-detail-hero .merchant-detail-cashback {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.merchant-detail-hero .cashback-value-large {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-cashback);
    line-height: 1;
}

@media (min-width: 768px) {
    .merchant-detail-hero .cashback-value-large {
        font-size: 2.25rem;
    }
}

.merchant-detail-hero .merchant-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.merchant-detail-hero .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── Hero CTA desktop ─────────────────────────────────────────── */
.merchant-detail-hero-cta {
    flex-shrink: 0;
}

.merchant-detail-hero-cta .btn-hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    min-width: 200px;
    padding: 10px 32px;
    font-size: var(--font-size-lg);
    font-weight: 800;
    border-radius: var(--radius-md);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.25);
}

.merchant-detail-hero-cta .cta-microcopy {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 4px;
    text-align: center;
}

/* ── Stelline recensioni negozio ──────────────────────────────── */
.merchant-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 8px;
    margin-bottom: 2px;
}

.merchant-stars-stars {
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: 3px;
    color: #f59e0b;
    user-select: none;
}

html.dark-mode .merchant-stars-stars {
    color: #fbbf24;
}

.merchant-stars-label {
    font-size: 11px;
    line-height: 1.3;
    color: var(--color-text-muted);
    margin-top: 1px;
}

/* Mobile CTA: stelline centrate */
.merchant-detail-mobile-cta .merchant-stars {
    margin-top: 6px;
    margin-bottom: 2px;
}

.merchant-detail-mobile-cta .merchant-stars-stars {
    font-size: 16px;
    letter-spacing: 2px;
}

.merchant-detail-mobile-cta .merchant-stars-label {
    font-size: 10px;
}

@media (max-width: 1023px) {
    .merchant-detail-hero-cta {
        display: none;
    }
}

/* ── Gufy nuovo posizionamento vicino alle offerte ────────────── */
.gufy-check-near-offers {
    margin-bottom: 20px;
}

.gufy-check-near-offers .gufy-check-toggle {
    padding: 12px 16px;
}

.gufy-check-near-offers .gufy-check-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.gufy-check-near-offers .gufy-check-body-inner {
    padding: 12px 16px 16px;
}

.gufy-check-near-offers .gufy-check-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.gufy-check-near-offers .gufy-check-name {
    font-size: var(--font-size-sm);
}

.gufy-check-near-offers .gufy-check-value {
    font-size: var(--font-size-sm);
}

.gufy-check-near-offers .gufy-check-label {
    font-size: var(--font-size-xs);
}

@media (min-width: 1024px) {
    .gufy-check-near-offers {
        display: none;
    }
}

@media (min-width: 1024px) {
    .megamenu-cta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 28px;
        font-size: 0.9375rem;
        font-weight: 700;
        color: var(--color-white);
        background: var(--color-cashback);
        text-decoration: none;
        border-radius: 10px;
        transition:
            background 0.2s ease,
            transform 0.15s ease,
            box-shadow 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 184, 148, 0.25);
        line-height: 1.3;
    }

    .megamenu-cta:hover {
        background: var(--color-cashback-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 14px rgba(0, 184, 148, 0.35);
    }

    .megamenu-cta:active {
        transform: scale(0.97);
    }

    .megamenu-cta:focus-visible {
        outline: 2px solid var(--color-cashback);
        outline-offset: 3px;
    }

    .megamenu-cta svg {
        flex-shrink: 0;
    }

    .megamenu-cta-text {
        white-space: nowrap;
    }

    .megamenu-cta-sub {
        margin: 0;
        font-size: 0.8125rem;
        color: #9ca3af;
        line-height: 1.4;
    }

    /* Su viewport tra 1024px e 1200px: colonne piu compatte */
    @media (max-width: 1200px) {
        .megamenu {
            max-width: 820px;
        }
        .megamenu-cols {
            grid-template-columns: repeat(4, 1fr);
            gap: 0 10px;
        }
        .megamenu-link {
            font-size: 0.8125rem;
            padding: 4px 0;
        }
    }

    @media (max-width: 1024px) {
        .megamenu {
            min-width: 0;
            max-width: calc(100vw - 24px);
            width: calc(100vw - 24px);
            left: 50%;
            border-radius: 14px;
        }
        .megamenu-cols {
            grid-template-columns: repeat(2, 1fr);
            gap: 0 12px;
        }
        .megamenu-link {
            font-size: 0.8125rem;
            padding: 4px 0;
        }
    }
}

/* ==========================================================================
   Merchant Autocomplete Dropdown (suggeritore live)
   ========================================================================== */

.merchant-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 420px;
    overflow-y: auto;
    padding: 6px 0;
}

.ma-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: background 0.15s ease;
    cursor: pointer;
}

.ma-item:hover,
.ma-item.is-highlighted {
    background: var(--color-bg);
}

.ma-item.is-highlighted {
    background: var(--color-bg-alt);
}

.ma-logo {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ma-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.ma-logo-placeholder {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.ma-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ma-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ma-cashback {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-cashback);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ma-arrow {
    flex-shrink: 0;
    color: var(--color-text-muted);
    opacity: 0.6;
    transition:
        opacity 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
    display: flex;
    align-items: center;
}

.ma-item:hover .ma-arrow,
.ma-item.is-highlighted .ma-arrow {
    opacity: 1;
    color: var(--color-cashback);
    transform: translateX(3px);
}

/* -- Mobile adjustments -- */
@media (max-width: 767px) {
    .merchant-autocomplete-dropdown {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: auto;
        max-height: 50vh;
        border-radius: var(--radius-md);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    }

    /* Nella mobile cmd bar, il dropdown parte sopra la barra */
    .mobile-cmd-search .merchant-autocomplete-dropdown {
        position: absolute;
        bottom: calc(100% + 4px);
        top: auto;
        left: 0;
        right: 0;
        max-height: 60vh;
    }

    .ma-logo {
        width: 42px;
        height: 42px;
    }

    .ma-item {
        padding: 12px 14px;
        gap: 12px;
    }
}

@media (max-width: 360px) {
    .ma-logo {
        width: 38px;
        height: 38px;
    }

    .ma-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .ma-name {
        font-size: var(--font-size-xs);
    }

    .ma-cashback {
        font-size: 0.6875rem;
    }
}

/* ==========================================================================
   Modal di rassicurazione (es. merchant detail CTA)
   ========================================================================== */
.cashback-redirect-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.cashback-redirect-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cashback-redirect-modal.is-open {
    display: flex;
}
.cashback-redirect-modal[hidden],
.cashback-redirect-modal-overlay[hidden] {
    display: none !important;
}
.cashback-redirect-modal-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: cashbackModalFadeIn 0.25s ease-out;
}
@keyframes cashbackModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.cashback-redirect-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 24px 0;
}
.cashback-redirect-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin: 0;
}
.cashback-redirect-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition:
        background 0.15s,
        color 0.15s;
}
.cashback-redirect-modal-close:hover {
    background: #f5f7fa;
    color: #1a1a2e;
}
.cashback-redirect-modal-close:focus-visible {
    outline: 2px solid #00b894;
    outline-offset: 2px;
}
.cashback-redirect-modal-body {
    padding: 16px 24px;
}
.cashback-redirect-modal-text {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
    margin: 0 0 12px;
}
.cashback-redirect-modal-text-secondary {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}
.cashback-redirect-modal-popup-blocked {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: 10px;
    border: 1px solid #fde68a;
}
.cashback-redirect-modal-popup-blocked-text {
    font-size: 0.9rem;
    color: #92400e;
    line-height: 1.5;
    margin: 0;
}
.cashback-redirect-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 24px 24px;
}
.cashback-redirect-modal-actions .btn {
    flex: 1;
    min-width: 120px;
}
body.modal-open {
    overflow: hidden;
}
@media (max-width: 480px) {
    .cashback-redirect-modal {
        padding: 12px;
        align-items: flex-end;
    }
    .cashback-redirect-modal.is-open {
        display: flex;
    }
    .cashback-redirect-modal-panel {
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
    .cashback-redirect-modal-header {
        padding: 20px 20px 0;
    }
    .cashback-redirect-modal-title {
        font-size: 1.05rem;
    }
    .cashback-redirect-modal-body {
        padding: 12px 20px;
    }
    .cashback-redirect-modal-actions {
        padding: 0 20px 20px;
    }
    .cashback-redirect-modal-actions .btn {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Homepage — Sezione informativa accordion "Perché scegliere Miglior Cashback?"
   ========================================================================== */

.home-about {
    padding: 48px 0 24px;
}

.home-about-intro {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 28px;
    max-width: 800px;
}

/* ── Accordion items ─────────────────────────────────────────── */
.home-about details {
    border-bottom: 1px solid var(--color-border-light);
}

.home-about details:first-of-type {
    border-top: 1px solid var(--color-border-light);
}

.home-about summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 0;
    cursor: pointer;
    list-style: none;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
    transition: color 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.home-about summary::-webkit-details-marker {
    display: none;
}

.home-about summary:hover {
    color: var(--color-cashback);
}

.home-about summary::after {
    content: "+";
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 400;
    color: var(--color-cashback);
    line-height: 1;
    transition: transform 0.25s ease;
}

.home-about details[open] summary::after {
    content: "−";
}

/* ── Animated content ────────────────────────────────────────── */
.home-about .home-about-content {
    overflow: hidden;
}

.home-about .home-about-content-inner {
    padding: 0 0 20px;
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--color-text-secondary);
    max-width: 780px;
}

.home-about .home-about-content-inner p {
    margin: 0;
}

/* ── Desktop: più spazioso ───────────────────────────────────── */
@media (min-width: 768px) {
    .home-about {
        padding: 64px 0 32px;
    }

    .home-about summary {
        padding: 20px 0;
        font-size: var(--font-size-lg);
    }

    .home-about .home-about-content-inner {
        font-size: var(--font-size-base);
    }
}

/* ==========================================================================
   Admin — Monitor Dashboard
   ========================================================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    height: 20px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.detail-table th {
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 2px solid var(--color-border-light);
}

.detail-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   Admin — Monitor Dashboard Layout
   ========================================================================== */

/* ── Period Selector ────────────────────────────────────────── */
.monitor-toolbar {
    margin: 16px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.monitor-toolbar select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: var(--font-size-sm);
}

/* ── KPI Cards Row ─────────────────────────────────────────── */
.monitor-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.monitor-kpi-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow 0.2s;
    min-width: 0;
}
.monitor-kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-cashback, #00b894);
    line-height: 1.2;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kpi-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.3;
}

/* ── Chart Rows (2fr + 1fr) ────────────────────────────────── */
.monitor-chart-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

/* ── Table Rows (1fr + 1fr) ────────────────────────────────── */
.monitor-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* ── Chart Card ────────────────────────────────────────────── */
.monitor-chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-width: 0;
}
.monitor-chart-card h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--color-text-primary);
}
.monitor-chart-card canvas {
    width: 100% !important;
    max-height: 200px;
}

/* ── Chart Stats (sotto il grafico) ────────────────────────── */
.monitor-chart-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border-light);
}
.ms-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: var(--font-size-xs);
    line-height: 1.4;
    white-space: nowrap;
}
.ms-label {
    color: var(--color-text-tertiary);
}
.ms-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ── Funnel Card (colonna destra 1fr) ──────────────────────── */
.monitor-funnel-card {
    display: flex;
    flex-direction: column;
}
.monitor-funnel-body {
    flex: 1;
    overflow-y: auto;
}
.funnel-table {
    width: 100%;
}
.funnel-table tr:last-child td {
    border-bottom: none;
}
.funnel-table td {
    padding: 6px 8px;
    font-size: var(--font-size-sm);
}
.fn-label {
    color: var(--color-text-secondary);
    white-space: nowrap;
    width: 1%;
    padding-right: 12px;
}
.fn-value {
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}
.fn-pct {
    font-weight: 400;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-xs);
}

/* ── Table scroll ──────────────────────────────────────────── */
.monitor-table-scroll {
    max-height: 360px;
    overflow-y: auto;
}
.td-page {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Badge canale traffico ─────────────────────────────────── */
.badge-channel {
    display: inline-block;
    background: var(--color-bg-subtle, #f0f0f0);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

/* ── Alerts ────────────────────────────────────────────────── */
.monitor-alerts {
    margin-bottom: 24px;
}
.monitor-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}
.monitor-alert small {
    opacity: 0.8;
}
.alert-warning {
    background: #fff3cd;
    color: #856404;
}
.alert-info {
    background: #cce5ff;
    color: #004085;
}
.alert-success {
    background: #d4edda;
    color: #155724;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
    color: var(--color-text-tertiary);
    font-size: var(--font-size-sm);
    padding: 16px;
    text-align: center;
}

/* ── Responsive: mobile ────────────────────────────────────── */
@media (max-width: 768px) {
    .monitor-chart-row {
        grid-template-columns: 1fr;
    }
    .monitor-table-row {
        grid-template-columns: 1fr;
    }
    .monitor-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .kpi-value {
        font-size: 1.25rem;
    }
    .monitor-chart-card canvas {
        max-height: 160px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Cashback Event Banners and Confetti
   ═══════════════════════════════════════════════════════════════ */

/* ── Event Banner Base ───────────────────────────────────────── */
.dashboard-event-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    position: relative;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-banner-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.event-banner-body {
    flex: 1;
    min-width: 0;
}

.event-banner-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--color-text-primary);
}

.event-banner-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 0;
}

.event-banner-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-text-tertiary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.event-banner-close:hover {
    opacity: 1;
}

/* ── First Cashback Banner (celebrativo) ──────────────────────── */
.event-first-cashback {
    background: linear-gradient(135deg, #e8fcf5 0%, #d4f5f4 100%);
    border: 2px solid #00b894;
}

.event-first-cashback .event-banner-title {
    color: #008a6e;
    font-size: 20px;
}

/* ── Second Cashback Banner ────────────────────────────────── */
.event-second-cashback {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #4ade80;
}

.event-second-cashback .event-banner-title {
    color: #15803d;
}

/* ── Subsequent Cashback Banner ────────────────────────────── */
.event-subsequent-cashback {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    padding: 12px 16px;
}

.event-subsequent-cashback .event-banner-icon {
    font-size: 24px;
}

.event-subsequent-cashback .event-banner-title {
    font-size: 14px;
    font-weight: 600;
}

.event-subsequent-cashback .event-banner-text {
    font-size: 13px;
}

/* ── Confirmed Banner ─────────────────────────────────────── */
.event-cashback-confirmed {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

/* ── Cancelled Banner ─────────────────────────────────────── */
.event-cashback-cancelled {
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.event-cashback-cancelled .event-banner-title {
    color: #dc2626;
}

/* ── Threshold Reached Banner ─────────────────────────────── */
.event-threshold-reached {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #f97316;
}

.event-threshold-reached .event-banner-title {
    color: #c2410c;
    font-size: 20px;
}

.event-threshold-reached .btn {
    margin-top: 12px;
}

/* ── Badge pending ──────────────────────────────────────────── */
.badge-pending {
    background: #fef9c3;
    color: #854d0e;
    font-size: var(--font-size-xs);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    white-space: nowrap;
}

/* ── Confetti Container ────────────────────────────────────── */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(10vh) rotate(180deg)
            translateX(var(--drift-x, 0px));
        opacity: 1;
    }
    50% {
        transform: translateY(40vh) rotate(360deg)
            translateX(calc(var(--drift-x, 0px) * 0.5));
        opacity: 1;
    }
    75% {
        transform: translateY(70vh) rotate(540deg) translateX(0);
        opacity: 0.8;
    }
    100% {
        transform: translateY(105vh) rotate(720deg)
            translateX(var(--drift-x, 0px));
        opacity: 0;
    }
}

.confetti-piece {
    position: absolute;
    width: 6px;
    height: 6px;
    top: -10px;
    line-height: 1;
    animation: confetti-fall 3.5s ease-in-out forwards;
    will-change: transform, opacity;
}

/* ── Info box for pending clicks ──────────────────────────────── */
.dashboard-section-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    font-weight: 400;
}

/* ==========================================================================
   Merchant Marketing CTA (homepage, listing, onboarding)
   ========================================================================== */

/* ── Homepage merchant CTA section ────────────────────────────── */
.merchant-home-cta {
    background: var(--color-cashback-light);
    border-top: 1px solid var(--color-border-light);
}

.merchant-home-cta-inner {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.merchant-home-cta-content {
    padding: 24px 0 8px;
}

@media (min-width: 640px) {
    .merchant-home-cta-content {
        padding: 32px 0 16px;
    }
}

.merchant-home-cta-title {
    font-size: var(--font-size-2xl);
    margin-bottom: 16px;
    font-weight: 700;
}

.merchant-home-cta-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.merchant-home-cta-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ── Merchant listing CTA box ─────────────────────────────────── */
.listing-merchant-cta {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

.listing-merchant-cta-card {
    background: var(--color-bg-card);
    border: 2px solid var(--color-cashback-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
}

.listing-merchant-cta-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--color-cashback-light);
    color: var(--color-cashback);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.listing-merchant-cta-title {
    font-size: var(--font-size-lg);
    margin-bottom: 8px;
    font-weight: 700;
}

.listing-merchant-cta-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ── Onboarding page (hero, benefits, steps, why) ─────────────── */
.merchant-onboarding-hero {
    text-align: center;
    margin-bottom: 40px;
}

.merchant-onboarding-hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.merchant-onboarding-hero-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto 24px;
}

.merchant-onboarding-benefits {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

@media (min-width: 640px) {
    .merchant-onboarding-benefits {
        grid-template-columns: repeat(3, 1fr);
    }
}

.merchant-onboarding-benefits-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.merchant-onboarding-benefits-icon {
    margin-bottom: 16px;
}

.merchant-onboarding-benefits-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 8px;
}

.merchant-onboarding-benefits-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.merchant-onboarding-steps {
    background: var(--color-cashback-light);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 40px;
}

.merchant-onboarding-steps-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 20px;
}

.merchant-onboarding-steps-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.merchant-onboarding-steps-list li {
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary);
}

.merchant-onboarding-why {
    margin-bottom: 40px;
}

.merchant-onboarding-why-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 16px;
}

.merchant-onboarding-why-list {
    padding-left: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 640px) {
    .merchant-onboarding-why-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.merchant-onboarding-why-list li {
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.merchant-onboarding-why-list li::marker {
    color: var(--color-cashback);
}

.merchant-onboarding-form-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 32px;
}

.merchant-onboarding-form-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
}

.merchant-onboarding-form-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 8px;
}

.merchant-onboarding-form-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.merchant-onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Checkbox consensi onboarding merchant ──────────────────── */
.merchant-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.merchant-consent-checkbox .form-check-label {
    cursor: pointer;
    user-select: none;
}

.merchant-consent-link {
    pointer-events: auto;
    position: relative;
    z-index: 2;
    color: var(--color-cashback);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.merchant-consent-link:hover {
    color: var(--color-cashback-dark);
}

/* ==========================================================================
   Merchant How It Works Page (mhi-*) — Professional Merchant Landing
   ========================================================================== */

/* ── Page wrapper ───────────────────────────────────────────── */
.merchant-how-it-works {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

/* ── Hero: testo sx + immagine dx (desktop) ─────────────────── */
.mhi-hero {
    margin-bottom: 48px;
}

.mhi-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

@media (min-width: 768px) {
    .mhi-hero-inner {
        flex-direction: row;
        gap: 48px;
    }
}

.mhi-hero-text {
    flex: 1;
}

.mhi-hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

@media (min-width: 640px) {
    .mhi-hero-title {
        font-size: 2rem;
    }
}

.mhi-hero-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.mhi-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.mhi-hero-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mhi-hero-svg {
    max-width: 100%;
    height: auto;
}

/* ── Trust / Numeri ─────────────────────────────────────────── */
.mhi-trust {
    margin-bottom: 48px;
}

.mhi-trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .mhi-trust-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

.mhi-trust-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
}

.mhi-trust-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.mhi-trust-icon--green {
    background: var(--color-cashback-light);
    color: var(--color-cashback);
}

.mhi-trust-icon--accent {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.mhi-trust-icon--teal {
    background: #e0f7fa;
    color: #00897b;
}

.mhi-trust-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 4px;
}

.mhi-trust-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ── Sezioni valore (community, traffico, brand) ────────────── */
.mhi-section {
    margin-bottom: 40px;
}

.mhi-section--alt {
    background: var(--color-cashback-light);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
}

.mhi-section--value {
    padding: 0;
}

.mhi-section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

@media (min-width: 640px) {
    .mhi-section-inner {
        flex-direction: row;
        gap: 40px;
    }
}

.mhi-section-inner--rev {
    flex-direction: column;
}

@media (min-width: 640px) {
    .mhi-section-inner--rev {
        flex-direction: row-reverse;
    }
}

.mhi-value-content {
    flex: 1;
}

.mhi-value-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mhi-value-image svg {
    max-width: 100%;
    height: auto;
}

.mhi-section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 16px;
}

.mhi-section-title--center {
    text-align: center;
}

.mhi-section-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.mhi-section-text:last-child {
    margin-bottom: 0;
}

.mhi-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mhi-list li {
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.mhi-list li::marker {
    color: var(--color-cashback);
}

/* ── 6 passaggi numerati ─────────────────────────────────────── */
.mhi-steps-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.mhi-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.mhi-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-cashback);
    color: var(--color-white);
    font-size: var(--font-size-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.mhi-step-body {
    flex: 1;
    padding-top: 6px;
}

.mhi-step-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: 4px;
}

.mhi-step-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ── Approve / Reject cards affiancate ───────────────────────── */
.mhi-approve-reject {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

@media (min-width: 640px) {
    .mhi-approve-reject {
        flex-direction: row;
    }
    .mhi-approve-card,
    .mhi-reject-card {
        flex: 1;
    }
}

.mhi-approve-card {
    background: var(--color-cashback-light);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.mhi-reject-card {
    background: var(--color-coral-light);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.mhi-approve-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-cashback-dark);
}

.mhi-reject-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-coral);
}

/* ── CTA finale ──────────────────────────────────────────────── */
.mhi-section--cta {
    margin-top: 40px;
}

.mhi-cta-card {
    background: var(--color-cashback-light);
    border: 2px solid var(--color-cashback);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
}

.mhi-cta-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 12px;
}

.mhi-cta-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 24px;
}

/* ==========================================================================
   Admin Dark Mode
   Scoped to html.dark-mode — admin area (topbar, nav, tables, etc.)
   ========================================================================== */

/* ── Toggle button ──────────────────────────────────────────── */
.dark-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #555;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition:
        background 0.15s,
        border-color 0.15s;
    flex-shrink: 0;
}
.dark-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #777;
}

/* ── Dark mode variables & overrides ────────────────────────── */
html.dark-mode {
    --color-bg: #0f172a;
    --color-bg-card: #1e293b;
    --color-bg-alt: #1e293b;
    --color-surface: #1e293b;
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-muted: #94a3b8;
    --color-text-tertiary: #94a3b8;
    --color-border: #334155;
    --color-border-light: #334155;
    --color-cashback-light: #064e3b;
    --color-cashback-dark: #00b894;
    --color-accent-light: #312e81;
    --color-coral-light: #7f1d1d;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html.dark-mode body {
    background: #0f172a;
    color: #f8fafc;
}

html.dark-mode .admin-body {
    background: #0f172a;
}

html.dark-mode .admin-header {
    background: #020617;
    border-bottom-color: #1e293b;
}

html.dark-mode .admin-topbar {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

html.dark-mode .admin-logo {
    color: #f8fafc;
}
html.dark-mode .admin-logo:hover {
    color: #00b894;
}

html.dark-mode .admin-email {
    color: #94a3b8;
}

html.dark-mode .admin-nav-link {
    color: #94a3b8;
}
html.dark-mode .admin-nav-link:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

html.dark-mode .admin-nav-monitor {
    color: #34d399;
}
html.dark-mode .admin-nav-monitor:hover {
    color: #6ee7b7;
}

html.dark-mode .admin-nav-highlight {
    color: #facc15;
}
html.dark-mode .admin-nav-highlight:hover {
    color: #fde047;
}

html.dark-mode .admin-nav-workbench {
    color: #fbbf24;
}
html.dark-mode .admin-nav-workbench:hover {
    color: #fcd34d;
}
html.dark-mode .admin-nav-active {
    color: #fff !important;
    background: rgba(20, 184, 166, 0.2) !important;
    font-weight: 700 !important;
    box-shadow: inset 0 -2px 0 #14b8a6;
}
html.dark-mode .admin-badge {
    color: #1a1a2e;
    background: #facc15;
}

html.dark-mode .admin-content {
    background: transparent;
}

/* ── Titles ─────────────────────────────────────────────────── */
html.dark-mode .listing-title,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6 {
    color: #f8fafc;
}

html.dark-mode .listing-count,
html.dark-mode .listing-description {
    color: #94a3b8;
}

/* ── Cards ──────────────────────────────────────────────────── */
html.dark-mode .dashboard-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .dashboard-card h3 {
    color: #f8fafc;
}

html.dark-mode .dashboard-card-icon {
    background: #0f172a !important;
}

html.dark-mode .dashboard-greeting {
    color: #f8fafc;
}
html.dark-mode .dashboard-email {
    color: #94a3b8;
}

/* ── KPI cards (monitor dashboard) ──────────────────────────── */
html.dark-mode .monitor-kpi-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .kpi-label {
    color: #94a3b8;
}

html.dark-mode .monitor-chart-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .monitor-chart-card h3 {
    color: #f8fafc;
}

html.dark-mode .monitor-chart-stats {
    border-top-color: #334155;
}
html.dark-mode .ms-label {
    color: #94a3b8;
}
html.dark-mode .ms-value {
    color: #f8fafc;
}

html.dark-mode .monitor-toolbar select {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}

/* ── Tables ─────────────────────────────────────────────────── */
html.dark-mode .admin-table {
    background: #1e293b;
}
html.dark-mode .admin-table th {
    background: #0f172a;
    color: #cbd5e1;
}
html.dark-mode .admin-table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}
html.dark-mode .admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

html.dark-mode .detail-table th {
    color: #94a3b8;
    border-bottom-color: #334155;
}
html.dark-mode .detail-table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

/* ── Forms & Inputs ─────────────────────────────────────────── */
html.dark-mode .form-input {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .form-input:focus {
    border-color: #00b894;
}
html.dark-mode .form-input::placeholder {
    color: #64748b;
}

html.dark-mode .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    background-color: #111827;
}

html.dark-mode .form-label {
    color: #e2e8f0;
}

/* ── Buttons ────────────────────────────────────────────────── */
html.dark-mode .btn-outline {
    color: #cbd5e1;
    border-color: #475569;
}
html.dark-mode .btn-outline:hover {
    border-color: #00b894;
    color: #00b894;
}

html.dark-mode .btn-ghost {
    color: #94a3b8;
}
html.dark-mode .btn-ghost:hover {
    background: #1e293b;
    color: #f8fafc;
}

/* ── Flashes / Alerts ───────────────────────────────────────── */
html.dark-mode .flash-success {
    background: #064e3b;
    color: #6ee7b7;
    border: 1px solid #065f46;
}

html.dark-mode .flash-error {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #991b1b;
}

/* ── Pagination ─────────────────────────────────────────────── */
html.dark-mode .pagination-info {
    color: #94a3b8;
}

/* ── Empty state ────────────────────────────────────────────── */
html.dark-mode .empty-state {
    color: #94a3b8;
}

/* ── Badges / Pills ─────────────────────────────────────────── */
html.dark-mode .badge-cashback {
    background: #064e3b;
    color: #6ee7b7;
}
html.dark-mode .badge-super {
    background: #312e81;
    color: #a5b4fc;
}
html.dark-mode .badge-new {
    background: #7f1d1d;
    color: #fca5a5;
}

html.dark-mode .pill {
    color: #f8fafc;
}
html.dark-mode .pill.light {
    background: #334155;
    color: #cbd5e1;
}
html.dark-mode .pill.green {
    background-color: #065f46;
}
html.dark-mode .pill.red {
    background-color: #991b1b;
}
html.dark-mode .pill.amber {
    background-color: #92400e;
}
html.dark-mode .pill.blue {
    background-color: #1e40af;
}
html.dark-mode .pill.purple {
    background-color: #5b21b6;
}

/* ── Status labels ──────────────────────────────────────────── */
html.dark-mode .status-active {
    color: #34d399;
}
html.dark-mode .status-pending {
    color: #94a3b8;
}
html.dark-mode .status-error {
    color: #f87171;
}

/* ── List items (used in incassi, richieste, etc.) ──────────── */
html.dark-mode .list-item-sub {
    color: #64748b;
}
html.dark-mode .list-item-amount {
    color: #f8fafc;
}
html.dark-mode .list-item-status {
    color: #f8fafc;
}

/* ── Listing sort buttons ───────────────────────────────────── */
html.dark-mode .listing-sort-btn {
    color: #94a3b8;
    border-color: #334155;
}
html.dark-mode .listing-sort-btn:hover {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #00b894;
}
html.dark-mode .listing-sort-btn.is-active {
    background: #00b894;
    color: #fff;
    border-color: #00b894;
}

/* ── Funnel table (monitor) ─────────────────────────────────── */
html.dark-mode .funnel-table td {
    border-bottom-color: #334155;
}
html.dark-mode .fn-label {
    color: #94a3b8;
}
html.dark-mode .fn-value {
    color: #f8fafc;
}
html.dark-mode .fn-pct {
    color: #64748b;
}

/* ── Skeleton loading ───────────────────────────────────────── */
html.dark-mode .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* ── Utility: section-title ─────────────────────────────────── */
html.dark-mode .section-title {
    color: #f8fafc;
}
html.dark-mode .section-title-sm {
    color: #f8fafc;
}

/* ── Listing filter form (inline items inside) ──────────────── */
html.dark-mode .listing-filter-form .form-input {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .listing-filter-form .form-input:focus {
    border-color: #00b894;
}

/* ── Funnel body / scrollable areas ─────────────────────────── */
html.dark-mode .monitor-funnel-card {
    background: #1e293b;
    border-color: #334155;
}

/* ── List item clickable cards ──────────────────────────────── */
html.dark-mode .list-item-clickable {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .list-item-clickable:hover {
    background: #0f172a;
}

/* ── Misc card backgrounds ──────────────────────────────────── */
html.dark-mode .listing-page {
    background: transparent;
}

/* ── Dashboard stat cards (statistiche in home admin) ───────── */
html.dark-mode [style*="background"][style*="var(--color-bg-alt)"],
html.dark-mode [class*="bg-cashback"],
html.dark-mode [class*="bg-accent"] {
    background-color: #1e293b !important;
}

/* ── Any inline background: #f... or bg colors ──────────────── */
html.dark-mode .listing-sort-label {
    color: #94a3b8;
}

/* ── Monitor chart canvases ─────────────────────────────────── */
html.dark-mode .monitor-chart-card canvas {
    filter: brightness(0.9);
}

/* ── Tablet/mobile dark mode adjustments ────────────────────── */
@media (max-width: 640px) {
    html.dark-mode .dark-toggle {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   Global / Public Dark Mode
   Scoped to html.dark-mode — public site (header, hero, cards, footer, etc.)
   ========================================================================== */

/* ── Body & general background ──────────────────────────────── */
html.dark-mode .public-layout {
    background: #0f172a;
    color: #f8fafc;
}

html.dark-mode .site-header {
    background: #020617;
    border-bottom-color: #1e293b;
}

html.dark-mode .header-inner {
    background: transparent;
}

html.dark-mode .header-logo-img {
    /* Niente filtri, niente content swap:
       usiamo il logo originale con box chiaro dietro */
}

/* Dark mode: box chiaro dietro al logo originale (testo scuro)
   per garantire leggibilità su sfondo scuro dell'header */
html.dark-mode .header-logo {
    background: var(--color-white);
    border-radius: 8px;
    padding: 4px 12px;
}

html.dark-mode .header-search-desktop-input {
    background: #1a1f2e;
    border-color: #475569;
    color: #f8fafc;
}
html.dark-mode .header-search-desktop-input::placeholder {
    color: #94a3b8;
}
html.dark-mode .header-search-desktop-input:focus {
    border-color: #00b894;
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.12);
    background: #1e293b;
}

html.dark-mode .header-search-desktop-btn {
    background: transparent;
    border: none;
    color: #64748b;
}
html.dark-mode .header-search-desktop-btn:hover {
    color: #00b894;
    background: rgba(0, 184, 148, 0.1);
}

/* ── Dark toggle armonizzato con header actions ─────────────── */
html.dark-mode .dark-toggle {
    border-color: #475569;
    color: #f8fafc;
    margin-right: 4px;
}
html.dark-mode .dark-toggle:hover {
    background: #1e293b;
    border-color: #00b894;
    color: #34d399;
}

/* ── Main nav & links ───────────────────────────────────────── */
html.dark-mode .main-nav-link {
    color: #cbd5e1;
}
html.dark-mode .main-nav-link:hover {
    color: #00b894;
}

/* Pulsante Categorie Cashback attivo: si collega al megamenu */
html.dark-mode .main-nav-link--trigger[aria-expanded="true"] {
    color: #34d399;
    background: #111827;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    position: relative;
    z-index: 201;
    box-shadow: 0 -2px 8px rgba(0, 184, 148, 0.08);
}

html.dark-mode .main-nav-chevron {
    color: #94a3b8;
}

/* ── User dropdown chevron in dark mode ─────────────────────── */
html.dark-mode .header-user-chevron {
    color: #94a3b8;
}

/* ── Megamenu dark mode premium ─────────────────────────────── */
html.dark-mode .megamenu {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-color: rgba(51, 65, 85, 0.4);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(51, 65, 85, 0.15) inset;
}

/* Sottile glow decorativo (solo dark mode) per dare profondità */
html.dark-mode .megamenu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse 60% 40% at 50% 0%,
        rgba(0, 184, 148, 0.04) 0%,
        transparent 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* Link categorie: più leggibili e hover elegante */
html.dark-mode .megamenu-list a {
    color: #e2e8f0;
}

html.dark-mode .megamenu-list a:hover {
    color: #34d399;
    padding-left: 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 184, 148, 0.4);
    text-decoration-thickness: 1px;
    background: transparent;
}

html.dark-mode .megamenu-footer {
    background: transparent;
    border-top-color: rgba(51, 65, 85, 0.4);
}

/* CTA verde: testo bianco sempre visibile (fix alta specificità) */
html.dark-mode .megamenu-cta {
    color: #ffffff !important;
    background: linear-gradient(135deg, #00b894, #009977);
    box-shadow: 0 4px 16px rgba(0, 184, 148, 0.25);
}
html.dark-mode .megamenu-cta:hover {
    background: linear-gradient(135deg, #00d4a3, #00b894);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.35);
    transform: translateY(-1px);
}
html.dark-mode .megamenu-cta:active {
    transform: scale(0.97);
}
html.dark-mode .megamenu-cta .megamenu-cta-text {
    color: #ffffff !important;
}

/* Testo descrittivo sotto CTA: più leggibile */
html.dark-mode .megamenu-cta-sub {
    color: #cbd5e1;
}

/* ── Hero section ───────────────────────────────────────────── */
html.dark-mode .hero {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}
html.dark-mode .hero-title {
    color: #f8fafc;
}
html.dark-mode .hero-subtitle {
    color: #94a3b8;
}

html.dark-mode .hero-search-input {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .hero-search-input::placeholder {
    color: #64748b;
}
html.dark-mode .hero-search-input:focus {
    border-color: #00b894;
}

/* ── Cards (promises, showcase) ─────────────────────────────── */
html.dark-mode .promise-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .promise-title {
    color: #f8fafc;
}
html.dark-mode .promise-text {
    color: #94a3b8;
}

html.dark-mode .promise-icon-green {
    background: #064e3b;
    color: #00b894;
}
html.dark-mode .promise-icon-accent {
    background: #312e81;
    color: #a5b4fc;
}
html.dark-mode .promise-icon-teal {
    background: #164e63;
    color: #2dd4bf;
}

/* ── Homepage showcase / slideshow ──────────────────────────── */
html.dark-mode .homepage-showcase {
    background: transparent;
}

/* ── Section titles ─────────────────────────────────────────── */
html.dark-mode .section-title {
    color: #f8fafc;
}
html.dark-mode .section-text {
    color: #94a3b8;
}
html.dark-mode .section-highlight {
    background: #0f172a;
}

/* ── Search suggestions / autocomplete dark mode ──────────── */
html.dark-mode .merchant-autocomplete-dropdown {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.6);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

html.dark-mode .ma-item {
    color: #e2e8f0;
}

html.dark-mode .ma-item:hover,
html.dark-mode .ma-item.is-highlighted {
    background: #0f172a;
}

html.dark-mode .ma-name {
    color: #f1f5f9;
}

html.dark-mode .ma-cashback {
    color: #34d399;
}

html.dark-mode .ma-logo {
    background: #ffffff;
    border-color: rgba(71, 85, 105, 0.5);
}

html.dark-mode .ma-logo-placeholder {
    color: #94a3b8;
}

html.dark-mode .ma-arrow {
    color: #64748b;
    opacity: 0.5;
}

html.dark-mode .ma-item:hover .ma-arrow,
html.dark-mode .ma-item.is-highlighted .ma-arrow {
    color: #34d399;
    opacity: 1;
}

/* ── Merchant cards (listing) ───────────────────────────────── */
html.dark-mode .merchant-grid,
html.dark-mode .showcase-grid {
    background: transparent;
}

/* ── Footer ─────────────────────────────────────────────────── */
html.dark-mode .site-footer {
    background: #020617;
    border-top-color: #1e293b;
}
html.dark-mode .footer-nav a {
    color: #94a3b8;
}
html.dark-mode .footer-nav a:hover {
    color: #00b894;
}
html.dark-mode .footer-tagline {
    color: #00b894;
}
html.dark-mode .footer-copy {
    color: #64748b;
}
html.dark-mode .footer-vat {
    color: #64748b;
}
html.dark-mode .footer-bottom {
    border-top-color: #334155;
}

/* ── Mobile bottom bar / cmd bar ────────────────────────────── */
html.dark-mode .mobile-cmd-body {
    background: #020617 !important;
}
html.dark-mode .mobile-cmd-breadcrumb {
    background: #020617;
}
html.dark-mode .mobile-cmd-breadcrumb-item a {
    color: #94a3b8;
}
html.dark-mode .mobile-cmd-breadcrumb-item span[aria-current="page"] {
    color: #f8fafc;
}

html.dark-mode .mobile-command-icon {
    color: #cbd5e1;
}
html.dark-mode .mobile-command-icon:hover {
    color: #00b894;
}
html.dark-mode .mobile-command-logo-mark {
    background: transparent;
}

html.dark-mode .mobile-account-menu {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .mobile-account-menu-item {
    color: #cbd5e1;
}
html.dark-mode .mobile-account-menu-item:hover {
    background: #0f172a;
    color: #00b894;
}

html.dark-mode .mobile-cmd-search-input {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .mobile-cmd-search-input::placeholder {
    color: #64748b;
}

/* ── Categories sheet (mobile) ──────────────────────────────── */
html.dark-mode .categories-sheet-panel {
    background: #0f172a;
}
html.dark-mode .categories-sheet-header h2 {
    color: #f8fafc;
}
html.dark-mode .categories-sheet-search {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .categories-sheet-search::placeholder {
    color: #64748b;
}
html.dark-mode .categories-sheet-close {
    color: #94a3b8;
}
html.dark-mode .categories-sheet-item {
    color: #cbd5e1;
    border-bottom-color: #334155;
}
html.dark-mode .categories-sheet-empty {
    color: #64748b;
}
html.dark-mode .categories-sheet-bottom-bar {
    background: #0f172a;
    border-top-color: #334155;
}

/* ── Auth pages (login/register) ────────────────────────────── */
html.dark-mode .auth-page {
    background: #0f172a;
}
html.dark-mode .auth-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .auth-title {
    color: #f8fafc;
}
html.dark-mode .auth-subtitle {
    color: #94a3b8;
}
html.dark-mode .auth-footer-text {
    color: #94a3b8;
}
html.dark-mode .auth-footer-text a {
    color: #00b894;
}

/* ── Flash messages (public) ────────────────────────────────── */
html.dark-mode .flash.flash-success {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #065f46;
}
html.dark-mode .flash.flash-error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}
html.dark-mode .flash.flash-info {
    background: #78350f;
    color: #fbbf24;
    border-color: #92400e;
}

/* ── Merchant detail page ───────────────────────────────────── */
html.dark-mode .merchant-detail {
    background: transparent;
}

/* ── CTA buttons ────────────────────────────────────────────── */
html.dark-mode .hero-cta-primary {
    background: #00b894;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.35);
}
html.dark-mode .hero-cta-primary:hover {
    background: #009977;
}
html.dark-mode .hero-cta-secondary {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
}
html.dark-mode .hero-cta-secondary:hover {
    border-color: #00b894;
    color: #00b894;
}

/* ── Header actions (Accedi/Registrati) ─────────────────────── */
html.dark-mode .header-actions .btn-outline {
    color: #cbd5e1;
    border-color: #475569;
}
html.dark-mode .header-actions .btn-outline:hover {
    border-color: #00b894;
    color: #00b894;
}

html.dark-mode .header-actions .btn-ghost {
    color: #94a3b8;
}
html.dark-mode .header-actions .btn-ghost:hover {
    background: #1e293b;
    color: #f8fafc;
}

/* ── Notifications badge ────────────────────────────────────── */
html.dark-mode .notif-badge {
    background: #dc2626;
    color: #fff;
}

/* ── Pulsante notifiche (campanella) in dark mode ──────────── */
html.dark-mode .header-notif-btn.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    transition:
        color 0.2s,
        background 0.2s,
        border-color 0.2s;
}
html.dark-mode .header-notif-btn.btn-ghost:hover {
    color: #f8fafc;
    background: #1e293b;
    border-color: #475569;
}

/* ── Merchant sticy hero (detail page) ──────────────────────── */
html.dark-mode .merchant-sticky-hero {
    background: #020617;
}

/* ── General text and link colors in public pages ───────────── */
html.dark-mode
    .public-layout
    a:not(.btn):not(.main-nav-link):not(.megamenu-link):not(.footer-nav a):not(
        .merchant-card-link
    ):not(.showcase-card) {
    color: #00b894;
}

/* ── Utility: prevent merchant logos from being inverted ────── */
html.dark-mode img[alt*="logo" i],
html.dark-mode img[src*="logo" i],
html.dark-mode .merchant-logo img,
html.dark-mode .showcase-logo img {
    filter: none !important;
}

/* ==========================================================================
   Merchant Detail — Dark Mode
   Scoped to html.dark-mode — merchant detail page hero, cards, sidebar
   ========================================================================== */

/* ── Hero (box principale) ──────────────────────────────────── */
html.dark-mode .merchant-detail-hero {
    background: #1e293b;
    border-bottom-color: #334155;
    box-shadow: none;
}

html.dark-mode .merchant-detail-hero::before {
    opacity: 1;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.dark-mode .merchant-detail-hero::after {
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.52) 0%,
        rgba(15, 23, 42, 0.42) 40%,
        rgba(15, 23, 42, 0.26) 70%,
        rgba(15, 23, 42, 0.14) 100%
    );
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

@media (max-width: 767px) {
    html.dark-mode .merchant-detail-hero::after {
        background: rgba(15, 23, 42, 0.55);
    }
}

html.dark-mode .merchant-detail-hero .merchant-detail-name {
    color: #f8fafc;
}

html.dark-mode .merchant-detail-hero .merchant-detail-meta {
    color: #cbd5e1;
}

html.dark-mode .merchant-detail-hero .meta-item {
    color: #cbd5e1;
}

html.dark-mode .merchant-detail-hero .meta-link {
    color: #00b894;
}

html.dark-mode .merchant-detail-hero .cta-microcopy {
    color: #94a3b8;
}

/* ── Logo: mantieni sfondo bianco per visibilità logo ──────── */
html.dark-mode .merchant-detail-hero .merchant-detail-logo {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

html.dark-mode .merchant-detail-hero .merchant-detail-logo-placeholder {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #6b7280;
}

/* ── Badge nella hero ───────────────────────────────────────── */
html.dark-mode .merchant-detail-hero .badge {
    color: #f8fafc;
}

/* ── Sidebar CTA card ───────────────────────────────────────── */
html.dark-mode .merchant-cta-card {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .merchant-cta-card-label {
    color: #94a3b8;
}

html.dark-mode .merchant-cta-card-cashback {
    color: #00b894;
}

html.dark-mode .merchant-cta-card .cta-microcopy {
    color: #94a3b8;
}

html.dark-mode .merchant-cta-card-category {
    color: #cbd5e1;
}

/* ── Cashback items (lista offerte) ─────────────────────────── */
html.dark-mode .cashback-item {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .cashback-item-category {
    color: #f8fafc;
}

html.dark-mode .cashback-item-description {
    color: #94a3b8;
}

html.dark-mode .cashback-item-value {
    color: #00b894;
}

html.dark-mode .cashback-item--active {
    background: #064e3b;
    border-color: #065f46;
}

html.dark-mode .cashback-item--active .cashback-item-value {
    color: #6ee7b7;
}

html.dark-mode .text-cashback-date {
    color: #6ee7b7;
}

/* ── Gufy check ─────────────────────────────────────────────── */
html.dark-mode .gufy-check {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .gufy-check-toggle {
    background: transparent;
}

html.dark-mode .gufy-check-text {
    color: #f8fafc;
}

html.dark-mode .gufy-check-body-inner {
    background: #1e293b;
}

html.dark-mode .gufy-check-subtitle {
    color: #cbd5e1;
}

html.dark-mode .gufy-check-name {
    color: #cbd5e1;
}

html.dark-mode .gufy-check-value {
    color: #00b894;
}

html.dark-mode .gufy-check-note {
    color: #94a3b8;
}

/* ── Merchant stats grid ────────────────────────────────────── */
html.dark-mode .merchant-stats-note {
    color: #94a3b8;
}

/* ── Merchant description / terms ───────────────────────────── */
html.dark-mode .merchant-description,
html.dark-mode .merchant-terms {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

/* ── Higher cashback link ───────────────────────────────────── */
html.dark-mode .merchant-detail-higher-cb {
    color: #94a3b8;
}

/* ── Mobile CTA ─────────────────────────────────────────────── */
html.dark-mode .merchant-detail-mobile-cta-btn {
    background: #00b894;
    color: #fff;
}

html.dark-mode .merchant-detail-mobile-cta .cta-microcopy {
    color: #94a3b8;
}

/* ── Stat cards in sidebar ──────────────────────────────────── */
html.dark-mode .merchant-sidebar-card {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .merchant-sidebar-card .merchant-description {
    color: #cbd5e1;
}

html.dark-mode .merchant-sidebar-card-title {
    color: #f8fafc;
}

html.dark-mode .merchant-sidebar-checklist-list li {
    color: #cbd5e1;
}

html.dark-mode .merchant-sidebar-trust-label {
    color: #94a3b8;
}

html.dark-mode .merchant-sidebar-trust-value {
    color: #f8fafc;
}

html.dark-mode .merchant-sidebar-report-text {
    color: #cbd5e1;
}

html.dark-mode .merchant-sidebar-checklist-avatar {
    background: #064e3b;
    border-color: #065f46;
}

/* ==========================================================================
   Gufy Tip — Dark Mode
   Scoped to html.dark-mode — all Gufy variants (info, success, warning, compact)
   ========================================================================== */

html.dark-mode .gufy-tip {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .gufy-tip--info {
    border-left-color: #00b894;
    background: #1e293b;
}

html.dark-mode .gufy-tip--success {
    background: #064e3b;
    border-color: #065f46;
    border-left-color: #00b894;
}

html.dark-mode .gufy-tip--success .gufy-tip-title {
    color: #6ee7b7;
}

html.dark-mode .gufy-tip--warning {
    background: #78350f;
    border-color: #92400e;
    border-left-color: #e17055;
}

html.dark-mode .gufy-tip--warning .gufy-tip-title {
    color: #fbbf24;
}

html.dark-mode .gufy-tip--warning .gufy-tip-avatar {
    border-color: #92400e;
    background: #78350f;
}

html.dark-mode .gufy-tip--compact {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .gufy-tip-title {
    color: #f8fafc;
}

html.dark-mode .gufy-tip-text {
    color: #cbd5e1;
}

html.dark-mode .gufy-tip-avatar {
    background: #064e3b;
    border-color: #065f46;
}

html.dark-mode .gufy-tip:hover {
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.15);
}

/* ==========================================================================
   Merchant Cards — Dark Mode
   Scoped to html.dark-mode — card listing, compact, mobile variants
   ========================================================================== */

html.dark-mode .merchant-card {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .merchant-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

html.dark-mode .merchant-card-name {
    color: #f8fafc;
}

html.dark-mode .merchant-card-category {
    color: #94a3b8;
}

html.dark-mode .merchant-card-meta-item {
    color: #94a3b8;
}

html.dark-mode .merchant-rating-stars {
    color: #fbbf24;
}

html.dark-mode .merchant-rating-value {
    color: #f8fafc;
}

html.dark-mode .merchant-card-logo {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html.dark-mode .merchant-card-logo img {
    filter: brightness(1.1);
}

html.dark-mode .merchant-card-cashback {
    border-top-color: #334155;
}

html.dark-mode .cashback-percent small {
    color: #94a3b8;
}

html.dark-mode .cashback-label {
    color: #64748b;
}

/* ── Similar Merchants Card (dark mode) ───────────────────────── */
html.dark-mode .merchant-card--similar {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html.dark-mode .merchant-card--similar:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

html.dark-mode .merchant-card--similar .merchant-card-logo {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html.dark-mode .merchant-card--similar .merchant-card-logo img {
    filter: brightness(1.1);
}

/* ── Compact card (homepage, listing) ───────────────────────── */
html.dark-mode .merchant-card-compact {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .merchant-card-compact:active {
    background: #0f172a;
}

html.dark-mode .mcc-category {
    color: #94a3b8;
}

html.dark-mode .mcc-logo {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

html.dark-mode .mcc-logo-placeholder {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    color: #6b7280;
}

/* ── Mobile card ────────────────────────────────────────────── */
html.dark-mode .merchant-card-mobile {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}
html.dark-mode .merchant-card-mobile:active {
    background: #0f172a;
}

/* ==========================================================================
   Merchant Onboarding — Dark Mode
   Scoped to html.dark-mode — onboarding form, consent boxes, select, helper text
   ========================================================================== */

html.dark-mode .merchant-onboarding-page {
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-hero-title {
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-hero-subtitle {
    color: #cbd5e1;
}

html.dark-mode .merchant-onboarding-benefits-card {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .merchant-onboarding-benefits-title {
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-benefits-text {
    color: #cbd5e1;
}

html.dark-mode .merchant-onboarding-steps {
    background: #064e3b;
}

html.dark-mode .merchant-onboarding-steps-title {
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-steps-list li {
    color: #cbd5e1;
}

html.dark-mode .merchant-onboarding-why-title {
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-why-list li {
    color: #cbd5e1;
}

html.dark-mode .merchant-onboarding-form-section {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .merchant-onboarding-form-header {
    border-bottom-color: #334155;
}

html.dark-mode .merchant-onboarding-form-title {
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-form-subtitle {
    color: #cbd5e1;
}

html.dark-mode .merchant-onboarding-form label[style] {
    color: #f8fafc !important;
}

html.dark-mode .merchant-onboarding-form small,
html.dark-mode .merchant-onboarding-form small[style] {
    color: #94a3b8 !important;
}

/* ── Consent checkboxes (override inline styles con !important) ── */
html.dark-mode .merchant-consent-checkbox,
html.dark-mode .merchant-consent-checkbox[style] {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html.dark-mode .merchant-consent-checkbox .form-check-label {
    color: #f8fafc;
}

html.dark-mode .merchant-consent-checkbox input[type="checkbox"] {
    accent-color: #00b894;
}

html.dark-mode .merchant-consent-link,
html.dark-mode .merchant-consent-checkbox a {
    color: #14b8a6;
}

html.dark-mode .merchant-consent-link:hover {
    color: #2dd4bf;
}

/* ── Form inputs inside onboarding ──────────────────────────── */
html.dark-mode .merchant-onboarding-form input[type="text"],
html.dark-mode .merchant-onboarding-form input[type="email"],
html.dark-mode .merchant-onboarding-form input[type="number"],
html.dark-mode .merchant-onboarding-form input[type="file"],
html.dark-mode .merchant-onboarding-form textarea,
html.dark-mode .merchant-onboarding-form select {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}

html.dark-mode .merchant-onboarding-form input::placeholder,
html.dark-mode .merchant-onboarding-form textarea::placeholder {
    color: #64748b;
}

html.dark-mode .merchant-onboarding-form input:focus,
html.dark-mode .merchant-onboarding-form textarea:focus,
html.dark-mode .merchant-onboarding-form select:focus {
    border-color: #00b894;
}

/* ── Commission hint box (generato da JS con inline styles) ─── */
html.dark-mode #commission-hint[style] {
    background: #064e3b !important;
    border-color: #065f46 !important;
    color: #6ee7b7 !important;
}

/* ==========================================================================
   Info / Warning Boxes — Dark Mode
   Scoped to html.dark-mode — info-box-warning, alert-warning
   ========================================================================== */

html.dark-mode .info-box-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    color: #fef3c7;
}

html.dark-mode .info-box-warning h3,
html.dark-mode .info-box-warning strong {
    color: #fbbf24;
}

html.dark-mode .info-box-warning li,
html.dark-mode .info-box-warning p,
html.dark-mode .info-box-warning ul {
    color: #fef3c7;
}

html.dark-mode .info-box-warning li::marker {
    color: #fbbf24;
}

html.dark-mode .info-box-info {
    background: #064e3b;
    border-color: #065f46;
    color: #cbd5e1;
}

html.dark-mode .info-box-info h3 {
    color: #6ee7b7;
}

html.dark-mode .alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fef3c7;
}

/* ── Small screens: public dark mode adjustments ────────────── */
@media (max-width: 640px) {
    html.dark-mode .site-header {
        background: #020617;
    }
}

/* ==========================================================================
   Category Page — Hero Header
   Nuovo layout pagina categoria: hero, merchant list, ecc.
   ========================================================================== */

.category-page {
    max-width: 100%;
}

/* ── Category Hero Wrapper (centratura) ─────────────────────────── */
.category-hero-wrapper {
    max-width: 1240px;
    margin: 32px auto 0;
    padding: 0 16px;
}

/* ── Category Hero ──────────────────────────────────────────────── */
.category-hero {
    position: relative;
    width: 100%;
    min-height: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 20px;
    background: var(--color-bg);
}

.category-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.category-hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

.category-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.35) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    pointer-events: none;
}

.category-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-hero-content .breadcrumb {
    margin-bottom: 8px;
}

.category-hero-content .breadcrumb-list {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.category-hero-content .breadcrumb-item:not(:last-child)::after {
    color: rgba(255, 255, 255, 0.5);
}

.category-hero-content .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.85);
}

.category-hero-content .breadcrumb-item a:hover {
    color: #fff;
}

.category-hero-content .breadcrumb-item span[aria-current="page"] {
    color: rgba(255, 255, 255, 0.95);
}

.category-hero-title {
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.category-hero-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin-bottom: 4px;
    max-width: 600px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.category-hero-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── Category Hero Micro-description ───────────────────────────── */
.category-hero-micro {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-bottom: 2px;
    max-width: 640px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── Category Body ──────────────────────────────────────────────── */
.category-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

/* ── Category Results Bar (conteggio + ordinamento) ────────────── */
.category-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.category-results-count {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.category-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.category-sort-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.category-sort-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.category-sort-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 20px;
    text-decoration: none;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
    cursor: pointer;
    line-height: 1.3;
}

.category-sort-btn:hover {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    border-color: var(--color-cashback);
}

.category-sort-btn.is-active {
    background: var(--color-cashback);
    color: var(--color-white);
    border-color: var(--color-cashback);
    font-weight: 600;
}

.category-sort-btn.is-active:hover {
    background: var(--color-cashback-dark);
    border-color: var(--color-cashback-dark);
}

.category-sort-btn:focus-visible {
    outline: 2px solid var(--color-cashback);
    outline-offset: 2px;
}

/* ==========================================================================
   Category Merchant Card — Nuovo layout lista orizzontale senza sfondo
   ========================================================================== */

.category-merchant-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-merchant-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition:
        box-shadow 0.2s,
        transform 0.2s;
    position: relative;
    min-height: 88px;
}

.category-merchant-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--color-border);
}

.category-merchant-card:active {
    transform: scale(0.995);
}

/* ── Posizione ──────────────────────────────────────────────────── */
.cmc-position {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-radius: 50%;
    line-height: 1;
}

/* ── Logo ──────────────────────────────────────────────────────── */
.cmc-logo {
    flex-shrink: 0;
    width: 110px;
    height: 90px;
    min-width: 110px;
    border-radius: var(--radius-sm);
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cmc-logo img {
    display: block;
    max-width: 100px;
    max-height: 74px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cmc-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    background: transparent;
}

/* ── Body ────────────────────────────────────────────────────────── */
.cmc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.cmc-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmc-rating {
    min-height: 20px;
    display: flex;
    align-items: center;
}

.cmc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-height: 18px;
}

.cmc-meta-item {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.4;
    white-space: nowrap;
}

/* ── Badge fila (sotto nome merchant) ──────────────────────────── */
.cmc-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: -2px;
}

.cmc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-full);
    line-height: 1.3;
}

.cmc-badge-super {
    background: #fbbf24;
    color: #1a1a2e;
}

/* ── Cashback + CTA ────────────────────────────────────────────── */
.cmc-cashback-cta {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    text-align: center;
}

.cmc-cashback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

/* ── Desktop (1024px+) ──────────────────────────────────────────── */
@media (min-width: 1024px) {
    .category-hero-wrapper {
        padding: 0 24px;
        margin-top: 40px;
    }

    .category-hero {
        min-height: 220px;
        height: 220px;
        border-radius: 24px;
    }

    .category-hero-content {
        padding: 40px 16px;
    }

    .category-hero-title {
        font-size: clamp(36px, 3vw, 48px);
    }

    .category-hero-subtitle {
        font-size: 17px;
        max-width: 560px;
    }

    .category-hero-count {
        font-size: 17px;
    }

    .category-hero-content .breadcrumb-list {
        font-size: 16px;
    }
}

/* ── Desktop (1024px+) — card più compatte ───────────────────── */
@media (min-width: 1024px) {
    .category-merchant-card {
        gap: 20px;
        padding: 24px 28px;
        min-height: 112px;
    }

    .cmc-position {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }

    .cmc-logo {
        width: 140px;
        height: 110px;
        min-width: 140px;
    }

    .cmc-logo img {
        max-width: 126px;
        max-height: 88px;
    }

    .cmc-name {
        font-size: 20px;
    }

    .cmc-meta-item {
        font-size: 15px;
    }

    .cmc-cashback-cta {
        gap: 12px;
        min-width: 220px;
    }

    .cmc-cashback-percent {
        font-size: 38px;
    }

    .cmc-cashback-label {
        font-size: 12px;
    }

    .cmc-btn {
        padding: 10px 24px;
        font-size: 15px;
        min-height: 40px;
    }
}

.cmc-rating {
    min-height: 18px;
    display: flex;
    align-items: center;
}

.cmc-cashback-percent {
    font-size: 34px;
    font-weight: 900;
    color: var(--color-cashback);
    line-height: 1;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.cmc-cashback-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    line-height: 1;
}

.cmc-actions {
    display: flex;
    flex-shrink: 0;
}

.cmc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    line-height: 1;
    white-space: nowrap;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
    cursor: pointer;
    text-decoration: none;
    min-height: 36px;
}

.cmc-btn-primary {
    background: var(--color-cashback);
    color: var(--color-white);
    box-shadow: 0 2px 6px rgba(0, 184, 148, 0.2);
}

.cmc-btn-primary:hover {
    background: var(--color-cashback-dark);
}

/* ── Responsive Tablet (640px+) ──────────────────────────────────── */
@media (min-width: 640px) {
    .category-hero-wrapper {
        padding: 0 20px;
        margin-top: 36px;
    }

    .category-hero {
        min-height: 200px;
        height: 200px;
        border-radius: 24px;
    }

    .category-hero-content {
        padding: 36px 16px;
    }

    .category-hero-title {
        font-size: clamp(30px, 3.5vw, 38px);
    }

    .category-hero-subtitle {
        font-size: 16px;
    }

    .category-hero-count {
        font-size: 16px;
    }

    .category-hero-content .breadcrumb-list {
        font-size: 15px;
    }

    .category-merchant-card {
        gap: 16px;
        padding: 20px 24px;
        min-height: 100px;
    }

    .cmc-position {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .cmc-logo {
        width: 120px;
        height: 96px;
        min-width: 120px;
    }

    .cmc-cashback-cta {
        flex-direction: row;
        gap: 10px;
        min-width: 200px;
    }

    .cmc-cashback-percent {
        font-size: 36px;
    }

    .cmc-name {
        font-size: 19px;
    }

    .cmc-meta-item {
        font-size: 14px;
    }

    .cmc-btn {
        padding: 9px 22px;
        font-size: 14px;
        min-height: 38px;
    }
}

/* ── Responsive Mobile (max 639px) ──────────────────────────────── */
@media (max-width: 639px) {
    .category-hero-wrapper {
        padding: 0 12px;
        margin-top: 16px;
    }

    .category-hero {
        min-height: 160px;
        height: 160px;
        border-radius: 16px;
    }

    .category-hero-content {
        padding: 24px 12px;
    }

    .category-hero-title {
        font-size: clamp(24px, 5.5vw, 28px);
    }

    .category-hero-subtitle {
        display: none;
    }

    .category-hero-count {
        font-size: 14px;
    }

    .category-hero-content .breadcrumb-list {
        font-size: 13px;
    }

    .category-merchant-card {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 14px;
        border-radius: var(--radius-md);
        min-height: 92px;
    }

    .cmc-position {
        display: none;
    }

    .cmc-logo {
        width: 96px;
        height: 80px;
        min-width: 96px;
    }

    .cmc-body {
        flex: 1;
        min-width: calc(100% - 120px);
    }

    .cmc-name {
        font-size: 17px;
    }

    .cmc-meta-item {
        font-size: 13px;
    }

    .cmc-cashback-cta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid var(--color-border-light);
        gap: 16px;
    }

    .cmc-cashback {
        flex-shrink: 0;
        align-items: flex-start;
    }

    .cmc-cashback-percent {
        font-size: 30px;
    }

    .cmc-cashback-label {
        font-size: 11px;
    }

    .cmc-actions {
        flex-direction: row;
        width: auto;
        flex: 1;
        justify-content: flex-end;
    }

    .cmc-btn {
        width: auto;
        padding: 10px 18px;
        font-size: 14px;
        min-height: 38px;
    }

    .cmc-badge {
        font-size: 9px;
        padding: 1px 6px;
    }
}

@media (max-width: 400px) {
    .category-merchant-card {
        padding: 12px 10px;
        gap: 10px;
        min-height: 76px;
    }

    .cmc-logo {
        width: 80px;
        height: 68px;
        min-width: 80px;
    }

    .cmc-name {
        font-size: 16px;
    }

    .cmc-meta-item {
        font-size: 12px;
    }

    .cmc-cashback-percent {
        font-size: 26px;
    }

    .cmc-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 34px;
    }
}

/* ==========================================================================
   Category Page — Dark Mode
   ========================================================================== */

html.dark-mode .category-hero {
    background: #0f172a;
}

html.dark-mode .category-hero-overlay {
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

html.dark-mode .category-hero-title {
    color: #f8fafc;
}

html.dark-mode .category-hero-subtitle {
    color: rgba(248, 250, 252, 0.85);
}

html.dark-mode .category-hero-count {
    color: rgba(248, 250, 252, 0.65);
}

html.dark-mode .category-hero-content .breadcrumb-item a {
    color: rgba(248, 250, 252, 0.7);
}

html.dark-mode .category-hero-content .breadcrumb-item a:hover {
    color: #f8fafc;
}

html.dark-mode
    .category-hero-content
    .breadcrumb-item
    span[aria-current="page"] {
    color: rgba(248, 250, 252, 0.9);
}

html.dark-mode .category-hero-content .breadcrumb-item:not(:last-child)::after {
    color: rgba(248, 250, 252, 0.4);
}

html.dark-mode .category-hero-micro {
    color: rgba(248, 250, 252, 0.75);
}

html.dark-mode .category-results-count {
    color: #f8fafc;
}

html.dark-mode .category-results-bar {
    border-color: #334155;
}

html.dark-mode .category-sort-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

html.dark-mode .category-sort-btn:hover {
    background: rgba(0, 184, 148, 0.12);
    color: #34d399;
    border-color: #34d399;
}

html.dark-mode .category-sort-btn.is-active {
    background: var(--color-cashback);
    color: var(--color-white);
    border-color: var(--color-cashback);
}

html.dark-mode .category-sort-btn.is-active:hover {
    background: var(--color-cashback-dark);
}

html.dark-mode .category-sort-label {
    color: #94a3b8;
}

/* ── Dark mode: Merchant Cards ────────────────────────────────── */
html.dark-mode .category-merchant-card {
    background: #1e293b;
    border-color: #334155;
}

html.dark-mode .category-merchant-card:hover {
    border-color: #475569;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

html.dark-mode .cmc-position {
    background: #0f172a;
    color: #64748b;
}

html.dark-mode .cmc-logo {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode .cmc-logo img {
    filter: brightness(1.1);
}

html.dark-mode .cmc-name {
    color: #f8fafc;
}

html.dark-mode .cmc-meta-item {
    color: #94a3b8;
}

html.dark-mode .cmc-cashback-percent {
    color: #34d399;
}

html.dark-mode .cmc-cashback-label {
    color: #64748b;
}

html.dark-mode .cmc-badge-super {
    background: #f59e0b;
    color: #0f172a;
}

html.dark-mode .cmc-btn-primary {
    background: var(--color-cashback);
    color: var(--color-white);
}

html.dark-mode .cmc-btn-primary:hover {
    background: var(--color-cashback-dark);
}

/* ==========================================================================
   Cashback Cards Editorial Page
   Pagina /migliori-carte-cashback/ — Confronto carte cashback
   ========================================================================== */

.cashback-cards-page {
    max-width: 100%;
    padding-bottom: 3rem;
}

/* ── Spaziatura contenuti ────────────────────────────────────────── */
.cashback-cards-page .breadcrumb {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
}

.cashback-cards-section {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1rem 1.5rem;
}

@media (min-width: 768px) {
    .cashback-cards-section {
        padding: 2.5rem 1.5rem 2rem;
    }
}

.cashback-cards-section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    line-height: var(--line-height-tight);
}

.cashback-cards-section-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .cashback-cards-section-title {
        font-size: var(--font-size-3xl);
    }
    .cashback-cards-section-subtitle {
        font-size: var(--font-size-lg);
    }
}

/* ── HERO ────────────────────────────────────────────────────────── */
.cashback-cards-hero {
    background: linear-gradient(135deg, #e6faf5 0%, #f0eeff 100%);
    padding: 2.5rem 1rem;
    position: relative;
    overflow: hidden;
}

html.dark-mode .cashback-cards-hero {
    background: linear-gradient(135deg, #0a2e28 0%, #1a1440 100%);
}

.cashback-cards-hero-inner {
    max-width: 1240px;
    margin: 0 auto;
}

.cashback-cards-hero-badge {
    display: inline-block;
    background: rgba(108, 92, 231, 0.12);
    color: var(--color-accent);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

html.dark-mode .cashback-cards-hero-badge {
    background: rgba(108, 92, 231, 0.25);
}

.cashback-cards-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
    margin-bottom: 0.75rem;
}

.cashback-cards-hero-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    max-width: 720px;
}

@media (min-width: 768px) {
    .cashback-cards-hero {
        padding: 3.5rem 1.5rem;
    }
    .cashback-cards-hero-title {
        font-size: 2.25rem;
    }
    .cashback-cards-hero-text {
        font-size: var(--font-size-lg);
    }
}

/* ── AVVISO ──────────────────────────────────────────────────────── */
.cashback-cards-alert {
    max-width: 1240px;
    margin: 1rem auto;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

html.dark-mode .cashback-cards-alert {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.cashback-cards-alert-icon {
    flex-shrink: 0;
    color: var(--color-accent);
    margin-top: 2px;
}

.cashback-cards-alert-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

@media (min-width: 768px) {
    .cashback-cards-alert {
        margin: 1.5rem auto;
        padding: 1.25rem 1.5rem;
    }
}

/* ── TABELLA ─────────────────────────────────────────────────────── */
.cashback-cards-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

html.dark-mode .cashback-cards-table-wrap {
    border-color: rgba(255, 255, 255, 0.08);
}

.cashback-cards-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    background: var(--color-bg-card);
    min-width: 640px;
}

html.dark-mode .cashback-cards-table {
    background: var(--color-bg-card);
}

.cashback-cards-table thead {
    background: var(--color-bg-alt);
}

html.dark-mode .cashback-cards-table thead {
    background: rgba(255, 255, 255, 0.04);
}

.cashback-cards-table th {
    padding: 0.75rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

html.dark-mode .cashback-cards-table th {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.cashback-cards-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    vertical-align: middle;
}

html.dark-mode .cashback-cards-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.cashback-cards-table tbody tr:last-child td {
    border-bottom: none;
}

.cashback-cards-table tbody tr:hover {
    background: rgba(0, 184, 148, 0.03);
}

.cci-name strong {
    font-weight: 600;
    color: var(--color-text-primary);
}

.cci-cta {
    white-space: nowrap;
    font-size: var(--font-size-xs);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
}

.cci-cta-disabled {
    display: inline-block;
    white-space: nowrap;
    font-size: var(--font-size-xs);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    cursor: default;
    text-align: center;
}

.cashback-cards-table-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    padding: 0;
}

/* Mobile: trasforma tabella in card layout */
@media (max-width: 767px) {
    .cashback-cards-table {
        min-width: auto;
    }
    .cashback-cards-table thead {
        display: none;
    }
    .cashback-cards-table tbody tr {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
    }
    .cashback-cards-table tbody tr:last-child {
        border-bottom: none;
    }
    .cashback-cards-table td {
        display: flex;
        padding: 0.3rem 0;
        border-bottom: none;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .cashback-cards-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: var(--font-size-xs);
        color: var(--color-text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        flex-shrink: 0;
        min-width: 90px;
    }
    .cashback-cards-table td:last-child {
        justify-content: flex-start;
        padding-top: 0.5rem;
    }
    .cashback-cards-table td:last-child::before {
        display: none;
    }
    .cci-cta {
        width: 100%;
        text-align: center;
    }
    .cci-cta-disabled {
        width: 100%;
        text-align: center;
    }
}

/* ── CARD EDITORIALI ────────────────────────────────────────────── */
.cashback-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .cashback-card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .cashback-card-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

.cashback-card-editorial {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: box-shadow 0.2s ease;
}

.cashback-card-editorial:hover {
    box-shadow: var(--shadow-md);
}

html.dark-mode .cashback-card-editorial {
    background: var(--color-bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}

.cashback-card-editorial-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.cashback-card-editorial-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    line-height: var(--line-height-tight);
}

.cashback-card-editorial-badge {
    display: inline-block;
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

html.dark-mode .cashback-card-editorial-badge {
    background: rgba(0, 184, 148, 0.15);
    color: var(--color-cashback);
}

.cashback-card-editorial-cashback {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
}

html.dark-mode .cashback-card-editorial-cashback {
    background: rgba(255, 255, 255, 0.04);
}

.cashback-card-editorial-cashback-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cashback-card-editorial-cashback-value {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-cashback-dark);
}

html.dark-mode .cashback-card-editorial-cashback-value {
    color: var(--color-cashback);
}

.cashback-card-editorial-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    margin: 0;
}

.cashback-card-editorial-lists {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .cashback-card-editorial-lists {
        flex-direction: row;
        gap: 1rem;
    }
    .cashback-card-editorial-pros,
    .cashback-card-editorial-cons {
        flex: 1;
    }
}

.cashback-card-editorial-list-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 0.4rem 0;
}

.cashback-card-editorial-pros ul,
.cashback-card-editorial-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cashback-card-editorial-pros ul li,
.cashback-card-editorial-cons ul li {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    padding: 0.2rem 0;
    padding-left: 1.1rem;
    position: relative;
}

.cashback-card-editorial-pros ul li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--color-cashback);
    font-weight: 700;
}

.cashback-card-editorial-cons ul li::before {
    content: "\26A0";
    position: absolute;
    left: 0;
    color: var(--color-coral);
    font-size: 0.8em;
}

.cashback-card-editorial-footer {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.5rem;
    margin-top: auto;
}

.cashback-card-editorial-footer .btn {
    align-self: flex-start;
}

.cashback-card-editorial-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin: 0;
}

/* ── GUIDA ALLA SCELTA ──────────────────────────────────────────── */
.cashback-cards-guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .cashback-cards-guide-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

.cashback-cards-guide-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    box-shadow: var(--shadow-sm);
}

html.dark-mode .cashback-cards-guide-item {
    background: var(--color-bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}

.cashback-cards-guide-cat {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.4;
    flex: 1;
}

.cashback-cards-guide-val {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-cashback-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

html.dark-mode .cashback-cards-guide-val {
    color: var(--color-cashback);
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.cashback-cards-faq {
    max-width: 800px;
}

.cashback-cards-faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--color-bg-card);
    transition: box-shadow 0.2s ease;
}

.cashback-cards-faq-item[open] {
    box-shadow: var(--shadow-sm);
}

html.dark-mode .cashback-cards-faq-item {
    background: var(--color-bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}

.cashback-cards-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    gap: 0.75rem;
    line-height: 1.4;
}

.cashback-cards-faq-question::-webkit-details-marker {
    display: none;
}

.cashback-cards-faq-question::after {
    content: "\276F";
    font-size: 0.75rem;
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.cashback-cards-faq-item[open] .cashback-cards-faq-question::after {
    transform: rotate(90deg);
}

.cashback-cards-faq-answer {
    padding: 0 1.15rem 1rem;
}

.cashback-cards-faq-answer p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── DISCLAIMER ──────────────────────────────────────────────────── */
.cashback-cards-disclaimer {
    max-width: 1240px;
    margin: 2rem auto 0;
    padding: 1.25rem 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

html.dark-mode .cashback-cards-disclaimer {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.cashback-cards-disclaimer p {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   Cashback Cards — Status badges, source notes, section groups
   ========================================================================== */

/* ── Status badge (3 livelli: verified / review / unconfirmed) ───── */
.cci-status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}

.cci-status-badge--verified {
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
}

html.dark-mode .cci-status-badge--verified {
    background: rgba(0, 184, 148, 0.15);
    color: var(--color-cashback);
}

.cci-status-badge--review {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

html.dark-mode .cci-status-badge--review {
    background: rgba(108, 92, 231, 0.15);
    color: #a89cf5;
}

.cci-status-badge--unconfirmed {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
}

html.dark-mode .cci-status-badge--unconfirmed {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
}

/* ── Status badge nella tabella (colonna dedicata) ───────────────── */
.cashback-cards-table td[data-label="Stato verifica"] {
    white-space: nowrap;
}

.cashback-cards-table td[data-label="Stato verifica"] .cci-status-badge {
    font-size: 0.6rem;
}

/* ── Header left wrapper ─────────────────────────────────────────── */
.cashback-card-editorial-header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ── Source note (schede editoriali) ─────────────────────────────── */
.cci-source-note {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

html.dark-mode .cci-source-note {
    color: rgba(255, 255, 255, 0.35);
}

/* ── Section groups (sezioni editoriali) ─────────────────────────── */
.cci-section-group {
    padding: 2rem 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
}

@media (min-width: 768px) {
    .cci-section-group {
        padding: 2.5rem 1.5rem 2rem;
    }
}

.cci-section-group--verified {
    border-color: var(--color-cashback);
    background: var(--color-cashback-light);
}

html.dark-mode .cci-section-group--verified {
    background: rgba(0, 184, 148, 0.05);
    border-color: rgba(0, 184, 148, 0.3);
}

.cci-section-group--review {
    border-color: var(--color-border);
    background: var(--color-bg-card);
}

html.dark-mode .cci-section-group--review {
    background: var(--color-bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}

.cci-section-group--unconfirmed {
    border-color: var(--color-border);
    background: var(--color-bg-alt);
}

html.dark-mode .cci-section-group--unconfirmed {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

/* ── Disclaimer update ──────────────────────────────────────────── */
.cashback-cards-disclaimer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cashback-cards-disclaimer p {
    margin: 0;
}

/* ── Mobile: status badge responsive ─────────────────────────────── */
@media (max-width: 767px) {
    .cashback-card-editorial-header-left .cci-status-badge {
        font-size: 0.6rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   XP Cashback / Livelli / Reputazione
   ═══════════════════════════════════════════════════════════════════ */

/* ── XP Motivation Box (form recensione) ── */
.xp-motivation-box {
    background: linear-gradient(135deg, var(--color-cashback-light), #e6faf5);
    border: 2px solid var(--color-cashback);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.xp-motivation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.xp-motivation-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--color-cashback);
    color: var(--color-white);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 700;
}
.xp-motivation-sub {
    font-size: var(--font-size-sm);
    color: var(--color-cashback-dark);
    font-weight: 500;
}
.xp-motivation-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0 0 1rem;
}
.xp-mini-profile {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}
.xp-mini-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.xp-mini-icon {
    font-size: 1.25rem;
}
.xp-mini-label {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}
.xp-mini-bar-wrapper {
    margin-bottom: 0.375rem;
}
.xp-mini-bar {
    height: 6px;
    background: var(--color-border-light);
    border-radius: 3px;
    overflow: hidden;
}
.xp-mini-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--color-cashback),
        var(--color-accent)
    );
    border-radius: 3px;
    transition: width 0.3s ease;
}
.xp-mini-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
}
.xp-mini-xp {
    font-weight: 600;
    color: var(--color-cashback-dark);
}
.xp-mini-next {
    color: var(--color-text-muted);
}

/* ── XP Profile Card (user area) ── */
.xp-profile-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.xp-profile-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.xp-profile-title-icon {
    font-size: 1.25rem;
}
.xp-profile-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.xp-profile-icon {
    font-size: 1.5rem;
}
.xp-profile-level {
    font-weight: 600;
    font-size: var(--font-size-base);
}
.xp-profile-bar {
    height: 8px;
    background: var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.xp-profile-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--color-cashback),
        var(--color-accent)
    );
    border-radius: 4px;
    transition: width 0.3s ease;
}
.xp-profile-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
}
.xp-profile-total {
    font-weight: 700;
    color: var(--color-cashback-dark);
}
.xp-profile-next {
    color: var(--color-text-muted);
}

/* ── Badge row ── */
.xp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border: 1px solid transparent;
}

/* ── XP incentivized button text ── */
.xp-incentive {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-xs);
    color: var(--color-cashback-dark);
    font-weight: 500;
}
.xp-incentive-icon {
    font-size: 0.875rem;
}

/* ── User level badge (in merchant reviews) ── */
.xp-user-level {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}
.xp-user-level-icon {
    font-size: 0.875rem;
}

/* ── XP Events timeline ── */
.xp-events {
    margin-top: 1rem;
}
.xp-event {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
}
.xp-event:last-child {
    border-bottom: none;
}
.xp-event-desc {
    color: var(--color-text-primary);
}
.xp-event-xp {
    font-weight: 600;
    color: var(--color-cashback);
}
.xp-event-status {
    font-size: var(--font-size-xs);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-full);
}
.xp-event-status--pending {
    background: #fef3c7;
    color: #92400e;
}
.xp-event-status--approved {
    background: #d1fae5;
    color: #065f46;
}
.xp-event-status--rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Level up celebration ── */
.xp-level-up {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(
        135deg,
        var(--color-cashback-light),
        var(--color-accent-light)
    );
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.xp-level-up-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}
.xp-level-up-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
}
.xp-level-up-sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════
   Recensioni cashback merchant
   ═══════════════════════════════════════════════════════════════════ */
.merchant-reviews-section {
    scroll-margin-top: 80px;
}

.merchant-reviews-summary-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    padding: 1rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.merchant-reviews-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.merchant-reviews-stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: center;
}

.merchant-reviews-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-cashback);
    display: block;
}

.merchant-reviews-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    display: block;
    margin-top: 0.125rem;
}

.merchant-review-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}

.merchant-review-card:hover {
    border-color: var(--color-cashback-light);
}

.merchant-review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.merchant-review-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.merchant-review-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    flex-shrink: 0;
}

.merchant-review-nickname {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.merchant-review-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.merchant-review-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--color-cashback-light);
    color: var(--color-cashback-dark);
    white-space: nowrap;
}

.merchant-review-badge--confirmed {
    background: #d1fae5;
    color: #065f46;
}

.merchant-review-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.merchant-review-stars {
    color: #f59e0b;
    font-size: var(--font-size-lg);
}

.merchant-review-score {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.merchant-review-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.merchant-review-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.merchant-review-detail-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.merchant-review-detail-value {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.merchant-review-comment {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    line-height: 1.6;
    padding: 0.75rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.merchant-review-comment::before {
    content: "\201C";
}
.merchant-review-comment::after {
    content: "\201D";
}

.merchant-review-confirmed-note {
    font-size: var(--font-size-xs);
    color: var(--color-cashback-dark);
    font-weight: 500;
}

.merchant-review-verified {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--color-cashback-dark);
    font-weight: 500;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
}
.merchant-review-verified-badge {
    font-size: 12px;
}
.merchant-reviews-empty-box,
.merchant-reviews-initial-box,
.merchant-reviews-data-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}
.merchant-reviews-empty-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
}
.merchant-reviews-initial-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.merchant-reviews-data-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.merchant-reviews-empty-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}
.merchant-reviews-initial-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: #92400e;
}
.merchant-reviews-data-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: #065f46;
}
html.dark-mode .merchant-review-verified {
    border-color: #334155;
}
html.dark-mode .merchant-reviews-empty-box {
    background: #1e293b;
    border-color: #334155;
}
html.dark-mode .merchant-reviews-initial-box {
    background: #422006;
    border-color: #78350f;
}
html.dark-mode .merchant-reviews-initial-title {
    color: #fbbf24;
}
html.dark-mode .merchant-reviews-data-box {
    background: #064e3b;
    border-color: #065f46;
}
html.dark-mode .merchant-reviews-data-title {
    color: #6ee7b7;
}

.merchant-reviews-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.merchant-reviews-error {
    text-align: center;
    padding: 1rem;
    color: var(--color-coral);
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   Gufy Page — Estensione Chrome
   ========================================================================== */

.gufy-page {
    padding-bottom: 3rem;
}

/* ── Hero ────────────────────────────────────────────────────────── */
.gufy-hero {
    background: linear-gradient(
        135deg,
        var(--color-cashback-light) 0%,
        #e6fff5 100%
    );
    padding: 4rem 0;
}

.gufy-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.gufy-hero-text {
    flex: 1;
    max-width: 640px;
}

.gufy-hero-badge {
    display: inline-block;
    background: var(--color-cashback);
    color: var(--color-white);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 1rem;
}

.gufy-hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-text-primary);
    line-height: 1.15;
    margin: 0 0 1rem;
}

.gufy-hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.gufy-hero-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

.gufy-hero-trust {
    font-size: var(--font-size-sm);
    color: var(--color-cashback-dark);
    font-weight: 600;
    margin: 0 0 1rem;
}

.gufy-hero-visual {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gufy-hero-icon {
    font-size: 8rem;
    line-height: 1;
    animation: gufy-float 3s ease-in-out infinite;
}

@keyframes gufy-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ── Steps ───────────────────────────────────────────────────────── */
.gufy-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 720px;
    margin: 0 auto;
}

.gufy-step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.gufy-step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-cashback);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 800;
}

.gufy-step-content h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--color-text-primary);
}

.gufy-step-content p {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── Benefits ────────────────────────────────────────────────────── */
.gufy-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.gufy-benefit {
    text-align: center;
}

.gufy-benefit h3 {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin: 0.75rem 0 0.5rem;
    color: var(--color-text-primary);
}

.gufy-benefit p {
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.gufy-faq {
    max-width: 720px;
    margin: 0 auto;
}

.gufy-faq-item {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--color-bg-card);
}

.gufy-faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gufy-faq-item summary::-webkit-details-marker {
    display: none;
}

.gufy-faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: var(--font-size-sm);
}

.gufy-faq-answer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .gufy-hero {
        padding: 2.5rem 0;
    }

    .gufy-hero-content {
        flex-direction: column;
        text-align: center;
    }

    .gufy-hero-text {
        max-width: 100%;
    }

    .gufy-hero-title {
        font-size: 1.75rem;
    }

    .gufy-hero-icon {
        font-size: 5rem;
    }

    .gufy-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .gufy-step-number {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
}

/* CTA button within gufy page */
.gufy-cta {
    font-size: var(--font-size-lg);
    padding: 16px 36px;
}

/* Middle CTA wrapper */
.gufy-middle-cta {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

/* Footer CTA wrapper */
.gufy-footer-cta {
    text-align: center;
    margin-top: 2.5rem;
    padding: 2rem;
    background: var(--color-cashback-light);
    border-radius: var(--radius-lg);
}

.gufy-footer-cta-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 1rem;
}

/* ==========================================================================
   Gufy Desktop Banner — fixed in basso a destra, solo utenti loggati desktop
   ========================================================================== */

.gufy-desktop-banner {
    display: none;
}

@media (min-width: 1024px) {
    .gufy-desktop-banner {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 9999;
        width: 380px;
        max-width: calc(100vw - 40px);
    }

    .gufy-banner-card {
        background: var(--color-bg-card);
        border: 1px solid var(--color-cashback);
        border-radius: var(--radius-lg);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        position: relative;
        overflow: hidden;
    }

    .gufy-banner-content {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .gufy-banner-icon {
        flex-shrink: 0;
        font-size: 2rem;
        line-height: 1;
        margin-top: 2px;
    }

    .gufy-banner-body {
        flex: 1;
        min-width: 0;
    }

    .gufy-banner-title {
        font-size: var(--font-size-base);
        font-weight: 700;
        margin: 0 0 0.15rem;
        color: var(--color-text-primary);
        line-height: 1.3;
    }

    .gufy-banner-text {
        font-size: var(--font-size-xs);
        color: var(--color-text-secondary);
        margin: 0;
        line-height: 1.4;
    }

    .gufy-banner-note {
        font-size: 11px;
        color: var(--color-text-muted);
        margin: 0.25rem 0 0;
    }

    .gufy-banner-actions {
        flex-shrink: 0;
        align-self: center;
    }

    .gufy-banner-actions .btn {
        min-height: 36px;
        padding: 8px 14px;
        font-size: var(--font-size-sm);
        white-space: nowrap;
    }

    /* Pulsante chiusura in alto a destra */
    .gufy-banner-close {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: none;
        background: transparent;
        color: var(--color-text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        transition:
            background 0.15s ease,
            color 0.15s ease;
        padding: 0;
        line-height: 1;
        z-index: 1;
    }

    .gufy-banner-close:hover {
        background: rgba(0, 0, 0, 0.06);
        color: var(--color-text-primary);
    }
}
