* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    color: #202536;
    background: #f7f8fc;
}

a {
    text-decoration: none;
}

.encabezado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 8%;
    background: #ffffff;
    box-shadow: 0 2px 12px #0000000b;
}

.logo {
    font-size: 27px;
    font-weight: bold;
    color: #202536;
}

.logo span {
    color: #4263eb;
}

nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

nav a {
    color: #555d70;
    font-size: 14px;
}

nav a:hover {
    color: #4263eb;
}

.portada {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding: 80px 10%;
    background: linear-gradient(120deg, #e9edff, #f4f6ff);
}

.portada-texto {
    max-width: 540px;
}

.etiqueta {
    color: #4263eb;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.portada h1 {
    font-size: 48px;
    line-height: 1.15;
    margin-bottom: 20px;
}

.portada-texto > p:not(.etiqueta) {
    color: #626b7e;
    line-height: 1.7;
    margin-bottom: 28px;
}

.boton {
    display: inline-block;
    border: none;
    background: #4263eb;
    color: white;
    padding: 13px 22px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.boton:hover {
    background: #304dc7;
    transform: translateY(-2px);
}

.boton:disabled {
    background: #a0a6b8;
    cursor: not-allowed;
    transform: none;
}

.portada-imagen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 250px;
}

.circulo {
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d6ddff;
    border-radius: 50%;
}

.circulo span {
    font-size: 125px;
}

.catalogo {
    padding: 75px 8%;
}

.titulo-seccion {
    text-align: center;
    margin-bottom: 35px;
}

.titulo-seccion h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

.titulo-seccion > p:last-child {
    color: #737b8e;
    font-size: 14px;
}

#estado {
    text-align: center;
    margin-bottom: 20px;
    color: #737b8e;
}

.productos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.producto {
    background: white;
    border-radius: 13px;
    overflow: hidden;
    box-shadow: 0 5px 25px #2025360c;
    transition: 0.2s;
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px #20253616;
}

.imagen {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
}

.imagen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
}

.contenido {
    padding: 22px;
}

.marca {
    color: #4263eb;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.contenido h3 {
    font-size: 17px;
    margin: 10px 0;
}

.precio {
    font-size: 23px;
    font-weight: bold;
    margin: 15px 0 8px;
}

.stock {
    color: #687184;
    font-size: 13px;
    margin-bottom: 18px;
}

.contenido .boton {
    width: 100%;
}

footer {
    text-align: center;
    padding: 35px 15px;
    background: #202536;
    color: #ffffff;
}

footer p {
    color: #c2c7d3;
    font-size: 13px;
    margin-top: 12px;
}

footer .logo {
    color: #ffffff;
}

/* ===== Imágenes de portada ===== */
.imagen-inicio {
    width: 100%;
    max-width: 350px;
    height: 320px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.celular-portada {
    width: 85%;
    height: 85%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.portada-imagen .circulo {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portada-imagen .circulo .celular-portada {
    width: 265%;
    height: 75%;
    object-fit: contain;
    border-radius: 50%;
}

/* ===== Menú de sesión ===== */
.menu-sesion {
    display: flex;
    align-items: center;
    gap: 28px;
}

.saludo {
    font-size: 14px;
    font-weight: bold;
    color: #202536;
}

/* ===== Carrito lateral ===== */
.fondo-carrito {
    position: fixed;
    inset: 0;
    background: #20253680;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 90;
}

.fondo-carrito.visible {
    opacity: 1;
    pointer-events: auto;
}

.panel-carrito {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: -8px 0 30px #20253622;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
}

.panel-carrito.abierto {
    transform: translateX(0);
}

.panel-encabezado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid #e8eaf0;
}

.cerrar {
    border: none;
    background: #f0f2fa;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    color: #555d70;
}

.cerrar:hover {
    background: #e0e5ff;
    color: #4263eb;
}

.panel-lista {
    flex: 1;
    overflow-y: auto;
    padding: 6px 24px;
}

.carrito-vacio {
    text-align: center;
    color: #737b8e;
    margin-top: 60px;
}

.item-carrito {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid #e8eaf0;
}

.item-miniatura {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: #edf0ff;
    border-radius: 10px;
    overflow: hidden;
}

.item-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.item-datos {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.item-precio {
    color: #687184;
    font-size: 13px;
}

.cantidad {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    border: 1px solid #d9dded;
    border-radius: 8px;
    overflow: hidden;
}

.cantidad button {
    width: 30px;
    height: 30px;
    border: none;
    background: #f4f6ff;
    color: #4263eb;
    font-size: 16px;
    cursor: pointer;
}

.cantidad button:hover:not(:disabled) {
    background: #e0e5ff;
}

.cantidad button:disabled {
    color: #b3b8c8;
    cursor: not-allowed;
}

.cantidad span {
    min-width: 34px;
    text-align: center;
    font-size: 14px;
}

.item-derecha {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-size: 14px;
}

.quitar {
    background: #ffe9e9;
    color: #d52c2c;
    border: none;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
}

.quitar:hover {
    background: #ffd6d6;
}

.panel-pie {
    padding: 20px 24px 24px;
    border-top: 1px solid #e8eaf0;
    background: #fafbff;
}

.panel-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
}

.panel-total strong {
    font-size: 22px;
}

.panel-pie .boton {
    width: 100%;
}

.vaciar {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: none;
    border: none;
    color: #737b8e;
    font-size: 13px;
    cursor: pointer;
}

.vaciar:hover {
    color: #d52c2c;
}

#mensaje-carrito {
    margin-top: 12px;
    font-size: 13px;
    color: #4263eb;
    text-align: center;
}

#mensaje-carrito a {
    display: inline-block;
    margin-top: 8px;
    font-weight: bold;
    color: #4263eb;
    text-decoration: underline;
}

/* ===== Login y registro ===== */
.pagina-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    background: linear-gradient(120deg, #e9edff, #f4f6ff);
}

.auth-caja {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 30px;
    text-align: center;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px #2025361a;
}

.auth-caja .logo {
    display: inline-block;
    margin-bottom: 22px;
}

.auth-caja h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.auth-sub {
    color: #737b8e;
    font-size: 14px;
    margin-bottom: 26px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.auth-form label {
    font-size: 13px;
    font-weight: bold;
    color: #555d70;
    margin-bottom: 6px;
}

.auth-form input {
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid #d9dded;
    border-radius: 8px;
    background: #fafbff;
    font-size: 14px;
    color: #202536;
    outline: none;
    transition: 0.2s;
}

.auth-form input:focus {
    border-color: #4263eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px #4263eb22;
}

.auth-form .boton {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
}

.auth-msg {
    min-height: 20px;
    margin-top: 14px;
    font-size: 13px;
    text-align: center;
    color: #d52c2c;
}

.auth-enlace {
    margin-top: 14px;
    font-size: 14px;
    color: #737b8e;
}

.auth-enlace a {
    color: #4263eb;
    font-weight: bold;
}

.auth-enlace a:hover {
    text-decoration: underline;
}

.auth-volver {
    display: inline-block;
    margin-top: 18px;
    font-size: 13px;
    color: #737b8e;
}

.auth-volver:hover {
    color: #4263eb;
}

/* ===== Responsive (siempre al final) ===== */
@media (max-width: 1000px) {
    .productos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portada h1 {
        font-size: 38px;
    }
}

@media (max-width: 600px) {
    .encabezado {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .menu-sesion {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .portada {
        flex-direction: column;
        text-align: center;
        padding: 55px 20px;
    }

    .portada h1 {
        font-size: 34px;
    }

    .circulo {
        width: 200px;
        height: 200px;
    }

    .circulo span {
        font-size: 95px;
    }

    .portada-imagen .circulo {
        width: 260px;
        height: 260px;
    }

    .catalogo {
        padding: 50px 20px;
    }

    .productos {
        grid-template-columns: 1fr;
    }

    .titulo-seccion h2 {
        font-size: 27px;
    }

    .panel-carrito {
        width: 100%;
    }
}