:root {
    --azul: #002060;
    --azul-claro: #1a4a9f;
    --rojo: #c0392b;
    --amarillo: #f39c12;
    --gris-claro: #f4f4f4;
    --gris: #ddd;
    --texto: #222;
    --radio: 6px;
    --sombra: 0 2px 8px rgba(0,0,0,.12);
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--gris-claro);
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ─────────────────────────────────────── */
header {
    background: var(--azul);
    color: white;
    padding: 0 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 60px;
}

.header-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.header-logo span { color: var(--amarillo); }

.header-search {
    flex: 1;
    max-width: 450px;
    display: flex;
}

.header-search input {
    flex: 1;
    padding: .5rem .9rem;
    border: none;
    border-radius: var(--radio) 0 0 var(--radio);
    font-size: .95rem;
    outline: none;
}

.header-search button {
    padding: .5rem .9rem;
    background: var(--amarillo);
    border: none;
    border-radius: 0 var(--radio) var(--radio) 0;
    cursor: pointer;
    font-weight: 700;
    color: var(--azul);
}

.header-search button:hover { background: #e67e22; }

/* ── MAIN ────────────────────────────────────────── */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
}

/* ── HERO ────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--azul) 60%, var(--azul-claro));
    color: white;
    border-radius: var(--radio);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero p { font-size: 1rem; opacity: .85; }

/* ── GRID DE SERIES ──────────────────────────────── */
.seccion-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--azul);
    border-left: 4px solid var(--amarillo);
    padding-left: .7rem;
    margin-bottom: 1rem;
}

.tipo-grupo {
    margin-bottom: 2.5rem;
}

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

.serie-card {
    background: white;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.2rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--azul);
    font-weight: 700;
    font-size: .95rem;
    border-top: 4px solid var(--azul);
    transition: transform .15s, box-shadow .15s;
}

.serie-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
}

.serie-card .count {
    display: block;
    margin-top: .4rem;
    font-size: .8rem;
    font-weight: 400;
    color: #666;
}

/* colores por tipo */
.tipo-montaplex .serie-card { border-top-color: var(--azul); }
.tipo-airfix    .serie-card { border-top-color: #27ae60; }
.tipo-eko       .serie-card { border-top-color: #8e44ad; }
.tipo-serjan    .serie-card { border-top-color: #e67e22; }
.tipo-hobbyplast .serie-card { border-top-color: #16a085; }
.tipo-otras     .serie-card { border-top-color: #7f8c8d; }

/* ── GRID DE PRODUCTOS ───────────────────────────── */
.breadcrumb {
    font-size: .85rem;
    color: #666;
    margin-bottom: 1rem;
}
.breadcrumb a { color: var(--azul-claro); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 .4rem; }

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

.producto-card {
    background: white;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow: hidden;
    text-decoration: none;
    color: var(--texto);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

.producto-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--gris);
}

.producto-card-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #e0e0e0, #bbb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
}

.producto-card-body {
    padding: .8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-card-num {
    font-size: .75rem;
    color: #999;
    font-weight: 600;
}

.producto-card-nombre {
    font-size: .9rem;
    font-weight: 700;
    color: var(--azul);
    margin-top: .2rem;
    line-height: 1.3;
}

/* ── DETALLE PRODUCTO ────────────────────────────── */
.producto-detalle {
    background: white;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow: hidden;
}

.producto-detalle-header {
    background: var(--azul);
    color: white;
    padding: 1.5rem;
}

.producto-detalle-header .numero {
    font-size: .85rem;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.producto-detalle-header h1 {
    font-size: 1.6rem;
    margin-top: .3rem;
}

.producto-detalle-body {
    padding: 1.5rem;
}

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.galeria img {
    width: 100%;
    border-radius: var(--radio);
    object-fit: cover;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: opacity .15s;
}

.galeria img:hover { opacity: .85; }

.descripcion-texto {
    background: var(--gris-claro);
    border-left: 4px solid var(--azul);
    padding: 1rem 1.2rem;
    border-radius: 0 var(--radio) var(--radio) 0;
    font-size: .95rem;
    line-height: 1.7;
    color: #333;
}

/* ── BÚSQUEDA ────────────────────────────────────── */
.busqueda-header {
    margin-bottom: 1.5rem;
}

.busqueda-header h1 { font-size: 1.4rem; color: var(--azul); }
.busqueda-header p { color: #666; margin-top: .3rem; font-size: .9rem; }

.no-resultados {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 1.1rem;
}

/* ── FOOTER ──────────────────────────────────────── */
footer {
    background: var(--azul);
    color: rgba(255,255,255,.6);
    text-align: center;
    padding: 1rem;
    font-size: .8rem;
    margin-top: 2rem;
}

footer a { color: var(--amarillo); text-decoration: none; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.3rem; }
    .series-grid { grid-template-columns: repeat(2, 1fr); }
    .productos-grid { grid-template-columns: repeat(2, 1fr); }
    .galeria { grid-template-columns: 1fr; }
}

/* ── LOGIN ───────────────────────────────────────── */
.login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.login-box {
    background: #fff;
    border-radius: var(--radio);
    box-shadow: 0 4px 24px rgba(0,0,0,.1);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: var(--azul);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-error {
    background: #fee;
    border: 1px solid #f88;
    border-radius: var(--radio);
    color: #c00;
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: .3rem;
}

.form-group input {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid #ccc;
    border-radius: var(--radio);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color .2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--azul);
}

.form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.2rem;
    font-size: .85rem;
    color: #666;
}

.btn-login {
    width: 100%;
    background: var(--azul);
    color: #fff;
    border: none;
    border-radius: var(--radio);
    padding: .75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.btn-login:hover { background: var(--azul-oscuro, #001a4d); }

.header-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
}

.header-username {
    color: rgba(255,255,255,.8);
    font-size: .85rem;
}

.btn-user {
    background: var(--amarillo);
    color: var(--azul);
    font-weight: 700;
    font-size: .8rem;
    padding: .35rem .8rem;
    border-radius: var(--radio);
    text-decoration: none;
    transition: opacity .15s;
}

.btn-user:hover { opacity: .85; }
