/* ============================================================
   SATFIBRA · PÁGINAS PÚBLICAS DEL CATÁLOGO
   ============================================================ */

:root {
    --bg-primary:   #0a0f1d;
    --bg-secondary: #111827;
    --bg-card:      #1a2332;
    --border-color: #1f2937;
    --border-live:  #2b3a52;

    --accent-blue:  #2563eb;
    --accent-green: #10b981;
    --accent-cyan:  #06b6d4;
    --accent-amber: #f59e0b;
    --accent-red:   #ef4444;

    --text-main:  #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim:   #6b7280;

    --radio: 12px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-radius: 4px; }

/* ---------- Barra superior ---------- */

.barra {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 15, 29, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.barra-interior {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo { font-size: 1.35rem; font-weight: 900; letter-spacing: -0.02em; }
.logo span { color: var(--accent-blue); }

.barra-nav {
    display: flex;
    gap: 1.5rem;
    margin-left: auto;
    font-size: 0.93rem;
    font-weight: 500;
}
.barra-nav a { color: var(--text-muted); transition: color 0.2s; }
.barra-nav a:hover, .barra-nav a.activo { color: var(--text-main); }
.barra-nav a.activo { font-weight: 600; }

.boton-pedido {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-blue);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.boton-pedido:hover { background: #1d4ed8; }

.boton-pedido .contador {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

/* ---------- Estructura ---------- */

.contenido {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.titulo-pagina { margin-bottom: 1.75rem; }
.titulo-pagina h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}
.titulo-pagina p { color: var(--text-muted); font-size: 0.97rem; margin-top: 0.25rem; }

.migas {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.migas a:hover { color: var(--text-main); }
.migas span { margin: 0 0.4rem; }

.disposicion {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ---------- Barra de categorías ---------- */

.panel-lateral {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radio);
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.panel-lateral h2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dim);
    padding: 1rem 1.15rem 0.75rem;
}

.lista-categorias { display: flex; flex-direction: column; }

.lista-categorias a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: background 0.18s, color 0.18s;
    border-left: 3px solid transparent;
}
.lista-categorias a:hover { background: rgba(37, 99, 235, 0.07); color: var(--text-main); }
.lista-categorias a.activo {
    background: rgba(37, 99, 235, 0.12);
    border-left-color: var(--accent-blue);
    color: var(--text-main);
    font-weight: 600;
}
.lista-categorias .cantidad {
    font-size: 0.76rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

/* ---------- Buscador ---------- */

.herramientas-catalogo {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.buscador { display: flex; gap: 0.5rem; flex: 1; min-width: 240px; }

.buscador input[type="search"] {
    flex: 1;
    padding: 0.62rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-live);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
}
.buscador input::placeholder { color: var(--text-dim); }
.buscador input:focus { outline: none; border-color: var(--accent-blue); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.62rem 1.1rem;
    background: var(--accent-blue);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn:hover { background: #1d4ed8; }

.btn-borde {
    background: transparent;
    border-color: var(--border-live);
    color: var(--text-muted);
}
.btn-borde:hover { background: var(--bg-card); color: var(--text-main); }

.btn-verde { background: var(--accent-green); }
.btn-verde:hover { background: #059669; }

.btn-ancho { width: 100%; }

.conteo { color: var(--text-muted); font-size: 0.87rem; }

/* ---------- Grilla de productos ---------- */

.grilla {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.ficha {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radio);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.22s, transform 0.22s;
}
.ficha:hover { border-color: var(--accent-blue); transform: translateY(-3px); }

.ficha .foto {
    position: relative;
    height: 170px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    overflow: hidden;
    cursor: zoom-in;
}
.ficha .foto img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}
.ficha:hover .foto img { transform: scale(1.12); }

.ficha .foto .sin-foto { color: var(--text-dim); font-size: 0.82rem; }

.ficha .foto .lupa {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 15, 29, 0.8);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.22s;
    pointer-events: none;
}
.ficha:hover .foto .lupa { opacity: 1; }

.ficha .datos {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.ficha .precio {
    color: var(--accent-green);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.ficha .a-consultar {
    color: var(--accent-cyan);
    font-size: 0.95rem;
    font-weight: 600;
}

.ficha h3 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}
.ficha h3 a:hover { color: var(--accent-blue); }

.ficha .marca {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ficha .resumen {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.ficha .pie-ficha {
    margin-top: auto;
    padding-top: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    border-top: 1px solid var(--border-color);
}

.ficha .codigo {
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--text-dim);
}

.ficha .agregar {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 7px;
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: #93c5fd;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.ficha .agregar:hover { background: var(--accent-blue); color: #fff; }
.ficha .agregar.puesto { background: var(--accent-green); border-color: var(--accent-green); color: #fff; }

/* ---------- Estado ---------- */

.estado {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
    align-self: flex-start;
}
.estado.verde { color: #6ee7b7; border-color: rgba(16,185,129,.5); background: rgba(16,185,129,.1); }
.estado.gris  { color: var(--text-muted); border-color: var(--border-live); }
.estado.ambar { color: #fcd34d; border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.1); }
.estado.rojo  { color: #fca5a5; border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.1); }

/* ---------- Vacío ---------- */

.vacio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radio);
}
.vacio strong { display: block; color: var(--text-main); font-size: 1.05rem; margin-bottom: 0.4rem; }

/* ---------- Paginado ---------- */

.paginado {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.paginado a, .paginado span {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border-live);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.87rem;
    font-variant-numeric: tabular-nums;
}
.paginado a:hover { color: var(--text-main); border-color: var(--accent-blue); }
.paginado .actual { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; font-weight: 600; }

/* ---------- Ficha de producto ---------- */

.producto {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.galeria .principal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radio);
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-in;
    position: relative;
}
.galeria .principal img { max-width: 100%; max-height: 100%; object-fit: contain; }

.galeria .tiras {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.galeria .tiras button {
    width: 68px; height: 68px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.3rem;
    cursor: pointer;
}
.galeria .tiras button.activa { border-color: var(--accent-blue); }
.galeria .tiras img { width: 100%; height: 100%; object-fit: contain; }

.detalle h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.detalle .meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}
.detalle .meta .mono { font-family: var(--mono); }

.detalle .precio-grande {
    color: var(--accent-green);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}
.detalle .precio-nota { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 1.5rem; }

.detalle .descripcion {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 1.5rem;
}

.compra {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radio);
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.compra label { color: var(--text-muted); font-size: 0.88rem; }
.compra input[type="number"] {
    width: 90px;
    padding: 0.55rem 0.7rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-live);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}
.compra .btn { flex: 1; min-width: 180px; }

.tabla-especificaciones {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radio);
    overflow: hidden;
}
.tabla-especificaciones td {
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.tabla-especificaciones tr:last-child td { border-bottom: none; }
.tabla-especificaciones td:first-child {
    color: var(--text-muted);
    width: 40%;
    font-weight: 500;
}
.tabla-especificaciones tr:nth-child(odd) { background: rgba(255,255,255,0.015); }

.seccion-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
}

/* ---------- Visor de fotos ---------- */

.visor {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 8, 16, 0.93);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 4rem;
    cursor: zoom-out;
}
.visor.abierto { display: flex; }
.visor img {
    max-width: min(1000px, 93vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
}
.visor-pie {
    position: absolute;
    bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    max-width: 90vw;
    padding: 0 1.5rem;
}
.visor-cerrar {
    position: absolute;
    top: 1rem; right: 1.25rem;
    width: 42px; height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
}
.visor-cerrar:hover { border-color: var(--accent-blue); }

/* ---------- Aviso flotante ---------- */

.brindis {
    position: fixed;
    bottom: 1.5rem; left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: var(--accent-green);
    color: #04241a;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9998;
}
.brindis.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Pie ---------- */

.pie {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}
.pie-interior {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.pie h4 { color: var(--text-main); font-size: 0.92rem; margin-bottom: 0.6rem; }
.pie a:hover { color: var(--text-main); }
.pie-abajo {
    border-top: 1px solid var(--border-color);
    padding: 1.1rem 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .disposicion { grid-template-columns: 1fr; }
    .panel-lateral { position: static; }
    .lista-categorias { flex-direction: row; overflow-x: auto; }
    .lista-categorias a {
        border-top: none;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    .lista-categorias a.activo { border-left: none; border-bottom-color: var(--accent-blue); }
    .producto { grid-template-columns: 1fr; gap: 1.5rem; }
    .galeria .principal { height: 300px; }
    .pie-interior { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .barra-interior { flex-wrap: wrap; gap: 0.75rem; }
    .barra-nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; gap: 0.75rem; }
    .titulo-pagina h1 { font-size: 1.5rem; }
    .grilla { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
    .ficha .foto { height: 130px; }
    .detalle h1 { font-size: 1.35rem; }
    .detalle .precio-grande { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    .ficha:hover .foto img { transform: none; }
}
