/* ---------- Servizi Hubix tra i risultati di ricerca ----------
   Blocco in testa al riepilogo /cashback/risultati (_HubixServicesBlock.cshtml) e sopra la risposta nella chat
   Hubix AI (hub-services.js, variante .hub-services--chat). Una card in gradiente blu per servizio, su sfondo
   trasparente, in griglia da lg: 2 colonne (anche con una card sola, larga come una delle due), 3 da tre card in su; nella chat sempre 2. Dentro #products styleCB.css colora tutti gli
   <a> con un selettore a id: per questo alcune regole hanno anche il prefisso #products / #hubix-ai. */

.hub-services-banner {
    display: grid;
    gap: 1rem;
}

/* Da lg: griglia a 2 colonne (una card da sola e' larga come una delle due), da tre card in su 3 colonne. */
@media (min-width: 992px) {
    .hub-services-banner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-services-banner:not([data-count="1"]):not([data-count="2"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

#products .hub-services a.hub-service,
#hubix-ai .hub-services a.hub-service,
.hub-services a.hub-service {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-md, 10px);
    background: linear-gradient(120deg, #00468f 0%, #0a5fd6 55%, #2f8bff 100%);
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 .35rem 1rem rgba(0, 20, 60, .15);
    transition: transform .2s ease, box-shadow .2s ease;
}

/* Riflesso chiaro in alto a destra della card, solo decorativo. */
.hub-services a.hub-service::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 55%;
    height: 180%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.hub-services a.hub-service > * { position: relative; }

#products .hub-services a.hub-service:hover,
#hubix-ai .hub-services a.hub-service:hover,
.hub-services a.hub-service:hover,
.hub-services a.hub-service:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 .75rem 1.5rem rgba(0, 20, 60, .28);
    color: #fff;
}

.hub-service-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px var(--hub-accent, #006ef7); /* browser senza color-mix */
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--hub-accent, #006ef7) 55%, transparent);
}

.hub-service-icon img {
    width: 36px!important;
    height: 36px!important;
    object-fit: contain!important;
}

.hub-service-body {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
}

.hub-service-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .8;
}

/* I titoli sono <span>: dentro #products gli h2 hanno regole a id. */
.hub-service-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.hub-service-text {
    font-size: 14px;
    line-height: 1.4;
    opacity: .92;
}

.hub-service-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: .5rem;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: #fff;
    color: var(--color-primary, #00468f);
    font-size: 13px;
    font-weight: 700;
    transition: gap .2s ease;
}

.hub-services a.hub-service:hover .hub-service-cta { gap: 10px; }

/* Sotto md: icona sopra il testo. */
@media (max-width: 575.98px) {
    .hub-services a.hub-service { flex-direction: column; align-items: flex-start!important; }
    #products .hub-services a.hub-service, #hubix-ai .hub-services a.hub-service, .hub-services a.hub-service { align-items: flex-start!important; }
    #hubix-ai .hub-services--chat .hub-service-icon { width: 64px!important; height: 64px!important; }
}

/* ----- Chat Hubix AI: variante compatta sopra la risposta ----- */
#hubix-ai .hub-services--chat { margin: 14px 0; }
#hubix-ai .hub-services--chat:first-child { margin-top: 0; }
#hubix-ai .hub-services--chat .hub-services-banner { gap: .75rem; }
#hubix-ai .hub-services--chat a.hub-service { padding: .9rem 1.1rem; gap: .75rem; }
#hubix-ai .hub-services--chat .hub-service-icon { width: 52px; height: 52px; }
#hubix-ai .hub-services--chat .hub-service-icon img { width: 30px; height: 30px; }
#hubix-ai .hub-services--chat .hub-service-title { font-size: 17px; }
#hubix-ai .hub-services--chat .hub-service-text { font-size: 13px; }
#hubix-ai .hub-services--chat .hub-service-cta { margin-top: .35rem; font-size: 12px; padding: .3rem .75rem; }

/* Nella chat la colonna e' stretta: sempre 2 colonne, qualunque sia il numero di card. */
@media (min-width: 992px) {
    #hubix-ai .hub-services--chat .hub-services-banner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .hub-services a.hub-service, .hub-service-cta { transition: none; }
    .hub-services a.hub-service:hover { transform: none; }
}
