/* =====================================================================
   La Casa de la Batería — estilo de la app
   Paleta extraída del mockup/logo proporcionado:
   ===================================================================== */
:root {
    --navy: #163062;
    --navy-dark: #0f2247;
    --teal: #2597B2;
    --teal-dark: #1c7c93;
    --teal-light: #46B6D1;
    --bg: #E3EDF1;
    --white: #FFFFFF;
    --texto: #163062;
    --texto-suave: #6b7c93;
    --borde: #d7e1e8;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--texto);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding-bottom: 24px;
}

a { color: inherit; }

.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
}

/* ---------------------------------------------------------------------
   Franja superior: "Bienvenido usuario" + fecha/hora (navy)
   --------------------------------------------------------------------- */
.franja-info {
    max-width: 480px;
    margin: 0 auto;
    background: var(--navy);
    color: #cfe0f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem 1rem;
    font-size: .72rem;
    letter-spacing: .02em;
}

.franja-info strong { color: #fff; }

/* ---------------------------------------------------------------------
   Barra de módulo: ícono + título + flecha volver (teal)
   --------------------------------------------------------------------- */
.barra-modulo {
    max-width: 480px;
    margin: 0 auto;
    background: var(--teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.barra-modulo .titulo-modulo {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: 1.05rem;
}

.icono-circulo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-volver {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Subencabezado dentro de formularios (navy, ancho completo)
   --------------------------------------------------------------------- */
.subbarra {
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: .75rem 1rem;
    font-size: .95rem;
}

.contenido {
    padding: 1rem;
}

/* ---------------------------------------------------------------------
   Pantalla de inicio (grid de menú tipo mockup)
   --------------------------------------------------------------------- */
.home-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--navy);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
}

.home-logo-card {
    background: #eef2f6;
    border-radius: 14px;
    padding: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .9rem;
}

.home-logo-card img { max-width: 100%; height: auto; display: block; }

.home-bienvenido {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: .78rem;
    padding: 0 .2rem .9rem;
    letter-spacing: .02em;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem;
}

.home-btn {
    background: var(--teal);
    color: #fff;
    border-radius: 16px;
    text-decoration: none;
    padding: 1.4rem .8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .95rem;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
}

.home-btn.claro { background: var(--teal-light); }

.home-btn .icono-circulo { width: 46px; height: 46px; }

.home-extra {
    margin-top: .8rem;
}

.home-extra .home-btn {
    flex-direction: row;
    padding: 1rem;
    background: rgba(255,255,255,.08);
    border: 2px solid rgba(255,255,255,.25);
    box-shadow: none;
}

/* ---------------------------------------------------------------------
   Buscador
   --------------------------------------------------------------------- */
.buscador {
    display: flex;
    gap: .5rem;
    margin-bottom: .9rem;
}

.buscador input[type="search"] {
    flex: 1;
    border: 1px solid var(--borde);
    border-radius: 10px;
    padding: .7rem .9rem;
    font-size: .95rem;
    background: #fff;
}

.buscador button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Botones
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .85rem 1rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .92rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline-danger { background: transparent; color: #c0392b; border: 1.5px solid #c0392b; }
.btn-sm { padding: .45rem .6rem; width: auto; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Listas (filas de cliente/producto/pedido)
   --------------------------------------------------------------------- */
.fila-lista {
    background: #fff;
    border-radius: 10px;
    padding: .8rem 1rem;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--texto);
    box-shadow: 0 1px 3px rgba(22,48,98,.08);
}

.fila-lista .fila-info { flex: 1; min-width: 0; }
.fila-lista .fila-titulo { font-weight: 700; }
.fila-lista .fila-sub { color: var(--texto-suave); font-size: .8rem; margin-top: .1rem; }

.fila-acciones { display: flex; gap: .4rem; flex-shrink: 0; margin-left: .5rem; }

.icono-accion {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--navy);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icono-accion:hover { background: var(--navy); color: #fff; }

/* ---------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------- */
.campo { margin-bottom: .9rem; }

.campo label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--navy);
    margin-bottom: .3rem;
}

.campo input[type="text"],
.campo input[type="email"],
.campo input[type="tel"],
.campo input[type="number"],
.campo input[type="password"],
.campo input[type="date"],
.campo input[type="search"],
.campo select,
.campo textarea {
    width: 100%;
    border: 1px solid var(--borde);
    background: #fff;
    border-radius: 10px;
    padding: .7rem .9rem;
    font-size: .95rem;
    color: var(--texto);
    font-family: inherit;
}

.campo textarea { resize: vertical; }

.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

.mas-datos {
    border: 1.5px dashed var(--borde);
    border-radius: 10px;
    padding: .3rem .9rem;
    margin-bottom: 1rem;
}

.mas-datos summary {
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .78rem;
    color: var(--teal-dark);
    padding: .6rem 0;
    list-style: none;
}

.mas-datos summary::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------------
   Tarjetas / stats / badges
   --------------------------------------------------------------------- */
.tarjeta {
    background: #fff;
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: .8rem;
    box-shadow: 0 1px 3px rgba(22,48,98,.08);
}

.tarjeta-stat { border-radius: 14px; color: #fff; padding: .9rem 1rem; }
.tarjeta-stat.navy { background: var(--navy); }
.tarjeta-stat.teal { background: var(--teal); }
.tarjeta-stat.danger { background: #c0392b; }
.tarjeta-stat .valor { font-size: 1.4rem; font-weight: 800; }
.tarjeta-stat .etiqueta { font-size: .75rem; opacity: .9; }

.badge {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}

.badge-pendiente { background: #8a94a6; }
.badge-confirmado { background: var(--teal); }
.badge-surtido { background: #d78a1e; }
.badge-entregado { background: #1f9d55; }
.badge-cancelado { background: #c0392b; }

.alerta {
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alerta-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c2bd; }
.alerta-ok { background: #e6f6ec; color: #1f7a44; border: 1px solid #b9e3c6; }

.lista-menu { background: #fff; border-radius: 10px; overflow: hidden; }
.lista-menu a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--bg);
    text-decoration: none;
    color: var(--texto);
    font-weight: 600;
}
.lista-menu a:last-child { border-bottom: none; }

@media print {
    .franja-info, .barra-modulo, .no-print { display: none !important; }
    body { padding-bottom: 0 !important; background: #fff; }
}

/* Quita las flechitas nativas de <input type="number"> cuando ya tenemos
   nuestros propios botones -/+ al lado (ej. lista de productos al armar
   un pedido), para que se vea igual que los contadores del carrito. */
.sin-flechas::-webkit-inner-spin-button,
.sin-flechas::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sin-flechas {
    -moz-appearance: textfield;
}

/* Miniatura de foto en listas (Productos, lista de precios, bajo stock).
   Tamaño chico a propósito: se usa sobre todo desde celular y no debe
   estirar las filas de la lista. */
.foto-mini {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid var(--borde);
}

.foto-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--texto-suave);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Foto grande dentro del formulario de producto (no en listas). */
.foto-grande {
    max-width: 220px;
    max-height: 220px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--borde);
}

/* Lightbox: overlay de pantalla completa para ver la foto en grande.
   Se abre agregando la clase .activo (ver includes/lightbox.php) y se
   cierra dándole click a cualquier parte del overlay. */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 34, 71, 0.92);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-out;
}
.lightbox-overlay.activo {
    display: flex;
}
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
