/* =============================================================
   addictions.css
   Dropdown personalizado Bootstrap 5 para el grid de Addictions
   Paleta: azul #1A3A5C · naranja #F07800 · blanco #FFFFFF
   ============================================================= */

/* ── Card ──────────────────────────────────────────────────── */
.addict-card {
    position: relative;
    border-radius: 6px;
    overflow: visible;           /* permite que el badge sobresalga */
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Badge nombre (flag naranja) ───────────────────────────── */
.addict-card__badge {
    position: absolute;
    top: 14px;
    left: 0;
    z-index: 10;
    background: #F07800;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 14px 5px 10px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 0 3px 3px 0;
}

.addict-card__badge-arrow {
    position: absolute;
    right: -10px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 13px 0 13px 10px;
    border-color: transparent transparent transparent #F07800;
}

/* ── Imagen ────────────────────────────────────────────────── */
.addict-card__img-wrap {
    flex: 1;
    min-height: 180px;
    background: #1A3A5C;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

.addict-card__img-link {
    display: block;
    width: 100%;
    height: 100%;
}

.addict-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.addict-card:hover .addict-card__img {
    transform: scale(1.04);
}

.addict-card__placeholder {
    width: 100%;
    min-height: 180px;
    background: #1A3A5C;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1rem;
    text-align: center;
}

/* ── Footer ────────────────────────────────────────────────── */
.addict-card__footer {
    padding: 12px;
    background: #fff;
    border-radius: 0 0 6px 6px;
    border-top: 1px solid #e9ecef;
    position: relative;   /* contexto para el dropdown */
}

/* ── Botón "Ver contenido" ─────────────────────────────────── */
.btn-addict-view {
    background: #1A3A5C;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 8px 0;
    transition: background .2s ease;
}

.btn-addict-view:hover,
.btn-addict-view:focus {
    background: #F07800;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   DROPDOWN PERSONALIZADO  (.addict-dropdown)
   Reemplaza al <select> nativo
   ═══════════════════════════════════════════════════════════ */

.addict-dropdown {
    position: relative;
    width: 100%;
    font-size: .82rem;
}

/* Botón disparador */
.addict-dropdown__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #6c757d;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: border-color .2s, box-shadow .2s;
}

.addict-dropdown__toggle:hover {
    border-color: #F07800;
}

.addict-dropdown__toggle:focus {
    outline: none;
    border-color: #F07800;
    box-shadow: 0 0 0 3px rgba(240,120,0,.15);
}

/* Ícono chevron — rota cuando está abierto */
.addict-dropdown__toggle .addict-dd-icon {
    font-size: .75rem;
    transition: transform .25s ease;
    color: #F07800;
    flex-shrink: 0;
}

.addict-dropdown.is-open .addict-dropdown__toggle .addict-dd-icon {
    transform: rotate(180deg);
}

/* Estado "tiene valor seleccionado" */
.addict-dropdown__toggle.has-value {
    border-color: #F07800;
    color: #1A3A5C;
    font-weight: 700;
}

/* Panel desplegable — position:fixed y coordenadas las asigna JS (portal pattern).
   Escapa del overflow:hidden de .addict-card y de cualquier contexto de
   apilamiento del grid, evitando que el menú quede tapado por la card inferior. */
.addict-dropdown__menu {
    display: none;
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    overflow: hidden;
    animation: ddFadeIn .15s ease;
}

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

/* Cabecera del panel */
.addict-dropdown__header {
    padding: 8px 12px;
    background: #1A3A5C;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* Lista de opciones con scroll */
.addict-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;

    /* Scrollbar discreta */
    scrollbar-width: thin;
    scrollbar-color: #F07800 #f1f1f1;
}

.addict-dropdown__list::-webkit-scrollbar {
    width: 5px;
}

.addict-dropdown__list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.addict-dropdown__list::-webkit-scrollbar-thumb {
    background: #F07800;
    border-radius: 10px;
}

/* Cada opción */
.addict-dropdown__item {
    padding: 9px 14px;
    cursor: pointer;
    color: #1A3A5C;
    font-size: .82rem;
    font-weight: 500;
    transition: background .15s, color .15s, padding-left .15s;
    border-left: 3px solid transparent;
}

.addict-dropdown__item:hover {
    background: #fff5ec;
    color: #F07800;
    border-left-color: #F07800;
    padding-left: 18px;
}

.addict-dropdown__item.is-active {
    background: #fff5ec;
    color: #F07800;
    border-left-color: #F07800;
    font-weight: 700;
}

/* Separador entre items (opcional, cada 5) */
.addict-dropdown__item + .addict-dropdown__item {
    border-top: 1px solid #f8f9fa;
}

/* ── Responsive: en móvil el panel siempre abre hacia abajo ── */
@media (max-width: 575.98px) {
    .addict-dropdown__menu {
        bottom: auto;
        top: calc(100% + 6px);
        box-shadow: 0 4px 20px rgba(0,0,0,.14);
        animation: ddSlideDown .18s ease;
    }

    .addict-dropdown__list {
        max-height: 180px;
    }
}