/* ============================================
   DB Grupos - CSS por Defecto (basado en ejemplo)
   ============================================ */

:root {
    --dbg-font: Inter, system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Arial', sans-serif;
    --dbg-primary: #1e3a8a;
}

/* Contenedor General */
.db-groups-page,
.db-groups-page * {
    font-family: var(--dbg-font) !important;
    box-sizing: border-box;
}

.db-groups-page {
    color: #0f172a;
}

.db-groups-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Acordeón de Grupos (igual al ejemplo af-country)
   ============================================ */

/* Título del grupo (FUERA del acordeón, simple en negritas) */
.dbg-group-title-wrapper {
    margin: 20px 0 12px;
}

.dbg-group-title-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dbg-group-title-text {
    flex: 1;
}

.dbg-group-title-simple {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.dbg-group-description {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.dbg-group-title-content .dbg-flag {
    width: 34px;
    height: 24px;
    margin-top: 4px;
}

/* Botón Expandir/Colapsar todo */
.dbg-toggle-all {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    margin-left: auto;
}

.dbg-toggle-all:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

details.dbg-group {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin: 14px 0;
    overflow: hidden;
}

details.dbg-group > summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    gap: 12px;
}

details.dbg-group[open] > summary {
    background: #e0ecff;
}

.dbg-summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Bandera del grupo */
.dbg-flag {
    width: 34px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-block;
    vertical-align: middle;
}

summary .dbg-flag img {
    display: block;
    width: 34px;
    height: 24px;
    object-fit: cover;
}

.dbg-group-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dbg-group-name h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.dbg-count {
    font-weight: 500;
    color: #6b7280;
}

.dbg-toggle-label {
    color: #1d4ed8;
    font-weight: 700;
    font-size: 14px;
}

/* ============================================
   Secciones como acordeón (igual al ejemplo)
   ============================================ */

details.dbg-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin: 14px 0;
    overflow: hidden;
}

details.dbg-section > summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    gap: 12px;
}

details.dbg-section > summary:hover {
    background: #e0ecff;
}

details.dbg-section[open] > summary {
    background: #e0ecff;
}

/* Contenido izquierdo del summary de sección */
.dbg-section-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* Icono/flag de la sección (agrandado) */
.dbg-section-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

/* Título de la sección (alineado a la izquierda) */
.dbg-section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    flex: 1;
}

/* Contador por sección (a la derecha) */
.dbg-section-count {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
    margin-left: auto;
}

/* Texto Mostrar/Colapsar en secciones */
.dbg-section-toggle {
    font-weight: 600;
    color: #1d4ed8;
    font-size: 13px;
    margin-left: 8px;
}

/* ============================================
   Grid de Items (igual al ejemplo af-grid)
   ============================================ */

.dbg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 16px 18px 18px;
}

@media (min-width: 640px) {
    .dbg-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .dbg-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ============================================
   Card de Item (igual al ejemplo af-card)
   ============================================ */

.dbg-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Logo/Imagen del item (igual al ejemplo af-logo) */
.dbg-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    background: #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #9ca3af;
}

.dbg-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nombre/Título del item (igual al ejemplo af-name) */
.dbg-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

/* Subtítulo/Ciudad del item (igual al ejemplo af-city) */
.dbg-city {
    font-size: 12px;
    color: #6b7280;
}

/* Enlace del item (igual al ejemplo af-link) */
.dbg-link {
    display: inline-block;
    margin-top: 2px;
    font-size: 12px;
    color: #1d4ed8;
    text-decoration: none;
}