/* ==========================================
   PICKSY - HOJA DE ESTILOS PRINCIPAL
   ========================================== */


/* ==========================================
   1. FUENTES Y VARIABLES
========================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    /* Colores principales */
    --pear: #ECE99B;
    --pear-light: #F5F4D0;

    --green: #263D2B;
    --green-deep: #1B3021;
    --green-soft: #DCE6D3;

    /* Colores neutros */
    --white: #F2F0EB;
    --paper: #FCFBF7;
    --ink: #202820;
    --muted: #778075;
    --line: #E7E9DF;

    /* Efectos */
    --shadow: 0 18px 55px rgba(31, 48, 33, .08);
    --radius: 22px;

    /* Tipografías */
    --font-body: 'DM Sans', sans-serif;
    --font-heading: 'Manrope', sans-serif;
}


/* ==========================================
   2. RESET Y ESTILOS GENERALES
========================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-body);
    background: var(--paper);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:disabled:hover {
    transform: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enfoque accesible para navegación con teclado */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(112, 138, 66, .45);
    outline-offset: 3px;
}


/* ==========================================
   3. COMPONENTES COMPARTIDOS
========================================== */

/* Barra superior */

.topbar {
    min-height: 82px;
    padding: 0 clamp(20px, 5.4vw, 86px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    background: rgba(252, 251, 247, .94);
    border-bottom: 1px solid rgba(38, 61, 43, .07);
}

/* Marca */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--green);
    font: 800 28px/1 var(--font-heading);
    letter-spacing: -1.8px;
    flex-shrink: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.brand-on-dark {
    color: white;
    align-self: flex-start;
}

.brand-footer {
    font-size: 21px;
}

.brand-footer .brand-mark {
    font-size: 25px;
}

/* Navegación */

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav-link {
    border: 0;
    background: transparent;
    color: #687267;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--green);
    background: #EFF1E5;
}

/* Acciones de cabecera */

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-size: 13px;
    color: #647064;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--pear);
    font-weight: 800;
}

/* Contenedor general */

.page-wrap {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

/* Etiquetas superiores */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #637258;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6B8C4C;
}

.eyebrow-light {
    color: #D6DFAC;
}

/* Textos secundarios */

.muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* Botones */

.button {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 45px;
    border-radius: 12px;
    padding: 0 20px;
    font-weight: 700;
    font-size: 13px;
    transition:
        transform .18s,
        background .18s,
        box-shadow .18s;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button-primary {
    color: white;
    background: var(--green);
    box-shadow: 0 6px 15px rgba(38, 61, 43, .14);
}

.button-primary:hover:not(:disabled) {
    background: #35543B;
}

.button-secondary {
    background: #EFF1E8;
    color: var(--green);
}

.button-light {
    background: white;
    color: var(--green);
}

.button-wide {
    width: 100%;
    min-height: 51px;
}

/* Mensajes de formularios */

.form-feedback {
    min-height: 16px;
    color: #65854C;
    font-size: 11px;
    line-height: 1.5;
    margin: 10px 0 0;
}

.form-feedback.error {
    color: #B54E51;
}

.form-feedback.success {
    color: #65854C;
}

.form-feedback.info {
    color: var(--muted);
}

/* Notificaciones */

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    background: var(--green);
    color: white;
    border-radius: 12px;
    padding: 13px 18px;
    box-shadow: var(--shadow);
    font-size: 12px;
    transition: .2s;
    z-index: 50;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Enlaces de retorno */

.back-link {
    display: inline-block;
    border: 0;
    background: transparent;
    padding: 0;
    color: #6D7D61;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 22px;
}


/* ==========================================
   4. PÁGINA PRINCIPAL
========================================== */

/* Hero */

.hero {
    min-height: 430px;
    margin-top: 30px;
    padding: 58px 6.5%;
    border-radius: 30px;
    background: var(--pear-light);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: 24px;
    overflow: hidden;
    position: relative;
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font: 800 clamp(36px, 4.3vw, 58px)/1.08 var(--font-heading);
    letter-spacing: -2.5px;
    color: var(--green);
    margin: 19px 0 16px;
}

.hero h1 span {
    color: #708A42;
}

.hero-copy>p {
    color: #67725F;
    max-width: 430px;
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 24px;
}

/* Buscador */

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 530px;
    padding: 7px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 8px 25px rgba(38, 61, 43, .08);
}

.search-icon {
    font-size: 28px;
    color: #7A8975;
    padding-left: 10px;
    transform: rotate(-20deg);
}

.search-form input {
    border: 0;
    outline: 0;
    min-width: 0;
    flex: 1;
    color: var(--ink);
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
}

/* Campo de búsqueda de productos */

.search-form #searchInput {
    flex: 1.4;
    min-width: 100px;
}

/* Campo de presupuesto */

.search-form #budgetInput {
    flex: .9;
    min-width: 115px;
    width: 100%;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 10px 8px 10px 16px;
    font-size: 14px;
}

.search-form #budgetInput::-webkit-inner-spin-button,
.search-form #budgetInput::-webkit-outer-spin-button {
    margin: 0;
}

.search-form #budgetInput:focus {
    outline: none;
}

/* Búsquedas populares */

.popular-searches {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    font-size: 11px;
    color: #7B8373;
}

.search-chip {
    border: 1px solid rgba(38, 61, 43, .13);
    background: rgba(255, 255, 255, .38);
    border-radius: 999px;
    padding: 6px 11px;
    color: #58664F;
    font-size: 11px;
}

.search-chip:hover {
    background: white;
}

/* Ilustración del hero */

.hero-art {
    min-height: 300px;
    position: relative;
    display: grid;
    place-items: center;
}

.art-circle {
    width: min(310px, 90%);
    aspect-ratio: 1;
    background: #E7E8A9;
    border-radius: 48% 52% 55% 45%;
    transform: rotate(-12deg);
}

.bag-illustration {
    position: absolute;
    width: 165px;
    height: 176px;
    background: var(--green);
    border-radius: 22px 22px 35px 35px;
    transform: rotate(7deg);
    box-shadow: 12px 18px 0 rgba(38, 61, 43, .09);
    display: grid;
    place-items: center;
}

.bag-handle {
    position: absolute;
    width: 72px;
    height: 48px;
    border: 12px solid var(--green);
    border-bottom: 0;
    border-radius: 50px 50px 0 0;
    top: -32px;
}

.bag-leaf {
    color: var(--pear);
    font-size: 74px;
    transform: rotate(-15deg);
}

.bag-face {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 22px;
}

.bag-face span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pear);
}

/* Etiquetas flotantes */

.floating-tag {
    position: absolute;
    background: white;
    border-radius: 13px;
    box-shadow: var(--shadow);
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    color: #7A8277;
}

.floating-tag strong {
    font-size: 19px;
    color: var(--green);
    font-family: var(--font-heading);
}

.tag-save {
    top: 30px;
    left: 0;
    transform: rotate(-5deg);
}

.tag-price {
    bottom: 20px;
    right: -2px;
    transform: rotate(4deg);
}

.tag-price small {
    color: #6C8B4C;
    font-weight: 700;
}

/* Destellos */

.art-spark {
    position: absolute;
    color: #7E964B;
    font-size: 27px;
}

.spark-one {
    top: 28px;
    right: 28px;
}

.spark-two {
    bottom: 40px;
    left: 20px;
    font-size: 20px;
}


/* ==========================================
   5. CATÁLOGO Y PRODUCTOS
========================================== */

/* Secciones */

.content-section {
    padding: 58px 0 18px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 25px;
}

.section-heading h2,
.detail-copy h2 {
    font: 800 29px/1.2 var(--font-heading);
    letter-spacing: -1px;
    color: var(--green);
    margin: 8px 0;
}

/* Ordenamiento */

.sort-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.sort-control select {
    border: 1px solid var(--line);
    background: white;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--green);
    outline: none;
}

/* Categorías */

.category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 22px;
}

.category-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    color: #687267;
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
}

.category-pill.active,
.category-pill:hover {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

/* Cuadrícula de productos */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
}

.product-card {
    border: 1px solid #ECEDE6;
    background: white;
    border-radius: 19px;
    padding: 12px;
    min-width: 0;
    transition: transform .2s, box-shadow .2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* Imagen del producto */

.product-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 172px;
    border-radius: 13px;
    overflow: hidden;
    background: #F3F3E9;
}

.product-visual .product-emoji {
    font-size: 72px;
    filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .08));
}

/* Etiqueta de producto */

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    border-radius: 7px;
    padding: 5px 7px;
    background: var(--pear);
    color: var(--green);
    font-size: 10px;
    font-weight: 800;
}

/* Favoritos */

.heart-button {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 0;
    background: rgba(255, 255, 255, .9);
    border-radius: 50%;
    width: 31px;
    height: 31px;
    color: var(--green);
    font-size: 17px;
}

.heart-button.saved {
    background: #F9DDE0;
    color: #A63D4B;
}

/* Información del producto */

.product-info {
    padding: 14px 4px 4px;
}

.product-category {
    color: #8A9284;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 9px;
    font-weight: 800;
}

.product-info h3 {
    font: 700 15px/1.35 var(--font-heading);
    margin: 7px 0 9px;
    color: #2B372C;
}

.product-price {
    font: 800 20px/1.2 var(--font-heading);
    color: var(--green);
    letter-spacing: -.5px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 13px;
    font-size: 10px;
    color: #879082;
}

.product-meta .deal {
    color: #688B4D;
    font-weight: 800;
}

/* Acciones de las tarjetas */

.card-actions {
    display: flex;
    gap: 7px;
}

.card-actions .button {
    flex: 1;
    min-height: 37px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 11px;
}

.card-actions .button-secondary {
    background: #F1F3EA;
}

/* Estado vacío */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border: 1px dashed #D9DFD2;
    border-radius: var(--radius);
}

.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    background: var(--pear-light);
    color: var(--green);
    border-radius: 50%;
    font-size: 29px;
}

.empty-state h3 {
    font: 800 20px var(--font-heading);
    margin: 14px 0 8px;
    color: var(--green);
}

.empty-state p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

/* Estado inicial vacío del catálogo */

.products-empty {
    min-height: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 20px;
    border: 1px dashed #D9DFD2;
    background: rgba(255, 255, 255, .68);
    text-align: center;
}

.products-empty h3 {
    margin-top: 0;
}

.products-empty p {
    max-width: 410px;
    line-height: 1.7;
}

/* Carita del estado vacío */

.empty-face {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--pear-light);
    color: var(--green);
    font-family: var(--font-heading);
    font-size: 43px;
    font-weight: 700;
    line-height: 1;
}


/* ==========================================
   6. HISTORIAL Y DETALLE DE PRODUCTOS
========================================== */

/* Historial */

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 17px 20px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.history-item strong {
    color: var(--green);
}

.history-item span {
    font-size: 12px;
    color: var(--muted);
}

/* Panel de detalle */

.detail-panel {
    margin: 48px 0;
    padding: 25px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
}

.detail-layout {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 40px;
    align-items: start;
}

.detail-image {
    min-height: 320px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #F3F3E9;
    font-size: 115px;
}

.detail-copy h2 {
    font-size: 32px;
    margin: 12px 0;
}

.detail-price {
    font: 800 29px var(--font-heading);
    color: var(--green);
    margin: 20px 0 8px;
}

/* Tiendas */

.store-list {
    margin: 22px 0;
    display: grid;
    gap: 9px;
}

.store-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
}

.store-row strong {
    color: var(--green);
}

.inline-message {
    display: block;
    color: #65854C;
    font-size: 12px;
    margin-top: 10px;
}


/* ==========================================
   7. BANNER Y PIE DE PÁGINA
========================================== */

/* Banner inferior */

.bottom-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 58px 0 35px;
    padding: 27px 32px;
    border-radius: 21px;
    background: var(--green);
    color: white;
}

.banner-leaf {
    width: 49px;
    height: 49px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(236, 233, 155, .15);
    color: var(--pear);
    font-size: 28px;
    flex-shrink: 0;
}

.bottom-banner h2 {
    font: 800 19px var(--font-heading);
    margin: 0 0 6px;
}

.bottom-banner p {
    margin: 0;
    color: #D0D9CC;
    font-size: 12px;
}

.bottom-banner .button {
    margin-left: auto;
    flex-shrink: 0;
}

/* Footer */

.footer {
    border-top: 1px solid var(--line);
    padding: 25px clamp(20px, 5.4vw, 86px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #879082;
    font-size: 11px;
}


/* ==========================================
   8. AUTENTICACIÓN - LOGIN
========================================== */

.login-body {
    background: white;
    min-height: 100vh;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Panel de marca */

.login-brand-panel {
    background: var(--green);
    color: white;
    min-height: 100vh;
    padding: 43px clamp(28px, 6vw, 90px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.login-brand-copy {
    position: relative;
    z-index: 2;
    margin: auto 0;
    padding: 55px 0 20px;
}

.login-brand-copy h1 {
    font: 800 clamp(39px, 4.5vw, 61px)/1.08 var(--font-heading);
    letter-spacing: -2.5px;
    color: white;
    margin: 19px 0 16px;
}

.login-brand-copy h1 span {
    color: var(--pear);
}

.login-brand-copy p {
    color: #D2DCCF;
    max-width: 390px;
    line-height: 1.8;
    font-size: 14px;
}

/* Decoración del panel */

.login-decoration {
    position: absolute;
    right: -50px;
    bottom: 80px;
    width: 260px;
    height: 240px;
    opacity: .95;
}

.login-orbit {
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(236, 233, 155, .28);
    border-radius: 50%;
    transform: rotate(-25deg) scaleY(.7);
}

.login-leaf {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--pear);
    font-size: 160px;
    transform: rotate(15deg);
}

.login-mini-card {
    position: absolute;
    bottom: 0;
    left: -55px;
    background: white;
    color: var(--green);
    padding: 13px 16px;
    border-radius: 13px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 10px;
}

.login-mini-card strong {
    color: #75934F;
    font-size: 20px;
}

.panel-note {
    font-size: 11px;
    color: #C2CEBE;
}

/* Panel del formulario */

.login-form-panel {
    display: grid;
    place-items: center;
    padding: 50px 28px;
}

.login-form-wrap {
    width: min(400px, 100%);
}

.login-form-wrap>.back-link {
    margin-bottom: 50px;
}

.login-form-wrap h2 {
    font: 800 32px var(--font-heading);
    letter-spacing: -1px;
    color: var(--green);
    margin: 12px 0 8px;
}

.login-form-wrap>.muted {
    margin-bottom: 29px;
}

/* Formulario de autenticación */

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form>label,
.password-label label {
    color: #39463A;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 9px;
}

.auth-form input[type="email"],
.password-wrap input {
    width: 100%;
    border: 1px solid #E1E5DC;
    background: #FDFDFB;
    border-radius: 11px;
    min-height: 49px;
    padding: 0 14px;
    outline: none;
    color: var(--ink);
    font-size: 13px;
}

.auth-form input:focus {
    border-color: #8AA16B;
    box-shadow: 0 0 0 3px rgba(138, 161, 107, .12);
}

.auth-form input.invalid {
    border-color: #C65E61;
}

/* Contraseña */

.password-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 19px;
}

.password-label a {
    color: #678449;
    font-size: 11px;
    font-weight: 700;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 55px;
}

.toggle-password {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #6C7D62;
    font-size: 11px;
    font-weight: 700;
}

/* Errores */

.field-error {
    color: #B54E51;
    font-size: 10px;
    min-height: 14px;
    padding-top: 4px;
}

/* Recordar sesión */

.remember-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 9px 0 21px;
    color: #707B6F !important;
    font-weight: 400 !important;
    font-size: 11px !important;
}

.remember-check input {
    accent-color: var(--green);
}

/* Separador */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 23px 0;
    color: #9A9F95;
    font-size: 10px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E9EBE5;
}

/* Enlace de registro */

.signup-note {
    text-align: center;
    color: #778075;
    font-size: 11px;
    margin-top: 24px;
}

.signup-note a {
    color: #678449;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}

.signup-note a:hover {
    color: var(--green);
    text-decoration: underline;
}

/* Notas informativas */

.prototype-note {
    color: #A0A69B;
    font-size: 10px;
    text-align: center;
    margin-top: 29px;
}

.mobile-brand {
    display: none;
}


/* ==========================================
   9. AUTENTICACIÓN - REGISTRO
========================================== */

/* Campos del registro */

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"] {
    width: 100%;
    min-height: 49px;
    padding: 0 14px;
    border: 1px solid #E1E5DC;
    border-radius: 11px;
    background: #FDFDFB;
    color: var(--ink);
    font-size: 13px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.register-form input[type="text"]:focus,
.register-form input[type="email"]:focus,
.register-form input[type="password"]:focus {
    border-color: #8AA16B;
    box-shadow: 0 0 0 3px rgba(138, 161, 107, .12);
}

.register-form input.invalid {
    border-color: #C65E61;
}

/* Espaciado de campos */

.register-form>label:not(.terms-check) {
    margin-top: 17px;
}

.register-form>label:first-child {
    margin-top: 0;
}

/* Errores del registro */

.register-form .field-error {
    display: block;
    min-height: 14px;
    padding-top: 4px;
    color: #B54E51;
    font-size: 10px;
}

/* Términos y condiciones */

.register-form .terms-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 18px 0 8px;
    color: #778075;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.6;
}

.register-form .terms-check input[type="checkbox"] {
    flex-shrink: 0;
    margin: 3px 0 0;
    accent-color: var(--green);
}

/* Mensajes del registro */

.register-form .register-feedback {
    margin: 8px 0 10px;
}

.register-form .register-feedback.error {
    color: #B54E51;
}

.register-form .register-feedback.success {
    color: #65854C;
}

.register-form .register-feedback.info {
    color: #778075;
}


/* ==========================================
   10. AUTENTICACIÓN EN DOS PASOS - 2FA
========================================== */

/* Página de seguridad */

.security-page {
    min-height: 100vh;
    padding: 45px 22px;
    align-items: flex-start;
}

.security-wrap {
    width: min(620px, 100%);
    margin: 0 auto;
}

.security-wrap h2 {
    color: var(--green);
    font: 800 32px/1.2 var(--font-heading);
    margin: 16px 0 10px;
}

/* Tarjetas de seguridad */

.security-card {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.security-card-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
}

.security-icon,
.authenticator-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--green-soft);
    font-size: 23px;
}

.security-card-heading h3,
.security-setup h3,
.security-recovery h3 {
    margin: 0 0 5px;
    color: var(--green);
    font-size: 17px;
}

.security-card-heading p {
    margin: 0;
    font-size: 12px;
}

/* Estado de seguridad */

.security-status {
    margin-left: auto;
    padding: 7px 10px;
    border-radius: 20px;
    background: #F5F0E5;
    color: #88713E;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.security-status.active {
    background: #E5F0DF;
    color: #527342;
}

/* Textos */

.security-card>p,
.security-setup>p,
.security-recovery>p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Configuración y recuperación */

.security-setup,
.security-recovery {
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

/* Código QR */

.qr-placeholder {
    width: 190px;
    height: 190px;
    margin: 22px auto;
    border: 2px dashed #B8C5AC;
    border-radius: 15px;
    background: #F8F9F3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--green);
}

.qr-placeholder span {
    font-size: 38px;
    font-weight: 800;
}

.qr-placeholder small {
    font-size: 10px;
    color: var(--muted);
}

.security-help {
    text-align: center;
    font-size: 11px !important;
}

/* Clave secreta */

.secret-box {
    padding: 14px;
    margin: 18px 0;
    border-radius: 11px;
    background: #F6F7F1;
}

.secret-box label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 8px;
}

.secret-value {
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Campos de autenticación */

.security-setup .auth-form input,
#twoFactorForm input,
#recoveryCodeForm input {
    width: 100%;
    min-height: 49px;
    border: 1px solid #E1E5DC;
    border-radius: 11px;
    background: #FDFDFB;
    padding: 0 14px;
    font-size: 15px;
    letter-spacing: 2px;
}

/* Campo del código 2FA */

#authCode,
#twoFactorForm input {
    text-align: center;
    font-size: 23px;
    letter-spacing: 9px;
    font-weight: 700;
}

#authCode:focus,
#twoFactorForm input:focus,
.security-setup input:focus,
#recoveryCodeForm input:focus {
    outline: none;
    border-color: #8AA16B;
    box-shadow: 0 0 0 3px rgba(138, 161, 107, .12);
}

#authCode.invalid,
#twoFactorForm input.invalid,
.security-setup input.invalid {
    border-color: #C65E61;
}

#recoveryCodeSection {
    margin-top: 20px;
}

#twoFactorForm input {
    margin-bottom: 8px;
}

/* Icono de autenticador */

.authenticator-icon {
    width: 64px;
    height: 64px;
    margin: 24px auto;
    font-size: 30px;
}

/* Placeholder de códigos de recuperación */

.recovery-placeholder {
    padding: 18px;
    border: 1px dashed #B8C5AC;
    border-radius: 12px;
    background: #F8F9F3;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* Asegurar que hidden prevalezca en elementos con estilos propios */

[hidden] {
    display: none !important;
}


/* ==========================================
   11. MODAL DE CONFIRMACIÓN
========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(27, 48, 33, .55);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 35px;
    border-radius: 24px;
    background: var(--paper);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    animation: modalAppear .2s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    border: none;
    background: transparent;
    font-size: 27px;
    color: var(--muted);
    cursor: pointer;
}

.modal-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    font-size: 26px;
}

.modal-card h2 {
    margin-bottom: 12px;
    color: var(--green);
}

.modal-card p {
    margin-bottom: 25px;
    color: var(--muted);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Animación de aparición */

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ==========================================
   12. PAGINACIÓN
========================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 35px 0;
}

.pagination-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.pagination-button,
.pagination-number {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--green);
    cursor: pointer;
}

.pagination-number.active {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.pagination-button:disabled {
    opacity: .4;
    cursor: not-allowed;
}


/* ==========================================
   13. RESPONSIVE - TABLET
========================================== */

@media (max-width: 900px) {

    /* Cabecera */

    .topbar {
        padding: 18px 24px;
        flex-wrap: wrap;
        gap: 14px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        margin: 0;
    }

    .nav-link {
        flex: 1;
    }

    /* Hero */

    .hero {
        grid-template-columns: 1fr .7fr;
        padding: 42px 5%;
    }

    .hero-art {
        transform: scale(.85);
    }

    /* Productos */

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Login */

    .login-brand-panel {
        padding: 35px;
    }

    .login-brand-copy h1 {
        font-size: 43px;
    }
}


/* ==========================================
   14. RESPONSIVE - MÓVILES
========================================== */

@media (max-width: 620px) {

    /* Contenedor general */

    .page-wrap {
        width: min(100% - 28px, 480px);
    }

    /* Cabecera */

    .topbar {
        padding: 17px 16px;
    }

    .brand {
        font-size: 25px;
    }

    .user-greeting {
        display: none;
    }

    /* Hero */

    .hero {
        margin-top: 14px;
        padding: 34px 23px 18px;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .hero h1 {
        font-size: 39px;
        letter-spacing: -1.7px;
    }

    .hero-copy>p {
        font-size: 13px;
    }

    /* Buscador */

    .search-form {
        gap: 5px;
        flex-wrap: wrap;
    }

    .search-form .button {
        padding: 0 13px;
    }

    .search-form #searchInput {
        flex: 1 1 55%;
    }

    .search-form #budgetInput {
        flex: 1 1 35%;
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 10px 8px;
    }

    .search-form button {
        flex: 1 1 100%;
    }

    /* Ilustración */

    .hero-art {
        min-height: 245px;
        transform: scale(.82);
        margin: -5px 0 -18px;
    }

    /* Catálogo */

    .content-section {
        padding-top: 40px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .section-heading h2 {
        font-size: 25px;
    }

    .sort-control {
        width: 100%;
        justify-content: space-between;
    }

    .sort-control select {
        flex: 1;
        max-width: 220px;
    }

    .category-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .category-pill {
        white-space: nowrap;
    }

    /* Tarjetas de productos */

    .product-grid {
        gap: 10px;
    }

    .product-card {
        padding: 8px;
        border-radius: 15px;
    }

    .product-visual {
        min-height: 135px;
    }

    .product-visual .product-emoji {
        font-size: 55px;
    }

    .product-info h3 {
        font-size: 13px;
    }

    .product-price {
        font-size: 17px;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-actions .button {
        min-height: 34px;
    }

    /* Banner inferior */

    .bottom-banner {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 22px;
        margin: 35px 0 25px;
    }

    .bottom-banner>div:nth-child(2) {
        flex: 1;
        min-width: 180px;
    }

    .bottom-banner .button {
        margin-left: 0;
        width: 100%;
    }

    /* Footer */

    .footer {
        padding: 22px 18px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .footer>span {
        width: calc(100% - 5px);
    }

    /* Detalle de producto */

    .detail-panel {
        padding: 17px;
        margin-top: 30px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 23px;
    }

    .detail-image {
        min-height: 230px;
        font-size: 90px;
    }

    /* Historial */

    .history-item {
        align-items: flex-start;
        flex-direction: column;
    }

    /* Login */

    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: auto;
        padding: 25px 25px 30px;
    }

    .login-brand-copy {
        padding: 35px 0 5px;
        margin: 0;
    }

    .login-brand-copy h1 {
        font-size: 36px;
        margin: 13px 0;
    }

    .login-brand-copy p {
        font-size: 12px;
        margin-bottom: 0;
    }

    .login-decoration {
        width: 130px;
        height: 130px;
        right: -20px;
        bottom: 12px;
        opacity: .35;
    }

    .login-leaf {
        font-size: 90px;
    }

    .login-mini-card,
    .panel-note {
        display: none;
    }

    .login-form-panel {
        padding: 35px 24px;
    }

    .login-form-wrap>.back-link {
        margin-bottom: 28px;
    }

    .login-form-wrap h2 {
        font-size: 29px;
    }

    .mobile-brand {
        display: none;
    }

    /* Registro */

    .register-form>label:not(.terms-check) {
        margin-top: 15px;
    }

    .register-form>label:first-child {
        margin-top: 0;
    }

    /* Autenticación en dos pasos */

    .security-page {
        padding: 28px 16px;
    }

    .security-card,
    .security-setup,
    .security-recovery {
        padding: 18px;
    }

    .security-card-heading {
        flex-wrap: wrap;
    }

    .security-status {
        margin-left: 60px;
    }
}


/* ==========================================
   15. PREFERENCIAS DE ACCESIBILIDAD
========================================== */

/* Respetar la preferencia de movimiento reducido */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}