/* =========================================
   cuenta.php: cuenta de cliente (no embajadores)
   Acceso, registro, verificación de correo y "Mis pedidos"
========================================= */

body { margin: 0; background: #f4f7f2; font-family: 'Segoe UI', Arial, sans-serif; }

.yx-cab {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 28px; background: #fff; border-bottom: 1px solid #e8e6dd;
    flex-wrap: wrap; gap: 12px;
}
.yx-cab .marca {
    color: #2f4a27; font-size: 20px; letter-spacing: 4px;
    font-weight: 700; text-decoration: none;
}
.yx-cab nav a { color: #667a60; text-decoration: none; font-size: 14px; margin-left: 20px; }
.yx-cab nav a:hover { color: #2f4a27; }

.yx-main { max-width: 880px; margin: 0 auto; padding: 40px 20px 70px; }

/* ---- Acceso / registro ---- */
.yx-card {
    background: #fff; border-radius: 16px; padding: 36px 32px;
    box-shadow: 0 8px 24px rgba(0,0,0,.05); max-width: 460px; margin: 0 auto;
}
.yx-card h1 { color: #2f4a27; font-size: 22px; margin: 0 0 8px; }
.yx-card > p { color: #667a60; font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.yx-card label {
    display: block; font-size: 12px; text-transform: uppercase;
    letter-spacing: .06em; color: #8a8a8a; margin-bottom: 6px;
}
.yx-card input {
    width: 100%; box-sizing: border-box; padding: 12px 14px;
    border: 1px solid #e2e0d9; border-radius: 10px;
    font-size: 15px; font-family: inherit; margin-bottom: 16px;
}
.yx-card input:focus { outline: 2px solid #4c7a3f; border-color: #4c7a3f; }
.yx-card button {
    width: 100%; padding: 13px; border: 0; border-radius: 28px;
    background: #4c7a3f; color: #fff; font-size: 15px;
    font-weight: 600; cursor: pointer; font-family: inherit;
}
.yx-card button:hover { background: #3d6332; }
.yx-pestanas { display: flex; gap: 8px; margin-bottom: 26px; }
.yx-pestanas a {
    flex: 1; text-align: center; padding: 11px; border-radius: 24px;
    text-decoration: none; font-size: 14px; font-weight: 600;
    background: #f4f7f2; color: #8a8a8a;
}
.yx-pestanas a.activa { background: #2f4a27; color: #fff; }
.yx-pie-card {
    margin-top: 20px; padding-top: 18px; border-top: 1px solid #f0efe9;
    text-align: center; font-size: 13px; color: #8a8a8a;
}
.yx-pie-card a { color: #4c7a3f; font-weight: 600; text-decoration: none; }
.yx-pista {
    background: #f4f7f2; border-radius: 8px; padding: 11px 14px;
    font-size: 12.5px; color: #667a60; line-height: 1.55; margin-bottom: 18px;
}

/* ---- Panel ---- */
.yx-saludo { margin-bottom: 28px; }
.yx-saludo p.eyebrow {
    text-transform: uppercase; letter-spacing: .12em; font-size: .72rem;
    font-weight: 700; color: #8c6a22; margin: 0 0 6px;
}
.yx-saludo h1 { color: #2f4a27; font-size: 26px; margin: 0 0 6px; }
.yx-saludo span { color: #667a60; font-size: 14px; }

.yx-estado {
    display: inline-block; padding: 5px 13px; border-radius: 14px;
    font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
}

.yx-vacio {
    background: #fff; border: 1px dashed #ddd9c9; border-radius: 14px;
    padding: 52px 24px; text-align: center; color: #8a8a8a;
}
.yx-vacio h2 { color: #2f4a27; font-size: 18px; margin: 12px 0 8px; }
.yx-vacio a {
    display: inline-block; margin-top: 16px; padding: 12px 30px;
    background: #4c7a3f; color: #fff; text-decoration: none;
    border-radius: 26px; font-weight: 600; font-size: 14px;
}

.yx-aviso {
    background: #faf6e6; border-left: 4px solid #c99a2e; color: #6b5518;
    padding: 14px 18px; border-radius: 8px; font-size: 14px;
    line-height: 1.6; margin-bottom: 22px;
}
.yx-aviso form { display: inline; }
.yx-aviso button {
    background: none; border: 0; padding: 0; color: #8c6a22;
    font-weight: 700; text-decoration: underline; cursor: pointer;
    font-size: 14px; font-family: inherit;
}
.yx-error {
    background: #fdecea; border-left: 4px solid #b3452f; color: #7a2f1e;
    padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px;
}
.yx-ok {
    background: #eef5ea; border-left: 4px solid #4c7a3f; color: #2f4a27;
    padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px;
}
.yx-volver { display: inline-block; margin-bottom: 18px; color: #4c7a3f; text-decoration: none; font-size: 14px; }

/* =========================================
   MIS PEDIDOS: tarjetas
========================================= */
.yx-seccion {
    display: flex; align-items: center; gap: 10px;
    margin: 6px 0 16px; color: #2f4a27; font-size: 18px;
}
.yx-seccion span {
    display: inline-grid; place-items: center; min-width: 26px; height: 26px;
    padding: 0 8px; box-sizing: border-box; border-radius: 13px;
    background: #e6efe1; color: #2f4a27; font-size: 13px; font-weight: 700;
}

.yx-tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    align-items: start;
    gap: 16px;
}

.yx-tarjeta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 18px 16px;
    border: 1px solid #e8e6dd;
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(20, 30, 20, .04), 0 6px 18px rgba(20, 30, 20, .05);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.yx-tarjeta[hidden] { display: none; }
.yx-tarjeta:hover {
    transform: translateY(-2px);
    border-color: #cfd8c7;
    box-shadow: 0 2px 4px rgba(20, 30, 20, .05), 0 14px 30px rgba(20, 30, 20, .09);
}
.yx-tarjeta:focus-visible {
    outline: 3px solid rgba(76, 122, 63, .4);
    outline-offset: 2px;
}

.yx-tarjeta-top {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 6px 10px;
}
.yx-tarjeta-folio { font-weight: 700; font-size: 15px; color: #2f4a27; white-space: nowrap; }
.yx-tarjeta-fecha {
    display: flex; align-items: center; gap: 6px; margin-top: -4px;
    font-size: 13px; color: #8a8a8a;
}
.yx-tarjeta-fecha svg { flex-shrink: 0; width: 14px; height: 14px; }

/* Fotos de los productos encimadas */
.yx-minis { display: flex; align-items: center; min-height: 46px; }
.yx-mini {
    display: grid; place-items: center;
    width: 46px; height: 46px; margin-left: -8px;
    overflow: hidden; box-sizing: border-box;
    border: 2px solid #fff; border-radius: 12px;
    background: #f4f7f2; color: #a9ada5;
    box-shadow: 0 0 0 1px #e8e6dd;
}
.yx-mini:first-child { margin-left: 0; }
.yx-mini img { width: 100%; height: 100%; padding: 3px; box-sizing: border-box; object-fit: contain; }
.yx-mini svg { width: 20px; height: 20px; }
.yx-mini.is-mas { font-size: 13px; font-weight: 700; color: #2f4a27; background: #e6efe1; }
.yx-minis-vacio { font-size: 13px; color: #8a8a8a; }

.yx-tarjeta-pie {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
    padding-top: 12px; border-top: 1px solid #f0efe9;
}
.yx-tarjeta-total { display: flex; flex-direction: column; gap: 2px; }
.yx-tarjeta-total small { font-size: 12.5px; color: #8a8a8a; }
.yx-tarjeta-total strong { font-size: 17px; color: #2f4a27; }
.yx-tarjeta-ver {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 13px; font-weight: 600; color: #4c7a3f; white-space: nowrap;
}
.yx-tarjeta-ver svg { width: 16px; height: 16px; transition: transform .2s ease; }
.yx-tarjeta:hover .yx-tarjeta-ver svg { transform: translateX(3px); }

/* Botón "Ver más pedidos" */
.yx-mas { display: flex; justify-content: center; margin-top: 24px; }
.yx-mas-boton {
    padding: 12px 26px; border: 1px solid #4c7a3f; border-radius: 26px;
    background: #fff; color: #2f4a27; font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .2s ease;
}
.yx-mas-boton:hover { background: #eef5ea; }
.yx-mas-boton:focus-visible { outline: 3px solid rgba(76, 122, 63, .35); outline-offset: 3px; }

/* =========================================
   DETALLE DEL PEDIDO (ventana y página)
========================================= */
.yx-det-cab {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 18px 22px; background: #f4f7f2; border-bottom: 1px solid #e8e6dd;
}
.yx-det-folio { margin: 0; color: #2f4a27; font-size: 19px; }
.yx-det-fecha {
    display: flex; align-items: center; gap: 6px;
    margin: 4px 0 0; font-size: 13.5px; color: #8a8a8a;
}
.yx-det-fecha svg { flex-shrink: 0; width: 15px; height: 15px; }

.yx-det-items { margin: 0; padding: 6px 22px; list-style: none; }
.yx-det-item {
    display: grid; grid-template-columns: 56px 1fr auto;
    align-items: center; gap: 14px; padding: 12px 0;
}
.yx-det-item + .yx-det-item { border-top: 1px dashed #e8e6dd; }
.yx-det-img {
    display: grid; place-items: center; width: 56px; height: 56px;
    overflow: hidden; border-radius: 12px; background: #f4f7f2; color: #a9ada5;
}
.yx-det-img img { width: 100%; height: 100%; padding: 4px; box-sizing: border-box; object-fit: contain; }
.yx-det-img svg { width: 24px; height: 24px; }
.yx-det-info { min-width: 0; }
.yx-det-nombre { margin: 0; font-weight: 600; line-height: 1.3; color: #2f4a27; overflow-wrap: anywhere; }
.yx-det-cant { display: block; margin-top: 2px; font-size: 13px; color: #8a8a8a; }
.yx-det-importe { font-weight: 600; color: #2f4a27; white-space: nowrap; }
.yx-det-vacio { margin: 0; padding: 18px 22px; font-size: 14px; color: #8a8a8a; }

.yx-det-pie {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 22px; border-top: 1px solid #e8e6dd; font-size: 14px; color: #8a8a8a;
}
.yx-det-total strong { margin-left: 6px; font-size: 18px; color: #2f4a27; }
.yx-det-ref { margin: 0; padding: 0 22px 16px; font-size: 12.5px; color: #8a8a8a; }

/* Detalle como página (cuenta.php?pedido=ID) */
.yx-det-pagina {
    overflow: hidden; background: #fff;
    border: 1px solid #e8e6dd; border-radius: 16px;
}

/* ---------- La ventana ---------- */
.yx-dialogo {
    width: min(620px, calc(100% - 32px));
    max-width: none;
    max-height: min(86vh, 860px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: #fff;
    color: #2f4a27;
    box-shadow: 0 24px 64px rgba(15, 25, 15, .3);
}
.yx-dialogo[open] {
    display: flex;
    flex-direction: column;
    animation: yx-cuenta-entrar .22s ease-out;
}
.yx-dialogo::backdrop {
    background: rgba(18, 24, 18, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.yx-dialogo-cuerpo {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
/* El encabezado se queda fijo arriba mientras bajas por los productos */
.yx-dialogo .yx-det-cab {
    position: sticky; top: 0; z-index: 1;
    padding-right: 68px;
}
.yx-dialogo-cerrar {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    display: grid; place-items: center;
    width: 36px; height: 36px; padding: 0;
    border: 1px solid #e8e6dd; border-radius: 50%;
    background: #fff; color: #2f4a27;
    font-size: 22px; line-height: 1; cursor: pointer;
    transition: background .2s ease;
}
.yx-dialogo-cerrar:hover { background: #f4f7f2; }
.yx-dialogo-cerrar:focus-visible { outline: 3px solid rgba(76, 122, 63, .4); outline-offset: 2px; }

/* Que la página de atrás no se mueva mientras la ventana está abierta */
html.yx-dialogo-abierto { overflow: hidden; }

@keyframes yx-cuenta-entrar {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes yx-cuenta-subir {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

/* ---------- Celular ---------- */
@media (max-width: 560px) {
    .yx-cab { padding: 16px 20px; }
    .yx-cab nav a { margin-left: 14px; }
    .yx-tarjetas { gap: 14px; }

    .yx-det-cab { flex-direction: column; gap: 10px; padding: 16px; }
    .yx-det-items { padding: 4px 16px; }
    .yx-det-item { grid-template-columns: 48px 1fr auto; gap: 12px; }
    .yx-det-img { width: 48px; height: 48px; }
    .yx-det-pie, .yx-det-vacio { padding-left: 16px; padding-right: 16px; }
    .yx-det-ref { padding: 0 16px 16px; }

    /* En celular la ventana sube desde abajo */
    .yx-dialogo {
        width: 100%;
        max-height: 88vh;
        margin: auto 0 0;
        border-radius: 20px 20px 0 0;
    }
    .yx-dialogo[open] { animation: yx-cuenta-subir .26s ease-out; }
    .yx-dialogo .yx-det-cab { padding-right: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    .yx-tarjeta, .yx-tarjeta-ver svg { transition: none; }
    .yx-tarjeta:hover, .yx-tarjeta:hover .yx-tarjeta-ver svg { transform: none; }
    .yx-dialogo[open] { animation: none; }
}