/* inseminacion.css — jaula grid visual */

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Color legend */
.leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.leyenda-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Fila física (agrupa 2 lotes) */
.fila-fisica {
    margin-bottom: 20px;
}

.fila-fisica__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: block;
    margin-bottom: 6px;
}

.fila-fisica__lotes {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

/* Lote (50 jaulas en 2 filas × 25 columnas) */
.lote {
    flex-shrink: 0;
}

.lote__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.lote__grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    background: var(--surface);
}

.lote__row {
    display: flex;
    gap: 3px;
}

.lote--vacio {
    opacity: 0;
    pointer-events: none;
}

/* Individual jaula cell */
.jaula-cell {
    width: 36px;
    height: 48px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .1s, box-shadow .1s;
    overflow: hidden;
    position: relative;
}

.jaula-cell:active {
    transform: scale(.93);
}

.jaula-cell--vacia     { background: var(--color-vacia);     border-color: #bbb; }
.jaula-cell--pendiente { background: var(--color-pendiente); border-color: #c9a600; }
.jaula-cell--celo      { background: var(--color-celo);      border-color: #c4752a; }
.jaula-cell--gestante  { background: var(--color-gestante);  border-color: #3a8a68; }
.jaula-cell--absent    { background: transparent; border-color: transparent; cursor: default; }

.jaula-cell__num {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.jaula-cell__crotal {
    font-size: 8px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 32px;
}

/* Bottom sheet */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px 32px;
    z-index: 201;
    transform: translateY(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet__handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 12px;
}

.sheet-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.bottom-sheet__content h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.dl-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-size: 14px;
}

.dl-grid dt {
    color: var(--text-muted);
    font-weight: 500;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

@media (min-width: 768px) {
    .bottom-sheet {
        left: auto;
        right: 24px;
        bottom: 24px;
        width: 360px;
        border-radius: 12px;
        transform: translateY(120%);
    }
    .bottom-sheet.open {
        transform: translateY(0);
    }
}
