/* ══════════════════════════════════════════
   MIS PUNTOS — estilos
   (catalogo.css ya está cargado)
══════════════════════════════════════════ */

.puntos-main {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1rem 4rem;
}

/* ── Secciones ───────────────────────────── */
.puntos-section { width: 100%; }

.puntos-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.puntos-header h1 {
    font-size: 1.6rem;
    margin: 0 0 0.2rem;
}

.puntos-saludo {
    color: #718096;
    font-size: 0.95rem;
    margin: 0;
}

/* ── Tarjeta base ────────────────────────── */
.puntos-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

.puntos-card h2 {
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
    color: #2d3748;
}

/* ── Login card ──────────────────────────── */
.login-card {
    max-width: 440px;
    margin: 3rem auto;
    text-align: center;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
}

.login-card h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: #2d3748;
}

.login-subtitulo {
    color: #718096;
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
}

.login-nota {
    font-size: 0.82rem;
    color: #a0aec0;
    margin-top: 1.2rem;
    line-height: 1.5;
}

.login-nota a { color: inherit; text-decoration: underline; }

/* ── Input group ─────────────────────────── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.input-group input {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #2d3748;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: #b48c64;
    box-shadow: 0 0 0 3px rgba(180,140,100,0.15);
    background: white;
}

/* ── Botones ─────────────────────────────── */
.btn-login,
.btn-canjear {
    width: 100%;
    padding: 0.85rem;
    background: #b48c64;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.3rem;
}

.btn-login:hover:not(:disabled),
.btn-canjear:hover:not(:disabled) {
    background: #9a7550;
    transform: translateY(-1px);
}

.btn-login:disabled,
.btn-canjear:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-cerrar-sesion {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-cerrar-sesion:hover { background: #e5e7eb; }

/* ── Saldo grid ──────────────────────────── */
.saldo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.saldo-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
}

.saldo-principal {
    background: linear-gradient(135deg, #b48c64, #9a7550);
    color: white;
}

.saldo-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

.saldo-valor {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.saldo-principal .saldo-label,
.saldo-principal .saldo-nota { color: rgba(255,255,255,0.85); }

.saldo-secundario { font-size: 1.6rem; color: #4a5568; }

.saldo-nota {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ── Banner info canje ───────────────────── */
.canje-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fffbf2;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #92400e;
    line-height: 1.5;
}

.canje-info-icono { font-size: 1.2rem; flex-shrink: 0; }

/* ── Formulario canje ────────────────────── */
.canje-subtitulo {
    color: #718096;
    font-size: 0.88rem;
    margin: 0 0 1.2rem;
    line-height: 1.5;
}

.canje-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* ── Historial ───────────────────────────── */
.historial-lista {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.historial-vacio {
    color: #a0aec0;
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 0;
}

.historial-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    background: #f8fafc;
    border-left: 3px solid #e2e8f0;
    gap: 0.5rem;
}

.item-acumulacion { border-left-color: #48bb78; }
.item-descuento   { border-left-color: #fc8181; }

.historial-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.historial-descripcion {
    font-size: 0.9rem;
    color: #2d3748;
    font-weight: 500;
}

.historial-fecha {
    font-size: 0.78rem;
    color: #a0aec0;
}

.historial-puntos {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    color: #2d3748;
}

.item-acumulacion .historial-puntos { color: #38a169; }
.item-descuento   .historial-puntos { color: #e53e3e; }

/* ── Estados de canje ────────────────────── */
.canje-estado {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
}

.estado-pendiente { background: #fef3c7; color: #92400e; }
.estado-aprobado  { background: #dcfce7; color: #166534; }
.estado-rechazado { background: #fee2e2; color: #991b1b; }

.canje-nota-admin {
    font-size: 0.78rem;
    color: #718096;
    font-style: italic;
}

/* ── Alertas ─────────────────────────────── */
.alerta {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.alerta-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alerta-exito {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
    .saldo-grid {
        grid-template-columns: 1fr;
    }

    .puntos-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .puntos-card { padding: 1.2rem; }
    .login-card  { margin: 1.5rem auto; }
}

/* ══════════════════════════════════════════
   CATÁLOGO DE CANJES
══════════════════════════════════════════ */

/* ── Grid igual que index.html ───────────── */
.catalogo-canje-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 1rem;
}

/* ── Card de aro — misma estética que index ─ */
.canje-card-aro {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.canje-card-aro:hover { transform: translateY(-2px); }

.canje-card-aro picture {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    background: #f9f9f9;
    margin-bottom: 10px;
}

.canje-card-aro img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.3s ease;
    display: block;
    user-select: none;
    -webkit-user-select: none;
}

.canje-card-aro img.loaded { opacity: 1; }
.canje-card-aro:hover img  { transform: scale(1.04); }

.canje-card-aro h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #121212;
    font-weight: 700;
}

.canje-card-aro .modelo {
    font-size: 12px;
    color: #6a6a6a;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.canje-card-aro .codigo {
    font-size: 11px;
    color: #9a8c7e;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 2px 0;
}

.canje-card-aro .stock-label {
    font-size: 11px;
    color: #a0aec0;
    margin: 2px 0;
}

.canje-card-aro .puntos-requeridos {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.canje-puntos-badge {
    background: #121212;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 2px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Badge agotado */
.canje-badge-agotado {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #c0392b;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    pointer-events: none;
    z-index: 2;
}

.canje-card-aro.agotado { opacity: 0.65; }
.canje-card-aro.agotado img { filter: grayscale(40%); }

/* ── Card genérica (descuento / servicio) ──── */
.canje-card-item {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}

.canje-card-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.canje-card-item-tipo {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 3px;
    align-self: flex-start;
}

.tipo-descuento {
    background: #fef3c7;
    color: #92400e;
}

.tipo-servicio {
    background: #e0f2fe;
    color: #075985;
}

.canje-card-item h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #121212;
    margin: 0;
    line-height: 1.3;
}

.canje-card-item p {
    font-size: 0.83rem;
    color: #6a6a6a;
    margin: 0;
    line-height: 1.5;
}

.canje-card-item .puntos-requeridos {
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ── Botón canjear dentro de las cards ────── */
.btn-canjear-card {
    width: 100%;
    padding: 0.65rem;
    background: #121212;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 0.6rem;
    transition: background 0.2s, transform 0.1s;
}

.btn-canjear-card:hover:not(:disabled) {
    background: #333;
    transform: translateY(-1px);
}

.btn-canjear-card:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ── Fecha expiración ─────────────────────── */
.canje-expira {
    font-size: 0.72rem;
    color: #e53e3e;
    font-weight: 600;
}

/* ── Estado completado ────────────────────── */
.estado-completado {
    background: #dcfce7;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ── Puntos expirados aviso ───────────────── */
.aviso-expiracion {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #991b1b;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 600px) {
    .catalogo-canje-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 380px) {
    .catalogo-canje-grid {
        grid-template-columns: 1fr;
    }
}