/* ─── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #2563eb;
    --primary-h: #1d4ed8;
    --danger:    #dc2626;
    --success:   #16a34a;
    --bg:        #f8fafc;
    --surface:   #ffffff;
    --border:    #e2e8f0;
    --text:      #1e293b;
    --muted:     #64748b;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ─── Botones ───────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}
.btn-primary:hover   { background: var(--primary-h); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }

.btn-secundario {
    display: inline-block;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 9px 22px;
    border-radius: var(--radius);
    font-size: .9rem;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.btn-secundario:hover { background: var(--danger); color: #fff; }

.btn-block { width: 100%; text-align: center; margin-top: 10px; }

/* ─── Header ────────────────────────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: 1200px;
    margin: auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
nav { flex: 1; display: flex; gap: 20px; }
nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    transition: color .2s;
}
nav a:hover { color: var(--primary); }

.carrito-btn {
    position: relative;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: .95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .2s;
    white-space: nowrap;
}
.carrito-btn:hover { background: var(--primary-h); }

.badge {
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: .7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ─── Hero ──────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    text-align: center;
    padding: 52px 24px;
}
.hero h1 { font-size: 2.2rem; max-width: 640px; margin: 0 auto 12px; }
.hero p  { font-size: 1.1rem; opacity: .85; margin-bottom: 0; }

/* ─── Oculto genérico (páginas) ───────────────────────────────────── */
#pagina-inicio.oculto,
#pagina-productos.oculto,
#pagina-carrito.oculto,
#pagina-detalle.oculto { display: none !important; }

/* ─── Sección Destacados ─────────────────────────────────────────── */
.seccion-destacados {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 0 24px;
}
.seccion-destacados h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
}
.grid-destacados {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}
.ver-todos-wrap {
    text-align: center;
    margin-top: 32px;
}

/* ─── Sobre nosotros ─────────────────────────────────────────────── */
.seccion-nosotros {
    background: var(--surface);
    padding: 56px 24px;
    margin-top: 56px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.nosotros-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.nosotros-inner > h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.nosotros-inner > p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 36px;
}
.nosotros-valores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
}
.valor-item {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.valor-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}
.valor-icono img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}
.valor-item h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text);
}
.valor-item p {
    font-size: .9rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ─── Reseñas ────────────────────────────────────────────────────── */
.seccion-resenas {
    max-width: 1000px;
    margin: 56px auto;
    padding: 0 24px;
    text-align: center;
}
.seccion-resenas h2 {
    font-size: 1.5rem;
    margin-bottom: 28px;
}
.grid-resenas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.resena-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
    box-shadow: var(--shadow);
}
.resena-estrellas {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-bottom: 10px;
}
.resena-texto {
    font-size: .95rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 12px;
    font-style: italic;
}
.resena-autor {
    font-size: .85rem;
    color: var(--muted);
    font-weight: 600;
}

/* ─── Botón volver ───────────────────────────────────────────────── */
.btn-volver {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.btn-volver:hover { background: var(--primary); color: #fff; }

/* ─── Botones del header ─────────────────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cuenta-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
    max-width: 200px;
}
.cuenta-btn span { overflow: hidden; text-overflow: ellipsis; max-width: 140px; white-space: nowrap; }
.cuenta-btn:hover { background: var(--primary); color: #fff; }

/* ─── Modal cuenta ───────────────────────────────────────────────── */
.modal-cuenta-contenido {
    max-width: 460px;
}

.cuenta-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 22px;
}

.cuenta-tab {
    flex: 1;
    background: var(--bg);
    border: none;
    padding: 10px 0;
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
    transition: background .2s, color .2s;
}
.cuenta-tab.activo {
    background: var(--primary);
    color: #fff;
}

.cuenta-switch {
    text-align: center;
    font-size: .85rem;
    color: var(--muted);
    margin-top: 14px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-icon-text {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: .85rem;
    cursor: pointer;
    color: var(--muted);
    transition: border-color .2s, color .2s;
}
.btn-icon-text:hover { border-color: var(--primary); color: var(--primary); }

.pedidos-estado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    max-height: 54vh;
    overflow-y: auto;
    padding-right: 4px;
}

.pedido-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.pedido-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.pedido-ref {
    font-weight: 700;
}

.pedido-meta,
.pedido-direccion,
.pedido-items {
    color: var(--muted);
    font-size: .9rem;
}

.pedido-total {
    margin-bottom: 8px;
}

.pedido-direccion {
    margin-bottom: 12px;
}

.pedido-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.estado-badge,
.estado-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.estado-select {
    appearance: none;
    background: var(--surface);
    cursor: pointer;
}

.estado-select:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.estado-pendiente {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.estado-preparando {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

.estado-enviado {
    background: #ccfbf1;
    color: #0f766e;
    border-color: #5eead4;
}

.estado-entregado {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.estado-cancelado {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

/* ─── Badges de estado para pedidos de compra ───────────────────────── */
.estado-compra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    border: 1px solid transparent;
    letter-spacing: .03em;
    text-transform: capitalize;
}

.estado-compra-borrador  { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.estado-compra-enviado   { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.estado-compra-recibido  { background: #dcfce7; color: #166534; border-color: #86efac; }
.estado-compra-cancelado { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* ─── Fila añadir artículo compra ───────────────────────────────────── */
.fila-agregar-item {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}

.fila-agregar-item select {
    flex: 2;
    min-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    background: var(--surface);
    cursor: pointer;
}

.fila-agregar-item input {
    flex: 1;
    min-width: 100px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    background: var(--surface);
}

.fila-agregar-item input[type="number"] {
    flex: 0 0 80px;
    min-width: 60px;
    text-align: right;
}

.input-cantidad-compra {
    width: 76px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .88rem;
    text-align: right;
    background: var(--surface);
}

/* ─── Botón peligro (rojo) ──────────────────────────────────────────── */
.btn-peligro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, opacity .18s;
    background: #ef4444;
    color: #fff;
}
.btn-peligro:hover { background: #dc2626; }

/* ─── Filtros ───────────────────────────────────────────────────────── */
.filtros {
    max-width: 1200px;
    margin: 28px auto 0;
    padding: 0 24px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
#buscador {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}
#buscador:focus { border-color: var(--primary); }

.orden-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

#ordenar-por {
    min-width: 190px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    outline: none;
    background: var(--surface);
    transition: border-color .2s;
}

#ordenar-por:focus {
    border-color: var(--primary);
}

.btn-orden {
    min-width: 72px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    transition: all .2s;
}

.btn-orden:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-orden:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.categorias { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: .85rem;
    transition: all .2s;
}
.cat-btn:hover, .cat-btn.activo {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ─── Catálogo ──────────────────────────────────────────────────────── */
.catalogo {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 24px;
}
.catalogo h2 { font-size: 1.4rem; margin-bottom: 20px; }

.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}

.tarjeta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.tarjeta:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.tarjeta-media {
    position: relative;
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
}

.tarjeta-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tarjeta-imagen-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: .02em;
}

.tarjeta-galeria {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, .8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}

.tarjeta-categoria {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--primary);
}
.tarjeta h3 { font-size: 1rem; flex: 1; }
.tarjeta p  { font-size: .85rem; color: var(--muted); flex: 1; }
.tarjeta-precio { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.tarjeta-stock  { font-size: .8rem; color: var(--success); }
.tarjeta-stock.sin-stock { color: var(--danger); }

.cargando { color: var(--muted); font-style: italic; }

/* ─── Página Detalle Producto ────────────────────────────────────────── */
#pagina-detalle { background: var(--bg); min-height: 100vh; }

.detalle-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 64px;
}

.detalle-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 20px;
}
@media (max-width: 700px) {
    .detalle-layout { grid-template-columns: 1fr; gap: 24px; }
}

/* Galería */
.detalle-img-principal-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}
.detalle-img-principal {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detalle-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.detalle-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .75;
    transition: opacity .15s, border-color .15s;
}
.detalle-thumb:hover { opacity: 1; }
.detalle-thumb.activa { border-color: var(--primary); opacity: 1; }
.detalle-sin-imagen {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: #f1f5f9;
    border-radius: var(--radius);
}

/* Info */
.detalle-info { display: flex; flex-direction: column; gap: 14px; }
.detalle-info h1 { font-size: 1.4rem; line-height: 1.3; margin: 0; }
.detalle-descripcion { color: var(--muted); font-size: .95rem; line-height: 1.6; margin: 0; }
.detalle-precio-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detalle-precio { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.detalle-btn-carrito { font-size: 1rem; padding: 12px 28px; margin-top: 4px; }

/* Recomendados */
.detalle-recomendados-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 48px 0 20px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

/* ─── Página Carrito (full page) ─────────────────────────────────────── */
.pagina-carrito {
    min-height: 100vh;
    background: var(--bg, #f5f5f5);
    padding: 24px 16px 48px;
    box-sizing: border-box;
}

.carrito-page-inner {
    max-width: 860px;
    margin: 0 auto;
}

.carrito-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.carrito-page-header h2 {
    flex: 1;
    font-size: 1.5rem;
    margin: 0;
}
.carrito-page-header .btn-sm {
    margin-left: auto;
}

/* ── Columnas de la tabla ── */
.carrito-tabla-header,
.item-carrito {
    display: grid;
    grid-template-columns: 1fr 90px 140px 90px 44px;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

.carrito-tabla-header {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted, #888);
    border-bottom: 2px solid var(--border, #e0e0e0);
    margin-bottom: 4px;
}

/* ── Lista de items ── */
.carrito-lista {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.item-carrito {
    border-bottom: 1px solid var(--border, #e0e0e0);
    font-size: .92rem;
    transition: background .15s;
}
.item-carrito:hover { background: rgba(0,0,0,.02); }

.ct-producto { display: flex; flex-direction: column; gap: 2px; }
.ct-producto strong { font-weight: 600; font-size: .95rem; }
.item-precio-unit { font-size: .78rem; color: var(--muted, #888); }

.ct-precio,
.ct-subtotal {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}
.ct-subtotal { color: var(--primary, #1a73e8); }

.ct-cantidad {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border, #ccc);
    background: var(--surface, #fff);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text, #333);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    padding: 0;
    flex-shrink: 0;
}
.qty-btn:hover {
    background: var(--primary, #1a73e8);
    color: #fff;
    border-color: var(--primary, #1a73e8);
}

.qty-input {
    width: 44px;
    text-align: center;
    border: 1px solid var(--border, #ccc);
    border-radius: 6px;
    padding: 4px 2px;
    font-size: .9rem;
    font-family: inherit;
    -moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: 2px solid var(--primary, #1a73e8); border-color: transparent; }

.ct-accion { display: flex; justify-content: center; }
.item-carrito .quitar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--muted, #aaa);
    padding: 4px;
    border-radius: 6px;
    transition: color .15s, background .15s;
    line-height: 1;
}
.item-carrito .quitar:hover { color: var(--danger, #e53935); background: rgba(229,57,53,.08); }

/* ── Estado vacío ── */
.carrito-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--muted, #888);
    text-align: center;
}
.carrito-vacio span { font-size: 3rem; }
.carrito-vacio p { font-size: 1.05rem; margin: 0; }

/* ── Resumen / totales ── */
.carrito-resumen {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    border-top: 2px solid var(--border, #e0e0e0);
    padding-top: 20px;
}

.carrito-resumen-lineas {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
    width: 100%;
    max-width: 340px;
}

.carrito-resumen-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .92rem;
    color: var(--muted, #666);
}

.carrito-total-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text, #222);
    border-top: 1px solid var(--border, #e0e0e0);
    padding-top: 12px;
    margin-top: 4px;
}

.carrito-resumen-acciones {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
    width: 100%;
    max-width: 340px;
}

/* ── Botones tamaño ── */
.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius, 8px);
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .1s;
}
.btn-lg:hover { opacity: .9; transform: translateY(-1px); }
.btn-lg:active { transform: translateY(0); }

.btn-sm {
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 500;
    border-radius: var(--radius, 8px);
    cursor: pointer;
    border: 1px solid var(--border, #ccc);
    background: var(--surface, #fff);
    color: var(--text, #333);
    transition: background .15s, border-color .15s;
}
.btn-sm:hover { background: var(--bg, #f5f5f5); border-color: var(--muted, #aaa); }

/* ─── Cerrar btn genérico ─────────────────────────────────────────────── */
.cerrar-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    transition: color .2s;
}
.cerrar-btn:hover { color: var(--danger); }

/* ─── Modal ─────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.5);
    padding: 20px;
}
.modal.oculto { display: none; }

.modal-contenido {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
.modal-contenido .cerrar-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}
.modal-contenido h2 { margin-bottom: 20px; }

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
legend {
    font-weight: 600;
    font-size: .9rem;
    padding: 0 6px;
    color: var(--primary);
}
label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .88rem;
    font-weight: 500;
    margin-bottom: 12px;
}
label input,
label select {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .95rem;
    outline: none;
    background: var(--surface);
    transition: border-color .2s;
}
label input:focus,
label select:focus { border-color: var(--primary); }

.checkbox-label {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 0;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.checkbox-label .campo-descripcion {
    display: block;
    width: 100%;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 400;
    margin-left: 26px;
}

.campo-ayuda {
    color: var(--muted);
    font-size: .82rem;
    margin: -4px 0 12px;
}

.resumen-pedido {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.resumen-pedido h4 { margin-bottom: 8px; }
.resumen-pedido ul { list-style: none; font-size: .88rem; }
.resumen-pedido li { display: flex; justify-content: space-between; padding: 3px 0; }

.checkout-help {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: .88rem;
    margin-bottom: 16px;
}

/* ─── Confirmación ──────────────────────────────────────────────────── */
.confirmacion {
    text-align: center;
    padding: 48px 32px;
}
.icono-ok { font-size: 4rem; margin-bottom: 12px; }
.confirmacion p { color: var(--muted); margin: 6px 0; }

/* ─── Contacto & Footer ─────────────────────────────────────────────── */
.contacto {
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 40px 24px;
}
.contacto h2 { margin-bottom: 10px; }
.contacto p  { color: var(--muted); }

footer {
    background: var(--text);
    color: #94a3b8;
    text-align: center;
    padding: 18px;
    font-size: .85rem;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.5rem; }
    .header-inner { flex-wrap: wrap; }
    nav { order: 3; width: 100%; }
    .carrito-tabla-header,
    .item-carrito { grid-template-columns: 1fr 80px 120px 80px 36px; }
    .cuenta-btn { max-width: 130px; font-size: .82rem; }
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ADMIN
═══════════════════════════════════════════════════════════════════════ */

/* Tag email en header admin */
.admin-tag {
    font-size: .85rem;
    color: var(--muted);
}

/* ─── Login overlay ──────────────────────────────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.login-card h2 { text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: .9rem; }
.error-msg   { color: var(--danger); font-size: .88rem; margin-top: -4px; }
.success-msg { color: #2e7d32; background: #e8f5e9; border-radius: 6px; padding: 8px 12px; font-size: .88rem; margin-top: 8px; }

/* ─── Toast carrito ──────────────────────────────────────────────────────── */
#toast-carrito {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    border-radius: 14px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 420px;
    width: calc(100vw - 40px);
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    z-index: 9999;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    font-size: .9rem;
}
#toast-carrito.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
#toast-carrito p {
    margin: 0 0 12px;
    line-height: 1.4;
    font-size: .88rem;
    color: #cbd5e1;
}
#toast-carrito p strong { color: #fff; }
.toast-carrito-acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.toast-carrito-acciones button {
    flex: 1;
    min-width: 90px;
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s;
}
.toast-carrito-acciones button:hover { filter: brightness(1.12); }
.toast-btn-mas    { background: #3b82f6; color: #fff; }
.toast-btn-pedido { background: #22c55e; color: #fff; }
.toast-btn-seguir { background: #334155; color: #e2e8f0; }

/* ─── Admin body / layout ────────────────────────────────────────────── */
.admin-body { background: var(--bg); }

.admin-section {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
}
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-section-header h2 { font-size: 1.3rem; }

.badge-pendientes {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    padding: .25rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-pendientes::before { content: "⏳"; }

.admin-section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-section-actions .btn-secundario {
    color: var(--primary);
    border-color: var(--primary);
}

.admin-section-actions .btn-secundario:hover {
    background: var(--primary);
    color: #fff;
}

/* ─── Tabla admin ────────────────────────────────────────────────────── */
.tabla-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.admin-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.admin-tabla th {
    background: #f1f5f9;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-tabla td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-tabla tr:last-child td { border-bottom: none; }
.admin-tabla tr:hover td { background: #f8fafc; }

.acciones {
    display: flex;
    gap: 6px;
    white-space: nowrap;
    position: sticky;
    right: 0;
    background: var(--surface);
    z-index: 1;
}

/* Cabecera de la columna acciones también sticky */
.admin-tabla th:last-child {
    position: sticky;
    right: 0;
    background: #f1f5f9;
    z-index: 2;
}

/* Sombra sutil para separar la columna pegada */
.admin-tabla td:last-child,
.admin-tabla th:last-child {
    box-shadow: -3px 0 6px rgba(0,0,0,.06);
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background .15s;
}
.btn-icon:hover        { background: #e2e8f0; }
.btn-icon.btn-danger:hover { background: #fee2e2; }

.btn-preparar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #c2410c;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.btn-preparar:hover {
    background: #ffedd5;
}

.stock-ok  { color: var(--success); font-weight: 600; }
.stock-bajo { color: var(--danger);  font-weight: 600; }

.items-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: .83rem;
}

.tabla-subtexto {
    color: var(--muted);
    font-size: .82rem;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabla-vacio {
    color: var(--muted);
}

.tabla-numero {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.descripcion-celda {
    min-width: 220px;
    max-width: 320px;
    color: var(--muted);
}

.codigo-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
}

.imagenes-resumen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

.imagenes-resumen.con-imagenes {
    background: #dcfce7;
    color: #166534;
}

.imagenes-resumen.sin-imagenes {
    background: #e2e8f0;
    color: #475569;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.producto-imagenes-field {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    background: #f8fafc;
}

.imagenes-field-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.imagenes-field-head span,
.imagenes-ayuda {
    font-size: .82rem;
    color: var(--muted);
}

.input-file {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
    margin-bottom: 10px;
}

.imagenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.imagen-card,
.imagen-card-vacia {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.imagen-card-nueva {
    border-color: #bfdbfe;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .08);
}

.imagen-card-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.imagen-card-footer {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.imagen-card-tag {
    font-size: .75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.imagen-card-vacia {
    padding: 16px;
    color: var(--muted);
    font-size: .85rem;
    border-style: dashed;
}

/* ─── Panel de filtros productos ─────────────────────────────────────── */
.filtros-panel {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px 12px;
    margin-bottom: 14px;
}

.filtros-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filtro-grupo label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.filtro-grupo input,
.filtro-grupo select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: .9rem;
    color: var(--text);
    outline: none;
    transition: border-color .2s;
}

.filtro-grupo input:focus,
.filtro-grupo select:focus {
    border-color: var(--primary);
}

.filtro-grupo-lg  { flex: 1 1 260px; }
.filtro-grupo-sm  { flex: 0 0 130px; }
.filtro-grupo-accion { align-self: flex-end; }

.filtros-resumen {
    margin-top: 8px;
    font-size: .82rem;
    color: var(--primary);
    font-weight: 600;
    min-height: 16px;
}

#btn-toggle-filtros-productos.activo {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ─── Ocultar columna ID por defecto ────────────────────────────────── */
#tabla-productos th:nth-child(1),
#tabla-productos td:nth-child(1) { display: none; }

/* ─── Clases para mostrar/ocultar columnas ──────────────────────────── */
#tabla-productos.hide-col-id       th:nth-child(1),  #tabla-productos.hide-col-id       td:nth-child(1)  { display: none; }
#tabla-productos.hide-col-codigo   th:nth-child(2),  #tabla-productos.hide-col-codigo   td:nth-child(2)  { display: none; }
#tabla-productos.hide-col-referencia th:nth-child(3),#tabla-productos.hide-col-referencia td:nth-child(3){ display: none; }
#tabla-productos.hide-col-nombre   th:nth-child(4),  #tabla-productos.hide-col-nombre   td:nth-child(4)  { display: none; }
#tabla-productos.hide-col-descripcion th:nth-child(5),#tabla-productos.hide-col-descripcion td:nth-child(5){ display: none; }
#tabla-productos.hide-col-cr       th:nth-child(6),  #tabla-productos.hide-col-cr       td:nth-child(6)  { display: none; }
#tabla-productos.hide-col-categoria th:nth-child(7), #tabla-productos.hide-col-categoria td:nth-child(7) { display: none; }
#tabla-productos.hide-col-precio   th:nth-child(8),  #tabla-productos.hide-col-precio   td:nth-child(8)  { display: none; }
#tabla-productos.hide-col-neto     th:nth-child(9),  #tabla-productos.hide-col-neto     td:nth-child(9)  { display: none; }
#tabla-productos.hide-col-iva      th:nth-child(10), #tabla-productos.hide-col-iva      td:nth-child(10) { display: none; }
#tabla-productos.hide-col-total    th:nth-child(11), #tabla-productos.hide-col-total    td:nth-child(11) { display: none; }
#tabla-productos.hide-col-compra   th:nth-child(12), #tabla-productos.hide-col-compra   td:nth-child(12) { display: none; }
#tabla-productos.hide-col-venta    th:nth-child(13), #tabla-productos.hide-col-venta    td:nth-child(13) { display: none; }
#tabla-productos.hide-col-stock    th:nth-child(14), #tabla-productos.hide-col-stock    td:nth-child(14) { display: none; }
#tabla-productos.hide-col-ubicacion th:nth-child(15),#tabla-productos.hide-col-ubicacion td:nth-child(15){ display: none; }
#tabla-productos.hide-col-imagenes th:nth-child(16), #tabla-productos.hide-col-imagenes td:nth-child(16) { display: none; }
#tabla-productos.hide-col-destacado th:nth-child(17),#tabla-productos.hide-col-destacado td:nth-child(17){ display: none; }

/* Cuando el ID está visible (sin la clase hide) */
#tabla-productos:not(.hide-col-id) th:nth-child(1),
#tabla-productos:not(.hide-col-id) td:nth-child(1) { display: table-cell; }

/* ─── Estilos selector de columnas ──────────────────────────────────── */
.filtros-separador {
    margin: 12px 0 10px;
    border: none;
    border-top: 1px solid var(--border);
}

.filtros-columnas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.filtros-columnas-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.filtros-columnas label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .85rem;
    cursor: pointer;
    user-select: none;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background .15s, border-color .15s;
}

.filtros-columnas label:hover {
    background: #eff6ff;
    border-color: var(--primary);
}

.filtros-columnas input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ─── Anchos mínimos de columnas (sin tocar display) ────────────────── */
#tabla-productos {
    min-width: 1500px;
}

#tabla-productos th:nth-child(2), #tabla-productos td:nth-child(2) { min-width: 90px; }
#tabla-productos th:nth-child(3), #tabla-productos td:nth-child(3) { min-width: 90px; }
#tabla-productos th:nth-child(4), #tabla-productos td:nth-child(4) { min-width: 170px; max-width: 220px; }
#tabla-productos th:nth-child(5), #tabla-productos td:nth-child(5) { min-width: 160px; max-width: 200px; }
#tabla-productos th:nth-child(6),  #tabla-productos td:nth-child(6),
#tabla-productos th:nth-child(7),  #tabla-productos td:nth-child(7),
#tabla-productos th:nth-child(8),  #tabla-productos td:nth-child(8),
#tabla-productos th:nth-child(9),  #tabla-productos td:nth-child(9),
#tabla-productos th:nth-child(10), #tabla-productos td:nth-child(10),
#tabla-productos th:nth-child(11), #tabla-productos td:nth-child(11),
#tabla-productos th:nth-child(12), #tabla-productos td:nth-child(12),
#tabla-productos th:nth-child(13), #tabla-productos td:nth-child(13) { white-space: nowrap; }
#tabla-productos th:nth-child(14), #tabla-productos td:nth-child(14) { white-space: nowrap; min-width: 80px; }
#tabla-productos th:nth-child(15), #tabla-productos td:nth-child(15) { white-space: nowrap; min-width: 90px; }
#tabla-productos th:nth-child(16), #tabla-productos td:nth-child(16) { white-space: nowrap; min-width: 70px; text-align: center; }
#tabla-productos th:nth-child(17), #tabla-productos td:nth-child(17) { width: 36px; text-align: center; }

#tabla-productos td:nth-child(4) strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

/* ─── Pill de ubicación en tabla productos ────────────────────────── */
.ubicacion-pill {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1px 8px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Picking modal ──────────────────────────────────────────────── */
.picking-modal-contenido {
    max-width: 560px;
    text-align: center;
}

.picking-progreso {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.picking-progreso-barra-bg {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.picking-progreso-barra {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width .3s;
}

.picking-progreso-texto {
    font-size: .85rem;
    color: var(--muted);
    white-space: nowrap;
}

.picking-ubicacion {
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    padding: .5rem 2rem;
    margin: .5rem 0 1rem;
    letter-spacing: .05em;
    min-width: 140px;
}

.picking-ubicacion.sin-ubicacion {
    background: var(--muted);
    font-size: 1.2rem;
}

.picking-producto-nombre {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: .25rem;
}

.picking-codigo-ref {
    font-size: .9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.picking-cantidad-requerida {
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.picking-cantidad-requerida strong {
    font-size: 1.5rem;
    color: var(--primary);
}

.picking-inputs {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    text-align: left;
    margin-bottom: .5rem;
}

.picking-input-grupo label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .25rem;
}

.picking-input-grupo input {
    width: 100%;
    font-size: 1.1rem;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.picking-botones {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: .75rem;
}

.picking-fin-icono {
    font-size: 3rem;
    margin: 1rem 0 .5rem;
}

.picking-fin-resumen {
    font-size: 1rem;
    line-height: 1.8;
}

/* Embalaje + peso en pantalla final de picking */
.picking-embalaje-wrap {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.picking-embalaje-fila {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.picking-embalaje-fila label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--muted);
}
.picking-embalaje-fila select,
.picking-embalaje-fila input  { font-size: .95rem; }
.picking-embalaje-dims {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .88rem;
    color: #1e40af;
    font-weight: 600;
}

/* ─── Configuración TPV ─────────────────────────────────────────────────── */
.config-tpv-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 680px;
    padding: 28px 32px;
}

.config-tpv-bloque {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.config-tpv-bloque:last-of-type { border-bottom: none; margin-bottom: 0; }
.config-tpv-bloque h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 14px;
}

.config-tpv-ayuda {
    font-size: .83rem;
    color: var(--muted);
    margin: 0 0 12px;
    line-height: 1.5;
}
.config-tpv-ayuda code {
    background: rgba(0,0,0,.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .82rem;
    word-break: break-all;
}

.config-tpv-toggle {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}
.config-tpv-toggle input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.toggle-label { font-size: .93rem; }

/* Input con botón ojo para clave */
.input-con-ojo {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.input-con-ojo input { flex: 1; }
.btn-ojo {
    padding: 0 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted);
    transition: background .15s, color .15s;
}
.btn-ojo:hover { background: var(--bg); color: var(--text); }

.config-tpv-acciones {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.config-tpv-msg {
    font-size: .9rem;
    padding: 8px 14px;
    border-radius: 6px;
    flex: 1;
}
.config-tpv-msg-ok    { background: #e8f5e9; color: #2e7d32; }
.config-tpv-msg-error { background: #fdecea; color: #b71c1c; }
