/* css/pro.css — Select SAS UI profesional (liviano, sin frameworks) */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400&family=Poppins:wght@500;600;700;800&display=swap');

:root {
    --burgundy: #7a1f2e;
    --burgundy-deep: #4a0f18;
    --ink: #0c0a09;
    --ink-soft: #1c1917;
    --mist: #f4f4f5;
    --paper: #ffffff;
    --muted: #71717a;
    --borde: #e4e4e7;
    --verde: #15803d;
    --slate: #3f3f46;
    --rojo: #b91c1c;
    --radius: 14px;
    --dock-h: 68px;
    --header-h: 52px;
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.pro {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--mist);
    color: var(--ink);
    text-align: left;
    min-height: 100vh;
    padding-bottom: calc(var(--dock-h) + 24px);
}

body.pro.no-dock { padding-bottom: 0; }

h1, h2, h3, h4, .pro-title, .section-label, .kpi-value, .prod-card h4, .quick-link strong {
    font-family: var(--font-display);
}

/* —— Header slim —— */
.pro-header {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--header-h);
    background: rgba(12, 10, 9, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(122, 31, 46, 0.45);
    display: flex;
    align-items: center;
}

.pro-header-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pro-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pro-brand img {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    display: none;
}

.pro-brand img.is-on {
    display: block !important;
    visibility: visible !important;
}

.pro-brand .brand-text span { color: #f87171; }

/* Con logo activo: ocultar texto SELECT S.A.S. */
.pro-brand.has-logo .brand-text { display: none !important; }

.pro-header-meta {
    font-size: 12px;
    color: #a1a1aa;
    font-weight: 500;
}

/* Enlaces a las 4 superficies (barra superior) */
.top-surfaces {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-surfaces a {
    color: #d4d4d8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.top-surfaces a:hover,
.top-surfaces a.active {
    color: #fff;
    background: rgba(122, 31, 46, 0.85);
}

@media (max-width: 640px) {
    .top-surfaces a { font-size: 10px; padding: 5px 7px; }
    .pro-header-inner { gap: 8px; }
}

/* —— Floating dock —— */
.float-dock {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 4px;
    padding: 8px;
    background: rgba(12, 10, 9, 0.94);
    border: 1px solid rgba(122, 31, 46, 0.5);
    border-radius: 999px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    scrollbar-width: none;
}

.float-dock::-webkit-scrollbar { display: none; }

.float-dock a {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 64px;
    padding: 8px 10px;
    border-radius: 999px;
    text-decoration: none;
    color: #a8a29e;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.float-dock a .ico { font-size: 16px; line-height: 1; }

.float-dock a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.float-dock a.active {
    color: #fff;
    background: var(--burgundy);
    transform: translateY(-2px);
}

/* —— Menú secundario Admin (completo) —— */
.admin-subnav {
    position: sticky;
    top: var(--header-h);
    z-index: 80;
    background: #1c1917;
    border-bottom: 1px solid rgba(122, 31, 46, 0.35);
}

.admin-subnav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-subnav-inner::-webkit-scrollbar { display: none; }

.admin-subnav-link {
    flex: 0 0 auto;
    padding: 10px 12px;
    color: #a8a29e;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.admin-subnav-link:hover { color: #fff; }

.admin-subnav-link.active {
    color: #fff;
    border-bottom-color: var(--burgundy);
}

.admin-subnav-out { color: #fca5a5 !important; margin-left: auto; }

.float-dock a.dock-link {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 56px;
    padding: 8px 8px;
    border-radius: 999px;
    text-decoration: none;
    color: #a8a29e;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.float-dock a.dock-link .ico { font-size: 14px; line-height: 1; }
.float-dock a.dock-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.float-dock a.dock-link.active {
    color: #fff;
    background: var(--burgundy);
    transform: translateY(-2px);
}

/* —— Layout —— */
.pro-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 40px;
}

.pro-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.pro-sub {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
}

/* —— KPI cards —— */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.kpi {
    background: var(--paper);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    padding: 18px 16px;
    position: relative;
    overflow: hidden;
    animation: rise 0.5s ease both;
}

.kpi::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--burgundy);
}

.kpi.amber::after { background: #a16207; }
.kpi.green::after { background: var(--verde); }
.kpi.slate::after { background: var(--slate); }

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 8px;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    line-height: 1;
}

.kpi-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* —— Panels —— */
.dash-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

@media (max-width: 860px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.panel {
    background: var(--paper);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    padding: 20px;
}

.panel h3 {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
}

.chart-box { min-height: 180px; }

/* —— Tables —— */
.pro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pro-table th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 8px 6px;
    border-bottom: 1px solid var(--borde);
}

.pro-table td {
    padding: 10px 6px;
    border-bottom: 1px solid #f5f5f4;
    vertical-align: middle;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pending { background: #f4f4f5; color: #3f3f46; }
.badge-run { background: #dbeafe; color: #1e40af; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fee2e2; color: #991b1b; }

/* —— Quick links —— */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.quick-link {
    display: block;
    padding: 16px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.quick-link:hover {
    background: var(--burgundy);
    transform: translateY(-2px);
}

.quick-link strong {
    display: block;
    font-family: var(--font-display);
    font-size: 14px;
    margin-bottom: 4px;
}

.quick-link span {
    font-size: 11px;
    color: #a8a29e;
}

/* —— Login —— */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(122,31,46,0.28), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(63,63,70,0.35), transparent 45%),
        var(--ink);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--paper);
    border-radius: 20px;
    padding: 36px 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    overflow: hidden;
}

.login-card .pro-title { text-align: center; }
.login-card .pro-sub { text-align: center; }

/* Logos login / scanner: siempre contenidos (el PNG suele ser muy grande) */
.brand-logo-login,
.brand-logo-inline,
.js-logo-light,
.js-logo-dark,
.js-site-logo {
    display: none;
}

.login-card img.brand-logo-login.is-on,
.login-card img.js-logo-light.is-on {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    width: auto !important;
    max-height: 42px !important;
    max-width: 168px !important;
    margin: 0 auto 14px !important;
    object-fit: contain;
}

.scan-brand.pro-brand img.is-on,
#vista-scan img.brand-logo-inline.is-on,
#vista-scan img.js-logo-dark.is-on {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    width: auto !important;
    max-height: 36px !important;
    max-width: 150px !important;
    margin: 0 auto 8px !important;
    object-fit: contain;
}

.scan-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.scan-brand.has-logo .brand-text-fallback {
    display: none !important;
}

/* Headers: logo compacto */
.pro-brand img.is-on,
.b2c-logo img.is-on {
    height: auto !important;
    width: auto !important;
    max-height: 28px !important;
    max-width: 130px !important;
    object-fit: contain;
}

/* —— B2C Hero video —— */
.hero-video {
    position: relative;
    min-height: min(88vh, 720px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
}

.hero-video video,
.hero-video .hero-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-fallback {
    background:
        linear-gradient(135deg, #1c1917 0%, #7a1f2e 55%, #4a0f18 100%);
}

.hero-video::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(12,10,9,0.35) 0%, rgba(12,10,9,0.75) 70%, rgba(12,10,9,0.92) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 18px 56px;
    animation: rise 0.8s ease both;
}

.hero-content .eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fca5a5;
    margin: 0 0 12px;
    font-family: var(--font-display);
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 14px;
    max-width: 14ch;
    letter-spacing: -0.03em;
}

.hero-content p {
    margin: 0 0 24px;
    font-size: 16px;
    color: #d6d3d1;
    max-width: 42ch;
    line-height: 1.5;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--burgundy);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 14px 22px;
    border-radius: 999px;
    transition: background 0.2s, transform 0.2s;
}

.hero-cta:hover {
    background: var(--burgundy-deep);
    transform: translateY(-2px);
}

/* —— Catálogo categorías (minimal + iconos, centrado) —— */
.cat-bar-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 28px;
}

.cat-slim {
    display: inline-flex;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
    padding: 6px;
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--borde);
    border-radius: 16px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
}

.cat-slim::-webkit-scrollbar { display: none; }

.cat-slim button {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-display);
    transition: all 0.2s;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 76px;
}

.cat-slim button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cat-slim button:hover {
    color: var(--ink);
    background: #f4f4f5;
}

.cat-slim button.active {
    background: var(--burgundy);
    color: #fff;
}

.logo-preview {
    width: 120px;
    height: 60px;
    object-fit: contain;
    background: #f4f4f5;
    border: 1px dashed var(--borde);
    border-radius: 8px;
    padding: 8px;
}

.logo-preview.on-dark {
    background: #0c0a09;
}

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

.prod-card {
    background: var(--paper);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--borde);
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    animation: rise 0.5s ease both;
}

.prod-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(12,10,9,0.08);
}

.prod-card .thumb {
    height: 140px;
    background: linear-gradient(145deg, #292524, #7a1f2e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.45);
    font-size: 28px;
    position: relative;
}

.prod-card .tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(12,10,9,0.75);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    font-family: var(--font-display);
}

.prod-card .body { padding: 14px 16px 18px; }

.prod-card h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.prod-card .price {
    font-size: 15px;
    font-weight: 700;
    color: var(--burgundy);
    font-family: var(--font-display);
}

.section-label {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 16px;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.alerta-ui {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 14px;
}

.alerta-ui.exito { display: block; background: #dcfce7; color: #166534; }
.alerta-ui.error { display: block; background: #fee2e2; color: #991b1b; }
