/* cliente.css — Portal del cliente de PSK Racing.
   Estética oscura, premium pero con carácter de taller. */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, sans-serif;
    background: #141414;
    color: #e8e8e8;
    min-height: 100vh;
}

a { color: #ff8c42; }

/* ---------- Topbar ---------- */
.cli-top {
    background: #1c1c1c;
    border-bottom: 2px solid #ff6b35;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; flex-wrap: wrap; gap: 10px;
}
.cli-brand img { height: 42px; display: block; }
.cli-user { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #ccc; }
.cli-salir {
    color: #fff; text-decoration: none; background: #333;
    padding: 7px 14px; border-radius: 6px; font-size: 13px;
}
.cli-salir:hover { background: #ff6b35; }

/* ---------- Navegación ---------- */
.cli-nav {
    display: flex; background: #1c1c1c; border-bottom: 1px solid #2e2e2e;
    max-width: 900px; margin: 0 auto;
}
.cli-nav a {
    flex: 1; text-align: center; padding: 15px 8px; color: #aaa; text-decoration: none;
    font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent; transition: all .15s ease;
}
.cli-nav a:hover { color: #fff; }
.cli-nav a.activo { color: #ff8c42; border-bottom-color: #ff6b35; }

/* ---------- Contenido ---------- */
.cli-main { max-width: 900px; margin: 0 auto; padding: 26px 18px 44px; }

.cli-titulo { font-size: 22px; color: #fff; margin-bottom: 4px; font-weight: 700; }
.cli-sub { color: #888; font-size: 14px; margin-bottom: 22px; }

.cli-card {
    background: #1f1f1f; border: 1px solid #2e2e2e; border-radius: 14px;
    padding: 22px; margin-bottom: 18px;
}
.cli-card h3 {
    font-size: 16px; color: #ff8c42; margin-bottom: 16px;
    text-transform: uppercase; letter-spacing: .5px;
}

/* Moto: tarjeta */
.moto-card {
    background: #1f1f1f; border: 1px solid #2e2e2e; border-left: 4px solid #ff6b35;
    border-radius: 12px; padding: 18px; margin-bottom: 14px;
}
.moto-card .nombre { font-size: 18px; font-weight: 700; color: #fff; }
.moto-card .datos { color: #999; font-size: 13px; margin-top: 4px; }
.moto-card .acciones { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Fila: portada + info */
.moto-card-row { display: flex; gap: 16px; align-items: flex-start; }
.moto-portada {
    flex: 0 0 160px; width: 160px; height: 130px; border-radius: 10px;
    overflow: hidden; background: #161616; border: 1px solid #2e2e2e;
    display: flex; align-items: center; justify-content: center;
}
.moto-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moto-portada .sin-foto { color: #444; font-size: 42px; }
.moto-info { flex: 1; min-width: 0; }

@media (max-width: 600px) {
    .moto-card-row { flex-direction: column; }
    .moto-portada  { width: 100%; flex: 0 0 auto; height: 180px; }
}

/* Fotos extra (las que no son la portada) */
.moto-fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.moto-fotos img {
    width: 84px; height: 84px; object-fit: cover;
    border-radius: 8px; border: 1px solid #333;
}
.fotos-grid { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.foto-thumb { position: relative; }
.foto-thumb img {
    width: 96px; height: 96px; object-fit: cover; display: block;
    border-radius: 8px; border: 1px solid #333;
}
.foto-thumb form { position: absolute; top: -8px; right: -8px; margin: 0; }
.foto-del {
    background: #c0392b; color: #fff; border: 2px solid #1f1f1f; border-radius: 50%;
    width: 24px; height: 24px; font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
}
.foto-del:hover { background: #e74c3c; }
.cli-form input[type="file"] { padding: 9px; background: #161616; color: #ccc; font-size: 13px; }

/* Formularios */
.cli-form label {
    display: block; font-size: 12px; color: #bbb; font-weight: 600;
    margin-bottom: 6px; letter-spacing: .3px;
}
.cli-form input, .cli-form select, .cli-form textarea {
    width: 100%; padding: 12px 13px; margin-bottom: 14px;
    background: #161616; border: 2px solid #333; border-radius: 8px;
    color: #fff; font-size: 15px; font-family: inherit; outline: none;
}
.cli-form input:focus, .cli-form select:focus, .cli-form textarea:focus { border-color: #ff6b35; }
.cli-form .fila { display: flex; gap: 12px; flex-wrap: wrap; }
.cli-form .fila > div { flex: 1; min-width: 140px; }

/* Botones */
.btn-cli {
    display: inline-block; padding: 12px 22px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
    color: #fff; background: linear-gradient(135deg, #ff6b35, #f7931e);
}
.btn-cli:hover { filter: brightness(1.08); color: #fff; }
.btn-cli.full { display: block; width: 100%; text-align: center; }
.btn-line {
    display: inline-block; padding: 8px 14px; border-radius: 7px; font-size: 13px;
    font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid #444;
    background: #2a2a2a; color: #ddd;
}
.btn-line:hover { border-color: #ff6b35; color: #fff; }
.btn-line.danger { color: #ff8a8a; }
.btn-line.danger:hover { border-color: #c0392b; background: #3a2222; }

/* Estados */
.badge {
    display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.badge-gris { background: #444; color: #ddd; }
.badge-info { background: #2b6cb0; color: #fff; }
.badge-prim { background: #ff6b35; color: #fff; }
.badge-ok   { background: #28a745; color: #fff; }
.badge-rojo { background: #c0392b; color: #fff; }

.cli-vacio { color: #888; text-align: center; padding: 30px; }
.cli-ok {
    background: rgba(40,167,69,.15); border: 1px solid rgba(40,167,69,.4);
    color: #6fcf8b; padding: 12px 16px; border-radius: 8px; margin-bottom: 18px;
}

/* Historial */
.hist-item {
    background: #1a1a1a; border: 1px solid #2e2e2e; border-radius: 9px;
    padding: 14px; margin-bottom: 10px;
}
.hist-item .top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.hist-item .fecha { color: #fff; font-weight: 700; }
.hist-item .meta { color: #999; font-size: 13px; margin-top: 6px; }
.hist-item .desc { margin-top: 6px; font-size: 14px; white-space: pre-line; }

/* Presupuestos */
.cli-seccion {
    font-size: 15px; color: #ff8c42; margin: 28px 0 14px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
}
.presu-tabla {
    width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px;
}
.presu-tabla th {
    text-align: left; color: #888; font-weight: 600;
    padding: 6px 8px; border-bottom: 1px solid #383838;
}
.presu-tabla td { padding: 6px 8px; border-bottom: 1px solid #262626; color: #ddd; }
.presu-tabla th:nth-child(2), .presu-tabla td:nth-child(2) { text-align: right; width: 64px; }
.presu-tabla th:last-child,   .presu-tabla td:last-child   { text-align: right; width: 110px; }
.presu-total { text-align: right; margin-top: 10px; font-size: 15px; color: #fff; }
.presu-total strong { color: #ff8c42; }

/* Tienda */
.tienda-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px; margin-bottom: 8px;
}
.tienda-item {
    background: #1f1f1f; border: 1px solid #2e2e2e; border-radius: 12px;
    padding: 14px; display: flex; flex-direction: column;
}
.ti-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ti-nombre { font-weight: 700; color: #fff; font-size: 15px; }
.ti-precio { color: #ff8c42; font-weight: 700; white-space: nowrap; }
.ti-desc { color: #999; font-size: 13px; margin-top: 6px; flex: 1; }
.ti-compra {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px; gap: 10px;
}
.ti-stock { color: #777; font-size: 12px; }
.cli-form .ti-compra label {
    display: flex; align-items: center; gap: 6px; margin: 0;
    font-size: 12px; color: #bbb;
}
.cli-form input.ti-cant {
    width: 64px; margin: 0; padding: 8px; text-align: center;
}
.tienda-resumen { margin-top: 20px; }
.tienda-total { font-size: 16px; color: #fff; margin: 6px 0 14px; }
.tienda-total strong { color: #ff8c42; font-size: 18px; }

/* Página pública de motos en venta */
.venta-card {
    background: #1f1f1f; border: 1px solid #2e2e2e; border-radius: 14px;
    overflow: hidden; margin-bottom: 20px;
}
.venta-fotos { display: flex; gap: 2px; overflow-x: auto; background: #141414; }
.venta-fotos img { height: 240px; width: auto; object-fit: cover; flex: 0 0 auto; }
.venta-info { padding: 18px 20px 22px; }
.venta-top {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 10px; flex-wrap: wrap;
}
.venta-nombre { font-size: 20px; font-weight: 800; color: #fff; }
.venta-precio { font-size: 20px; font-weight: 800; color: #ff8c42; white-space: nowrap; }
.venta-meta { color: #999; font-size: 14px; margin-top: 4px; }
.venta-desc { color: #ccc; font-size: 14px; margin-top: 12px; white-space: pre-line; }
.venta-btn {
    display: inline-block; margin-top: 16px; padding: 11px 20px; border-radius: 8px;
    background: #25d366; color: #08130b; font-weight: 700; text-decoration: none;
}
.venta-btn:hover { filter: brightness(1.08); color: #08130b; }
.venta-contacto { margin-top: 16px; color: #ff8c42; font-weight: 600; }

/* Estimación del service (pedir turno) */
.service-estim {
    background: #1a1a1a; border: 1px solid #2e2e2e; border-left: 4px solid #ff6b35;
    border-radius: 10px; padding: 14px 16px; margin: -4px 0 14px;
}
.se-tit { color: #ff8c42; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.se-lista { list-style: none; margin: 0; padding: 0; }
.se-lista li {
    display: flex; justify-content: space-between; gap: 10px;
    font-size: 14px; color: #ddd; padding: 4px 0; border-bottom: 1px solid #262626;
}
.se-total { text-align: right; margin-top: 8px; font-size: 15px; color: #fff; }
.se-total strong { color: #ff8c42; }
.se-nota { color: #888; font-size: 12px; margin-top: 6px; }

.cli-foot { text-align: center; color: #666; font-size: 12px; padding: 20px; }

/* Aviso de vista previa (cuando entra un administrador) */
.cli-preview {
    background: #ffc107; color: #141414; text-align: center;
    padding: 9px 14px; font-size: 13px; font-weight: 600;
}
.cli-preview a { color: #141414; font-weight: 800; text-decoration: underline; }

/* ---------- Login / Registro ---------- */
.cli-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cli-login-card {
    background: #1f1f1f; border: 1px solid #2e2e2e; border-radius: 18px;
    padding: 34px 30px; width: 100%; max-width: 400px;
    box-shadow: 0 30px 70px rgba(0,0,0,.6);
}
.cli-login-card .logo { text-align: center; margin-bottom: 8px; }
.cli-login-card .logo img { height: 84px; }
.cli-login-card h1 { font-size: 19px; color: #fff; text-align: center; }
.cli-login-card .lema {
    font-size: 13px; color: #888; text-align: center; margin: 4px 0 20px;
}
.cli-tabs { display: flex; margin-bottom: 20px; border: 1px solid #333; border-radius: 8px; overflow: hidden; }
.cli-tabs a {
    flex: 1; text-align: center; padding: 10px; text-decoration: none;
    color: #aaa; font-size: 14px; font-weight: 600; background: #181818;
}
.cli-tabs a.activo { background: #ff6b35; color: #fff; }
.cli-error {
    background: rgba(255,68,68,.15); border: 1px solid rgba(255,68,68,.4);
    color: #ff7a7a; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}

@media (max-width: 600px) {
    .cli-main { padding: 20px 14px 40px; }
    .cli-form .fila > div { min-width: 100%; }
}
