/* =========================================================
   ROCARVIO · CARDURI "VIZUALIZATE RECENT"
   Badge-urile CP / cutie de viteze / județ se văd complet pe
   orice lățime de card, fără text tăiat.
   ========================================================= */
html body .recently-viewed-card .card-content .specs,
html body .recent-cards .card-content .specs,
html body .recently-viewed-grid .card-content .specs {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)) !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    gap: var(--rc-space-2) !important;
}

html body .recently-viewed-card .card-content .specs span,
html body .recent-cards .card-content .specs span,
html body .recently-viewed-grid .card-content .specs span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 40px !important;
    padding: var(--rc-space-2) 5px !important;
    font-size: clamp(9.5px, 2.4vw, 11.5px) !important;
    line-height: var(--rc-leading-tight) !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto !important;
    text-overflow: clip !important;
}

/* Titlul și subtitlul rămân lizibile în cardurile înguste. */
html body .recently-viewed-card .card-content h3,
html body .recent-cards .card-content h3 {
    min-height: 0 !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    line-height: 1.25 !important;
}
html body .recently-viewed-card .card-content p,
html body .recent-cards .card-content p {
    overflow: visible !important;
    white-space: normal !important;
}

/* Grila de carduri se adaptează pe toate ecranele. */
html body .detail-recently-viewed .recent-cards,
html body .home-page .recently-viewed .recent-cards,
html body .recently-viewed-grid.cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

@media (max-width: 900px) {
    html body .recently-viewed-card .card-content .specs,
    html body .recent-cards .card-content .specs {
        grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)) !important;
        gap: 7px !important;
    }
}

@media (max-width: 640px) {
    html body .detail-recently-viewed .recent-cards,
    html body .home-page .recently-viewed .recent-cards,
    html body .recently-viewed-grid.cards {
        grid-template-columns: 1fr !important;
    }
    html body .recently-viewed-card .card-content .specs span,
    html body .recent-cards .card-content .specs span {
        min-height: 42px !important;
        font-size: var(--rc-text-sm) !important;
    }
}

/* Cardurile din grilă au aceeași înălțime și aliniere pe orice ecran. */
html body .recent-cards .recently-viewed-card,
html body .recently-viewed-grid .recently-viewed-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}
html body .recently-viewed-card .card-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}
html body .recently-viewed-card .card-content .specs {
    margin-top: auto !important;
}
html body .recently-viewed-card .card-content > a:last-of-type {
    margin-top: var(--rc-space-4) !important;
}

