/**
 * Cliente Authentication System Styles
 * Login/Register Modal and Account Page
 */

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: relative;
    height: 100%;
    touch-action: pan-y;
}

/* Ensure modals are scrollable */
.cliente-modal {
    overflow: hidden;
}

/* overflow:clip instead of hidden — both clip visually, but clip does NOT create a
   scroll container. iOS Safari blocks touch-scroll on overflow:auto descendants of
   any position:fixed + overflow:hidden ancestor. overflow:clip avoids that bug. */
#cuenta-modal {
    overflow: clip;
}

/* ===========================
   LOGIN/REGISTER MODAL
   =========================== */

/* Match lity overlay: same background as .lity-wrap::before, centering as info_content */
.cliente-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--color-primary), white 90%) 0, white 50%);
    z-index: 5555555;
    overflow: hidden;
}

/* Same background as .lity-wrap:before */
.cliente-modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.cliente-modal .cliente-modal-content {
    z-index: 1;
}

/* Match .info_container inside lity: same box, shadow, radius, max-width. Slide from right like lity-content. */
.cliente-modal-content {
    background: white;
    color: var(--text-color, #333);
    margin: auto;
    border-radius: 2rem;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto !important;
    overflow-x: hidden;
    position: relative;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease-out;
    transform: translate3d(100vw, 0, 0);
    opacity: 0.65;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 2rem;
    padding: 2rem;
    box-shadow: 0px 0rem 1rem 0px #00000021;
}

.cliente-modal.lity-opened .cliente-modal-content {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.cliente-modal.cliente-modal-closing .cliente-modal-content {
    transform: translate3d(100vw, 0, 0);
    opacity: 0.65;
}

/* Placement only — circle + icon from css/close-button.css */
.cliente-modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 999;
    transition: 0.6s;
}

.cliente-modal-close:hover::before,
.cliente-modal-close:focus::before {
    background: var(--color-primary);
}

/* Logo before tabs – same as #page_options_box */
.cliente-auth-modal-branding.menu-branding {
    max-width: 250px;
    max-height: none;
    margin: 0 auto 2rem;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cliente-auth-modal-branding.menu-branding img {
    width: 100%;
    height: auto;
}

/* Light theme: only logo_claro (override any .menu-branding img display) */
.cliente-auth-modal-branding.menu-branding .logo_claro {
    display: block;
}

.cliente-auth-modal-branding.menu-branding .logo_oscuro {
    display: none;
}

.cliente-auth-modal-branding.menu-branding .branding_icon_claro,
.cliente-auth-modal-branding.menu-branding .branding_icon_oscuro {
    display: none !important;
}

@media (max-width: 539px) {
    .cliente-auth-modal-branding.menu-branding:has(.branding_icon_claro) .logo_claro,
    .cliente-auth-modal-branding.menu-branding:has(.branding_icon_claro) .logo_oscuro {
        display: none !important;
    }

    .cliente-auth-modal-branding.menu-branding:has(.branding_icon_claro) .branding_icon_claro,
    .cliente-auth-modal-branding.menu-branding:has(.branding_icon_claro) .branding_icon_oscuro {
        display: block !important;
    }

    /* Same specificity issue as .site-header__bar: theme must beat the pair rule above */
    [data-theme="light"] #cliente-auth-modal .cliente-auth-modal-branding .branding_icon_oscuro,
    html:not([data-theme="dark"]) #cliente-auth-modal .cliente-auth-modal-branding .branding_icon_oscuro {
        display: none !important;
    }

    [data-theme="dark"] #cliente-auth-modal .cliente-auth-modal-branding .branding_icon_claro {
        display: none !important;
    }
}

/* Dark theme: match [data-theme="dark"] .info_container and .lity-wrap:before */
[data-theme="dark"] #cliente-auth-modal.cliente-modal {
    background: rgb(55, 55, 55);
}

[data-theme="dark"] #cliente-auth-modal.cliente-modal::before {
    content: "";
    display: none !important;
}

[data-theme="dark"] #cliente-auth-modal .cliente-modal-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

[data-theme="dark"] #cliente-auth-modal .cliente-modal-close {
    background-color: #4e4e4e;
    border: 1px solid rgba(255, 255, 255, 0.13);
}

[data-theme="dark"] #cliente-auth-modal .cliente-modal-close::before {
    background: #4e4e4e;
}

[data-theme="dark"] #cliente-auth-modal .cliente-modal-close:hover::before,
[data-theme="dark"] #cliente-auth-modal .cliente-modal-close:focus::before {
    background: var(--color-primary);
}

[data-theme="dark"] #cliente-auth-modal .cliente-auth-modal-branding .logo_claro {
    display: none;
}

[data-theme="dark"] #cliente-auth-modal .cliente-auth-modal-branding .logo_oscuro {
    display: block;
}

[data-theme="dark"] #cliente-auth-modal .cliente-auth-modal-branding .branding_icon_claro {
    display: none !important;
}

[data-theme="dark"] #cliente-auth-modal .cliente-auth-modal-branding .branding_icon_oscuro {
    display: block !important;
}



/* Tabs - spacing consistent with info_container inner layout */
.cliente-auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    padding: 0 0 2rem 0;
}

.cliente-tab-btn {
    flex: 1;
    padding: 1.5rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-color-muted, #666);
    transition: all 0.3s;
}

.cliente-tab-btn:hover {
    color: var(--accent-color, #2271b1);
}

.cliente-tab-btn.active {
    color: var(--accent-color, #2271b1);
    border-bottom-color: var(--accent-color, #2271b1);
}

/* Forms */
.cliente-auth-form {
    display: none;
    padding: 0;
}

.cliente-auth-form.active {
    display: block;
}

.cliente-auth-form h2 {
    margin: 1rem 0 2rem 0;
    font-size: 2.4rem;
    color: var(--text-color, #333);
    letter-spacing: -0.5px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--text-color, #333);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 1rem;
    font-size: 1.6rem;
    background-color: var(--input-background, #fff);
    color: var(--text-color, #333);
    transition: border-color 0.3s;
    box-shadow: 0 1px 4px rgb(0 0 0 / 20%) inset;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color, #2271b1);
}

.form-message {
    margin: 0 0 2rem;
}

.form-message p {
    margin: 0;
    padding: 1rem 1.5rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    line-height: 1.6rem;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-submit {
    width: 100%;
    padding: 1.5rem 2rem;
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #616161 10%);
    color: var(--button-text-color-oscuro);
    border: none;
    border-radius: 5rem;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    margin-top: 1r0em;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cliente-auth-otp-hint {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--text-muted-color, #666);
}

.cliente-auth-back-email {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--color-primary, #333);
    font-size: 1.1rem;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
}

.cliente-auth-back-email:hover {
    opacity: 0.85;
}

/* Social login buttons */
.cliente-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    background: var(--background-color, #fff);
    color: var(--text-color, #333);
}

.btn-social .btn-social-icon {
    width: 1.8rem;
    height: 1.8rem;
    flex-shrink: 0;
}

.btn-google:hover {
    background: #f8f8f8;
    border-color: #dadce0;
}

.btn-facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #fff;
}

.cliente-social-divider {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 1.4rem;
    color: var(--text-color-muted, #666);
}

#social-complete-profile-form .form-description {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: var(--text-color-muted, #666);
}

.form-group .required {
    color: #c00;
}

/* ===========================
   NO PASSWORD OPTIONS
   =========================== */

.info-message {
    background-color: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
    padding: 1rem 1.5rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.no-password-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.btn-option {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.8rem 2.5rem;
    background: var(--background-color, #fff);
    border: 2px solid var(--accent-color, #2271b1);
    border-radius: 1.2rem;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent-color, #2271b1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.btn-option i {
    font-size: 2.4rem;
}

.btn-option:hover {
    background: var(--accent-color, #2271b1);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-back {
    width: 100%;
    padding: 1.2rem 2rem;
    background: transparent;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color-muted, #666);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1.5rem;
}

.btn-back:hover {
    border-color: var(--accent-color, #2271b1);
    color: var(--accent-color, #2271b1);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--accent-color, #2271b1);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 1rem;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.btn-link:hover {
    color: var(--accent-color-dark, #1a5a8a);
}

.btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* OTP Code Input Styling */
input[type="text"][maxlength="6"] {
    text-align: center;
    font-size: 2.4rem;
    letter-spacing: 0.8rem;
    font-weight: bold;
    padding: 1.5rem;
}

/* Small helper text */
.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.2rem;
    color: var(--text-color-muted, #666);
    font-style: italic;
}

/* Account Info Display */
.account-info {
    background: var(--background-color-secondary, #f8f9fa);
    border-left: 4px solid var(--accent-color, #2271b1);
    padding: 1.5rem 2rem;
    border-radius: 0.8rem;
    margin-bottom: 2rem;
}

.account-info p {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-color, #333);
}

.account-info strong {
    color: var(--accent-color, #2271b1);
}

/* Alternative Link Button */
.btn-link-alt {
    background: transparent;
    border: none;
    color: var(--accent-color, #2271b1);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    padding: 1rem 0;
    margin-top: 1rem;
    transition: color 0.3s;
    text-align: center;
}

.btn-link-alt:hover {
    color: var(--accent-color-dark, #1a5a8a);
    text-decoration: underline;
}

/* ===========================
   CUENTA MODAL
   =========================== */

.cuenta-modal-content {
    /* iOS Safari note: NO will-change / backface-visibility / translate3d here.
       This element is the ancestor of #cuenta-modal-body, the touch-scroll
       container. Any compositing-trigger left on this element prevents iOS
       from routing touch-scroll events to descendants. translateX (no z) is
       enough for the slide-in animation; the GPU layer is created lazily
       during the transition and released when transform returns to none. */
    background: transparent;
    color: var(--text-color, #333);
    margin: 0;
    padding: 0;
    border-radius: 0;
    max-width: 1200px;
    width: 95%;
    max-height: 100vh;
    height: 100vh;
    position: relative;
    animation: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease-out;
    transform: translateX(100vw);
    opacity: 0;
}

#cuenta-modal.lity-preopen .cuenta-modal-content {
    transform: translateX(100vw);
    opacity: 0;
}

#cuenta-modal {
    align-items: stretch;
    touch-action: pan-y;
}

#cuenta-modal.lity-opened .cuenta-modal-content {
    transform: none;
    opacity: 1;
}

#cuenta-modal.cliente-modal-closing .cuenta-modal-content {
    transform: translateX(100vw);
    opacity: 0.65;
}

.cuenta-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    display: none
}

.cuenta-modal-header h2 {
    margin: 0;
    font-size: 2.4rem;
    color: var(--text-color, #333);
}

#cuenta-modal-body {
    overflow-x: hidden;
    flex: 1;
    padding: 0;
    opacity: 1;
    transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

#cuenta-modal-body.is-switching-out {
    opacity: 0;
    transform: translate3d(-1rem, 0, 0);
}

#cuenta-modal-body.is-switching-in {
    opacity: 0;
    transform: translate3d(1rem, 0, 0);
}

/* Custom scrollbar for modal content */
#cuenta-modal-body::-webkit-scrollbar,
.cliente-modal-content::-webkit-scrollbar {
    width: 8px;
}

#cuenta-modal-body::-webkit-scrollbar-track,
.cliente-modal-content::-webkit-scrollbar-track {
    background: var(--background-light, #f5f5f5);
    border-radius: 4px;
}

#cuenta-modal-body::-webkit-scrollbar-thumb,
.cliente-modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color, #ccc);
    border-radius: 4px;
}

#cuenta-modal-body::-webkit-scrollbar-thumb:hover,
.cliente-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #999);
}

.btn-full-page {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: var(--accent-color, #2271b1);
    color: #fff;
    text-decoration: none;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-full-page:hover {
    background: var(--accent-color-dark, #1a5a8a);
    transform: translateY(-2px);
}

.btn-full-page i {
    font-size: 1.6rem;
}

.cuenta-container-modal {
    display: flex;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    min-height: 0;
    flex-direction: column;
    padding: 0 0 1.5rem;
}

/* Cuenta modal: content is overflow:visible so the single scroll container
   (#cuenta-modal-body) controls all scrolling. #cuenta-modal clips everything. */
#cuenta-modal .cuenta-modal-content {
    box-sizing: border-box;
    position: absolute;
    width: 100%;
    max-width: min(1200px, 100%);
    min-width: 0;
    overflow: visible;
    padding-top: 0;
    top: 0;
}

#cuenta-modal .cliente-modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    left: auto;
    z-index: 1;
}

#cuenta-modal #cuenta-modal-body {
    /* iOS Safari note: -webkit-overflow-scrolling: touch is INTENTIONALLY omitted.
       It's deprecated since iOS 13 and triggers the well-known bug where touch
       scroll fails inside containers whose ancestors have transform/will-change.
       Modern iOS scrolls overflow:auto natively without it. */
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: white;
}

/* --- Cuenta modal: menú raíz + panel deslizante --- */
#cuenta-modal .cuenta-nav-stack {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    /* overflow:visible — the body scroll container handles clipping/scroll.
       The off-screen panel is clipped by the body's overflow-x:hidden. */
    overflow: visible;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: auto;
}

#cuenta-modal .cuenta-nav-root {
    flex: none;
    overflow: visible;
    padding: 3rem;
    transition: opacity 0.28s ease;
    box-sizing: border-box;
}

#cuenta-modal .cuenta-nav-stack.is-subview .cuenta-nav-root {
    opacity: 0.55;
    pointer-events: none;
}

#cuenta-modal .cuenta-root-screen-title {
    margin: 0 0 1.25rem;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-color, #333);
    display: none;
}

#cuenta-modal .cuenta-root-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

#cuenta-modal .cuenta-root-profile .user-avatar {
    width: 10rem;
    height: 10rem;
}

#cuenta-modal .cuenta-root-name {
    margin: 0;
    font-size: 2.85rem;
    font-weight: 700;
    text-align: center;
    line-height: 1;
}

#cuenta-modal .cuenta-root-menu {
    list-style: none;
    margin: 0;
    padding: 1rem 1.5rem;
    border-top: none;
    box-shadow: 0rem 0.5rem 2rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
    border-radius: 2rem;
    background: white;
}

#cuenta-modal .cuenta-root-menu > li {
    margin: 0;
    border-bottom: 0px solid var(--border-color, #e8e8e8);
}

#cuenta-modal .cuenta-root-nav-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    padding: 1rem 0.25rem;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 1.5rem;
    color: var(--text-color, #333);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

#cuenta-modal .cuenta-root-nav-item:hover,
#cuenta-modal .cuenta-root-nav-item:focus-visible {
    background: color-mix(in srgb, var(--color-primary, #e85d04), transparent 94%);
    outline: none;
}

#cuenta-modal .cuenta-root-nav-icon-wrap {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #393939 15%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#cuenta-modal .cuenta-root-nav-icon {
    width: 2rem;
    height: 2rem;
    fill: white;
}

#cuenta-modal .cuenta-root-nav-label {
    flex: 1;
}

#cuenta-modal .cuenta-root-nav-chevron {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-primary, #e85d04);
    line-height: 1;
}

#cuenta-modal .cuenta-root-logout {
    margin-top: 1.5rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 5rem;
    border: 1px solid color-mix(in srgb, #dc3545 35%, var(--border-color));
    background: transparent;
    color: #dc3545;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    margin-top: 3rem;
}

#cuenta-modal .cuenta-root-logout:hover {
    background: #dc3545;
    color: #fff;
}

#cuenta-modal .cuenta-nav-panel {
    /* iOS Safari note: NO will-change and NO translate3d/-webkit-overflow-scrolling.
       Combining any of those with overflow-y:auto on the same element is the
       classic iOS bug that breaks touch scroll while leaving wheel scroll intact.
       The browser still GPU-composites during the transition, then releases. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--color-primary), white 90%) 0, white 50%);
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    z-index: 5;
    transform: translateX(100%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Wimpli custom scrollbar for the slide panel */
#cuenta-modal .cuenta-nav-panel::-webkit-scrollbar {
    width: 8px;
}

#cuenta-modal .cuenta-nav-panel::-webkit-scrollbar-track {
    background: var(--background-light, #f5f5f5);
    border-radius: 4px;
}

#cuenta-modal .cuenta-nav-panel::-webkit-scrollbar-thumb {
    background: var(--border-color, #ccc);
    border-radius: 4px;
}

#cuenta-modal .cuenta-nav-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #999);
}

#cuenta-modal .cuenta-nav-stack.is-subview .cuenta-nav-panel {
    /* transform:none (not translate3d(0,0,0)) so iOS releases the GPU composite
       layer once the slide-in is done, allowing native touch scroll. */
    transform: none;
}

#cuenta-modal .cuenta-nav-panel-header {
    position: sticky;
    top: 0;
    z-index: 6;
    background: transparent;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0;
    padding: 2rem;
    border-bottom: 0px solid var(--border-color, #e8e8e8);
    min-height: 4.4rem;
    min-width: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    padding-right: 6rem;
    position: static;
}

#cuenta-modal .cuenta-nav-back {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 0px solid var(--border-color, #e0e0e0);
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #393939 15%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    color: white;
    transition: border-color 0.2s, color 0.2s;
    position: static;
}

#cuenta-modal .cuenta-nav-back:hover,
#cuenta-modal .cuenta-nav-back:focus-visible {
    border-color: var(--color-primary, #e85d04);
    color: var(--color-primary, #e85d04);
    outline: none;
}

#cuenta-modal .cuenta-panel-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    text-align: center;
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cuenta-modal .cuenta-nav-panel-body {
    flex: none;
    overflow: visible;
    padding: 0 2rem 2rem;
    min-width: 0;
    box-sizing: border-box;
    height: auto;
}

#cuenta-modal #cuenta-nav-panel-body .section-header h2 {
    display: none;
}

#cuenta-modal #cuenta-nav-panel-body .cuenta-section {
    padding: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#cuenta-modal #cuenta-nav-panel-body .cuenta-data-section {
    margin-bottom: 1.5rem;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#cuenta-modal #cuenta-nav-panel-body .section-subheader {
    min-width: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#cuenta-modal #cuenta-nav-panel-body .section-subheader h3 {
    min-width: 0;
    flex: 1 1 auto;
}

#cuenta-modal #cuenta-nav-panel-body .cuenta-form {
    max-width: 100%;
}

#cuenta-modal #cuenta-nav-panel-body .form-row {
    min-width: 0;
}

#cuenta-modal .cuenta-legal-prose {
    font-size: 1.45rem;
    line-height: 1.55;
    color: var(--text-color-muted, #666);
}

#cuenta-modal .cuenta-legal-prose h2,
#cuenta-modal .cuenta-legal-prose h3 {
    color: var(--color-primary, #e85d04);
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

#cuenta-modal .cuenta-legal-prose p {
    margin: 0 0 1rem;
}

[data-theme="dark"] #cuenta-modal .cuenta-nav-panel {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #cuenta-modal .cuenta-nav-back {
    background: #4e4e4e;
    border-color: rgba(255, 255, 255, 0.13);
    color: #eee;
}

@media (prefers-reduced-motion: reduce) {
    #cuenta-modal .cuenta-nav-panel,
    #cuenta-modal .cuenta-nav-root {
        transition: none;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color, #e0e0e0);
    border-top-color: var(--accent-color, #2271b1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    margin-top: 1.5rem;
    color: var(--text-color-muted, #666);
    font-size: 1.5rem;
}

.error-state {
    text-align: center;
    padding: 5rem 2rem;
    color: #dc3545;
}

.error-state p {
    font-size: 1.6rem;
}

/* ===========================
   CUENTA PAGE
   =========================== */

.cuenta-page {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.cuenta-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
    min-height: 70vh;
}

/* Left Column - Menu */
.cuenta-menu {
    background: transparent;
    border-radius: 0 0 2rem 2rem;
    padding: 2rem 0 0;
    height: fit-content;
    position: sticky;
    top: 0;
    opacity: 0;
    box-shadow: none;
    transform: translateY(-100%);
    transition: all linear 0.3s;
    position: sticky;
    width: 100%;
    z-index: 99;
    transition-delay: 0.5s;
}
.cliente-modal.lity-opened .cuenta-menu  {
    visibility: visible;
    opacity: 1;
    transform: translateY(0px);
    transition: all linear 0.3s;
    transition-delay: 0.5s;
    padding-right: 5rem;
}
.cuenta-user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0;
    margin-bottom: 0;
}

.user-avatar {
    width: 6.2rem;
    height: 6.2rem;
    border-radius: 50%;
    background: #e2e2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 2.5rem;
    color: #fff;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar i {
    font-size: 2.8rem;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(121 121 121 / 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    gap: 0.2rem;
}

.user-avatar:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay svg {
    width: 1.5rem;
    height: 1.5rem;
}

.avatar-overlay span {
    font-size: .8rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

.avatar-overlay .spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

.cuenta-user-info h3 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text-color, #333);
}

.cuenta-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    flex-wrap: wrap;
}

.cuenta-nav li {
    margin-bottom: 0;
    min-width: fit-content;
}

.cuenta-nav li a {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 5rem;
    padding: 0.9rem 1rem;
    text-align: center;
    color: var(--button-text-color-oscuro, #fff);
    text-decoration: none;
    border-radius: 5.6rem;
    border: 0;
    background: color-mix(in srgb, var(--color-primary, #2271b1), white 8%);
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s;
    border: none !important;
}

.cuenta-nav li a.button::after {
    display: none;
}

.cuenta-nav .cuenta-nav-icon {
    width: 1.3rem;
    height: 1.3rem;
    fill: currentColor;
    flex-shrink: 0;
    line-height: 1;
    display: none;
}

.cuenta-nav li:hover a,
.cuenta-nav li.active a {
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #616161 10%);
    color: #fff;
    transform: translateY(-1px);
}

.cuenta-nav li:not(.active):not(.logout-item) a {
    background: white;
    color: var(--text-color, #333);
    border: 1px solid var(--border-color, #dadde2);
}

.cuenta-nav li.logout-item {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.cuenta-nav li.logout-item a {
    color: #dc3545;
    background: white;
    border-color: color-mix(in srgb, #dc3545 18%, #ffffff);
}

.cuenta-nav li.logout-item:hover a {
    background: #dc3545;
    color: #fff;
}

/* Right Column - Content */
.cuenta-content {
    background: transparent;
    border-radius: 2rem;
    padding: 3rem;
    margin: 0 0rem 3rem;
    box-shadow: 0;
}

.cuenta-section h2 {
    margin: 0 0 3rem 0;
    font-size: 3rem;
    color: var(--text-color, #333);
    padding-bottom: 0;
}

.cuenta-data-section {
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 0;
}

.cuenta-data-section h3 {
    margin: 0 0 2rem 0;
    font-size: 2rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: 600;
    color: var(--text-color-muted, #666);
    font-size: 1.5rem;
}

.data-value {
    font-size: 1.5rem;
    color: var(--text-color, #333);
}

.direccion-card {
    background: var(--background-color-tertiary, #f0f0f0);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 0;
    border-left: 4px solid var(--accent-color, #2271b1);
}

.direccion-card:last-child {
    margin-bottom: 0;
}

.direccion-card p {
    margin: 0.5rem 0;
    font-size: 1.5rem;
    color: var(--text-color, #333);
}

/* Responsive Design */
/* ===========================
   CUENTA FORMS
   =========================== */

.section-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color, #333);
    font-weight: 700;
}

.section-header .btn-change-password {
    flex-shrink: 0;
}

.btn-edit-data,
.btn-change-password {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #616161 10%);
    color: #fff;
    border: none;
    border-radius: 2.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: fit-content;
    min-width: fit-content;
}

.btn-edit-data:hover,
.btn-change-password:hover {
    background: var(--accent-color-dark, #1a5a8a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.btn-edit-data svg,
.btn-change-password svg {
    flex-shrink: 0;
}

.cuenta-form {
    max-width: 600px;
    gap: 1rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

.cuenta-form .form-group {
    margin-bottom: 0;
}

.cuenta-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #333);
    font-size: 1.4rem;
}

.cuenta-form input[type="text"],
.cuenta-form input[type="email"],
.cuenta-form input[type="tel"],
.cuenta-form input[type="password"],
.cuenta-form select {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 0.5rem;
    font-size: 1.4rem;
    transition: all 0.3s;
    background: var(--background-color, #fff);
    color: var(--text-color, #333);
}

.cuenta-form input[readonly],
.cuenta-form select[disabled] {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    background: white;
    border: 0;
    padding: 0;
}

/* Mis datos — WhatsApp uses same structure as checkout (.pop_up_form .phone_container) + intl-tel-input */
.cuenta-form .phone_container.fields.cuenta-mis-datos-phone {
    margin-bottom: 0;
    min-width: 0;
}

.cuenta-form .phone_container.fields.cuenta-mis-datos-phone .field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.cuenta-form .phone_container.fields.cuenta-mis-datos-phone .field__label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #333);
    font-size: 1.4rem;
}

.cuenta-form .phone_container.fields.cuenta-mis-datos-phone .iti {
    width: 100%;
}

.cuenta-form .phone_container.fields.cuenta-mis-datos-phone .iti input.field__input,
.cuenta-form .phone_container.fields.cuenta-mis-datos-phone .iti input[type="tel"] {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 0.5rem;
    font-size: 1.4rem;
    transition: all 0.3s;
    background: var(--background-color, #fff);
    color: var(--text-color, #333);
    box-sizing: border-box;
}

.cuenta-form .phone_container.fields.cuenta-mis-datos-phone input.field__input:focus {
    outline: none;
    border-color: var(--accent-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.cuenta-form .phone_container.fields.cuenta-mis-datos-phone .field__error:not(:empty) {
    display: block;
    color: #dc3545;
    font-size: 1.2rem;
    margin-top: 0.35rem;
}

.cuenta-form select[disabled] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

.cuenta-form input:focus:not([readonly]),
.cuenta-form select:focus:not([disabled]) {
    outline: none;
    border-color: var(--accent-color, #2271b1);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0;
}

.btn-cancel {
    padding: 1.5rem 2rem;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 0;
    border-radius: 3rem;
    line-height: 1;
    height: auto;
}

.btn-cancel:hover {
    background: #5a6268;
}

.cuenta-form .form-message {
    margin: 0;
}

/* ===========================
   OTP VERIFICATION MODAL
   =========================== */

.otp-verification-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.otp-modal-content {
    background: var(--background-color, #fff);
    padding: 3rem;
    border-radius: 1.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.otp-modal-content h4 {
    font-size: 2rem;
    margin: 0 0 1rem 0;
    color: var(--text-color, #333);
}

.otp-modal-content p {
    margin: 0 0 2rem 0;
    color: var(--text-color-light, #666);
    line-height: 1.6;
}

.otp-modal-content #otp-code-datos {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    font-weight: 600;
}

.resend-otp {
    text-align: center;
    font-size: 1.3rem;
    margin: 1.5rem 0 0 0;
}

.resend-otp a {
    color: var(--accent-color, #2271b1);
    text-decoration: none;
    font-weight: 500;
}

.resend-otp a:hover {
    text-decoration: underline;
}

/* ===========================
   DIRECCIONES MANAGEMENT
   =========================== */

.section-subheader {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.section-subheader h3 {
    margin: 0;
    text-align: left;
}

.btn-add-direccion {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #616161 10%);
    color: #fff;
    border: none;
    border-radius: 3.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: fit-content;
}

.btn-add-direccion:hover {
    background: var(--accent-color-dark, #1a5a8a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

#direcciones-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.direccion-card {
    background: var(--background-color, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0rem 0rem 1rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
    border: none;
    position: relative;
}

.direccion-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.direccion-card.editing {
    opacity: 0.5;
    pointer-events: none;
}

.direccion-content {
    flex: 1;
}

.direccion-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.direccion-main strong {
    font-size: 1.5rem;
    color: var(--text-color, #333);
}

.direccion-detail {
    color: var(--text-color-light, #666);
    font-size: 1.3rem;
}

.direccion-location {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.direccion-location span {
    font-size: 1.3rem;
    color: var(--text-color, #333);
}

.provincia-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    background: var(--accent-color, #2271b1);
    color: #fff;
    border-radius: 0.4rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.direccion-zona,
.direccion-cp {
    font-size: 1.2rem;
    color: var(--text-color-light, #666);
    margin-top: 0.3rem;
}

.label-small {
    font-weight: 600;
    color: var(--text-color, #333);
}

.direccion-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color, #e0e0e0);
    background: var(--background-color, #fff);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
    border: 0;
    border-radius: 2rem;
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #616161 10%);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-edit-direccion {
    color: white;
    padding: 0;
}

.btn-edit-direccion:hover {
    background: rgba(34, 113, 177, 0.1);
    border-color: var(--accent-color, #2271b1);
}

.btn-delete-direccion {
    background: color-mix(in srgb, color-mix(in srgb, var(--color-red), white 10%), #616161 10%);
    padding: 0;
    color: white;
}

.btn-delete-direccion:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.direccion-delete-confirm {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
    padding: 1.6rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.direccion-card.show-delete-confirm .direccion-delete-confirm {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.direccion-delete-confirm p {
    margin: 0;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color, #333);
}

.direccion-delete-confirm__actions {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
}

.btn-cancel-delete-direccion,
.btn-confirm-delete-direccion {
    border: 0;
    border-radius: 3rem;
    padding: 0.9rem 1.4rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel-delete-direccion {
    background: #e9ecef;
    color: #495057;
}

.btn-confirm-delete-direccion {
    background: var(--color-red, #dc3545);
    color: #fff;
}

.no-direcciones {
    text-align: center;
    padding: 3rem;
    color: var(--text-color-light, #666);
    font-size: 1.4rem;
}

.no-direcciones a {
    color: var(--accent-color, #2271b1);
    text-decoration: none;
    font-weight: 500;
}

.no-direcciones a:hover {
    text-decoration: underline;
}

#form-direccion-container {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--background-light, #f9f9f9);
    border-radius: 1rem;
    border: 0px solid var(--color-primary, #2271b1);
    box-shadow: 0rem 0rem 1rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
    animation: formSlideIn 0.3s ease-out;
    margin-bottom: 1.5rem;
    background: white;
}

@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#form-direccion-container h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
    color: var(--accent-color, #2271b1);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#form-direccion-container h4::before {
    content: "✏️";
    font-size: 2rem;
}

/* Select2 custom styles for direcciones */
.select2-container {
    font-size: 1.4rem;
}

.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 0.5rem;
    height: auto;
    padding: 0.5rem 0;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 1rem;
    line-height: 2.2rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.5rem;
}

.select2-dropdown {
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 0.5rem;
    font-size: 1.4rem;
}

.select2-results__option {
    padding: 0.8rem 1rem;
}

/* Make Select2 work inside modal */
.select2-container {
    z-index: 100001 !important;
}

.select2-dropdown {
    z-index: 100002 !important;
}

/* Hide Razon Social by default (shown only for Responsable Inscripto) */
#edit-razon-social.hidden,
#edit-razon-social:not(.show) {
    display: none;
}

/* Field instructions */
.field-instruction {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.2rem;
    color: var(--text-muted, #666);
    font-style: italic;
}

/* ===========================
   MIS PEDIDOS SECTION
   =========================== */

#mis-pedidos-section {
    padding: 2rem;
    background: white;
    border-radius: 2rem;
    box-shadow: 0rem 0.5rem 2rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
}

/* Tabs Mis pedidos (Activos / Finalizados / Cancelados) */
#mis-pedidos-section .cliente-pedidos-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0 0 1.25rem;
    padding: 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: transparent;
}

#mis-pedidos-section .cliente-pedidos-tab {
    flex: 1 1 0;
    margin: 0;
    padding: 0.85rem 0.35rem 0.95rem;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    font: inherit;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color-muted, #9ca3af);
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-radius: 0;
    white-space: nowrap;
    min-width: 0;
}

#mis-pedidos-section .cliente-pedidos-tab:hover,
#mis-pedidos-section .cliente-pedidos-tab:focus-visible {
    color: var(--text-color, #374151);
    outline: none;
}

#mis-pedidos-section .cliente-pedidos-tab.is-active {
    color: var(--color-primary, #e85d04);
    border-bottom-color: var(--color-primary, #e85d04);
}

#cuenta-nav-panel-body #mis-pedidos-section {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

#cuenta-nav-panel-body #mis-pedidos-section .cliente-pedidos-tabs {
    margin-top: 0.25rem;
}

.cliente-pedidos-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

#cuenta-nav-panel-body #mis-pedidos-section .pedido-card.pedido-card--finalizado {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#mis-pedidos-section .pedido-card.pedido-card--finalizado {
    background: #fff;
    border-radius: 1.4rem;
    border: 0px solid #d7dbe1;
    box-shadow: 0rem 0.5rem 2rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
    overflow: hidden;
    width: fit-content;
}

#mis-pedidos-section .pedido-card-top-bar {
    background: color-mix(in srgb,  color-mix(in srgb, var(--color-primary), #ffffff 92%), #616161 0%);
    padding: 0.8rem .8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-direction: row;
}

#mis-pedidos-section .pedido-card-order-id {
    flex-shrink: 0;
    margin: 0;
    min-height: 2.6rem;
    border-radius: 0.8rem;
    background: #b590eb;
    color: #fff;
    padding: 0rem 0.7rem;
    font-weight: 700;
}

#mis-pedidos-section .pedido-card-date {
    font-size: 1.2rem;
    color: #3c3c3c;
}

#mis-pedidos-section .pedido-card-middle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: .8rem 0.8rem 0.4rem;
}

#mis-pedidos-section .pedido-card-service-line {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex: 1;
}

#mis-pedidos-section .pedido-card-servicio-icon {
    width: 3.2rem;
    height: 3.2rem;
    object-fit: contain;
    flex-shrink: 0;
}

#mis-pedidos-section .pedido-card-servicio-icon--empty {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: #e5e7eb;
    display: inline-block;
}

#mis-pedidos-section .pedido-card-client-name {
    font-size: 1.7rem;
    font-weight: 400;
    color: #333;
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mis-pedidos-section .pedido-card-status-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2f2f2f;
    white-space: nowrap;
    flex-shrink: 0;
}

#mis-pedidos-section .pedido-card-footer {
    padding: 0rem .8rem .8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#mis-pedidos-section .pedido-card-footer-main.card-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

#mis-pedidos-section .pos-header-payment-pill.card-status-payment-label,
#mis-pedidos-section .pedido-card-status-ref {
    width: 3.1rem;
    height: 3.1rem;
    min-width: 3.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    border: 0;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

#mis-pedidos-section .pos-header-payment-pill.card-status-payment-label.is-paid {
    background: #26b25a;
}

#mis-pedidos-section .pos-header-payment-pill.card-status-payment-label.is-pending {
    background: #ef4444;
}

#mis-pedidos-section .pedido-card-status-ref.pedido-card-status-ref--retrasado {
    background: #ef4444;
    display: none;
}

#mis-pedidos-section .pedido-card-status-ref-icon {
    width: 1.9rem;
    height: 1.9rem;
}

#mis-pedidos-section .pedido-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 9.2rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    background: color-mix(in srgb, color-mix(in srgb, var(--color-primary), white 10%), #393939 15%);
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Pedido embed: same slide-from-right feel as #cuenta-modal .cuenta-modal-content */
.cliente-pedido-embed-overlay {
    display: none;
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 6000000;
    justify-content: flex-end;
    align-items: stretch;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.cliente-pedido-embed-overlay.is-visible {
    display: flex;
}

.cliente-pedido-embed-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--color-primary), white 90%) 0, white 50%);
    opacity: 0;
    transition: opacity 0.24s ease-out;
}

.cliente-pedido-embed-overlay.is-open .cliente-pedido-embed-backdrop {
    opacity: 1;
}

.cliente-pedido-embed-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 520px);
    max-width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.14);
    transform: translate3d(100%, 0, 0);
    opacity: 0.65;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease-out;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.cliente-pedido-embed-overlay.is-open .cliente-pedido-embed-panel {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

/* Drag/swipe-to-dismiss: disable transition while finger moves (see cliente-auth.js) */
.cliente-pedido-embed-panel.is-swipe-dragging {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .cliente-pedido-embed-backdrop,
    .cliente-pedido-embed-panel {
        transition-duration: 0.01ms;
    }
}

.cliente-pedido-embed-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.2rem 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color, #e8eaef);
    flex-shrink: 0;
    background: #fafbfc;
    position: relative;
    z-index: 30;
    touch-action: none;
}

.cliente-pedido-embed-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-color, #1f2937);
    margin: 0;
    display: none;
}

/* Toolbar close — appearance from css/close-button.css */
.cliente-pedido-embed-close {
    flex-shrink: 0;
}

.cliente-pedido-embed-frame-wrap {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f3f4f6;
    touch-action: pan-y;
}

.cliente-pedido-embed-body {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    background: #f3f4f6;
    touch-action: pan-y;
}

.cliente-pedido-embed-body::-webkit-scrollbar {
    width: 8px;
}

.cliente-pedido-embed-body::-webkit-scrollbar-track {
    background: var(--background-light, #f5f5f5);
    border-radius: 4px;
}

.cliente-pedido-embed-body::-webkit-scrollbar-thumb {
    background: var(--border-color, #ccc);
    border-radius: 4px;
}

.cliente-pedido-embed-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, #999);
}

.cliente-pedido-embed-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2rem;
    min-height: 200px;
    background: #f3f4f6;
    color: var(--text-color-muted, #64748b);
    font-size: 1.4rem;
}

.cliente-pedido-embed-loading.is-active {
    display: flex;
}

.cliente-pedido-embed-loading .spinner {
    width: 40px;
    height: 40px;
}

body.cliente-pedido-embed-open {
    overflow: hidden;
}

.pedidos-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.pedidos-table-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--primary-color, #2271b1);
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pedidos-table-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    transition: background-color 0.2s;
}

.pedidos-table-row:hover {
    background-color: var(--bg-light, #f8f9fa);
}

.pedidos-table-row:last-child {
    border-bottom: none;
}

.pedidos-cell {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    color: var(--text-color, #333);
}

.pedidos-cell.col-fecha {
    color: var(--text-muted, #666);
}

.pedidos-cell.col-pedido-id {
    font-weight: 600;
    color: var(--primary-color, #2271b1);
}

.pedidos-cell.col-total {
    font-weight: 700;
    color: var(--success-color, #00a32a);
    font-size: 1.5rem;
}

.pedidos-cell.col-acciones {
    justify-content: flex-end;
}

.btn-ver-pedido {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.6rem;
    background: var(--primary-color, #2271b1);
    color: white;
    border-radius: 6px;
    font-size: 1.3rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-ver-pedido:hover {
    background: var(--primary-dark, #135e96);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.btn-ver-pedido svg {
    flex-shrink: 0;
}

/* Pagination */
.pedidos-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
}

.btn-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    background: white;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pagination:hover:not([disabled]) {
    border-color: var(--primary-color, #2271b1);
    color: var(--primary-color, #2271b1);
    background: var(--bg-light, #f8f9fa);
}

.btn-pagination:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-pagination svg {
    flex-shrink: 0;
}

.pagination-info {
    font-size: 1.4rem;
    color: var(--text-muted, #666);
    padding: 0 1rem;
}

/* Empty state */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state p {
    font-size: 1.6rem;
    color: var(--text-muted, #666);
    margin: 0;
}

.cuenta-section{
    gap: 1rem;
    display: flex;
    flex-direction: column;
}

.cuenta-nav{
    flex: auto;
    display: flex;
    flex-wrap: wrap;
    min-width: fit-content;
}

#cliente-email-otp-form{
    gap: 0;
    display: flex;
    flex-direction: column;
}
/* ===========================
   RESPONSIVE
   =========================== */

/* Social login hidden until re-enabled */
.cliente-social-login-buttons,
#cliente-social-login-buttons {
    display: none !important;
}

.cliente-auth-intro {
    margin: 0 0 1rem;
    font-size: 1.45rem;
    line-height: 1.45;
    color: var(--text-muted, #555);
}

/* Checkout: saved addresses toolbar (front pop_up_form) */
.checkout-direcciones-toolbar {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.checkout-direcciones-toolbar .field {
    flex: 1 1 200px;
    min-width: 0;
}

.checkout-direccion-select-wrap select.field__input,
.checkout-direccion-select-wrap .wimpli-select-wrap,
.checkout-direccion-select-wrap .wimpli-select-trigger {
    width: 100%;
    max-width: 100%;
}

/* Match Wimpli select layout to day/time fields inside checkout (full-width control). */
.pop_up_form .checkout-direccion-select-wrap .wimpli-select-wrap {
    width: 100%;
    position: relative;
}

#btn-checkout-agregar-direccion {
    flex: 0 0 auto;
    margin-bottom: 0;
}

/* Mi cuenta: ocultar provincia / localidad / CP (opcional por ahora) */
#direcciones-section .direccion-extra-fields,
#form-direccion-container .direccion-extra-fields {
    display: none !important;
}

/**
 * 481px–540px: `responsive.css` only adds cuenta “white cards” at max-width 480px,
 * so this viewport band used to miss panel backgrounds/shadows and readonly fields
 * blended into the page (white on white).
 */
@media (max-width: 540px) and (min-width: 481px) {
    #cuenta-modal .cuenta-content {
        padding: 0;
    }

    #cuenta-modal .cuenta-data-section {
        padding: 2rem;
        background: #fff;
        border-radius: 2rem;
        box-shadow: 0rem 0.5rem 2rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
    }

    #cuenta-modal .cuenta-modal-body {
        padding: 0;
    }

    #cuenta-modal .cuenta-form input[readonly],
    #cuenta-modal .cuenta-form select[disabled] {
        background: #f3f4f6;
        border: 1px solid var(--border-color, #e2e4e8);
        border-radius: 0.55rem;
        padding: 0.75rem 1rem;
        opacity: 1;
    }

    .cuenta-page .cuenta-content {
        padding: 0;
    }

    .cuenta-page .cuenta-data-section {
        padding: 2rem;
        background: #fff;
        border-radius: 1rem;
        box-shadow: 0rem 0.5rem 2rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
    }

    .cuenta-page .cuenta-form input[readonly],
    .cuenta-page .cuenta-form select[disabled] {
        background: #f3f4f6;
        border: 1px solid var(--border-color, #e2e4e8);
        border-radius: 0.55rem;
        padding: 0.75rem 1rem;
        opacity: 1;
    }
}

/**
 * #cuenta-modal — tablet/desktop (min-width: 541px)
 * Keeps the compact mobile look: centered menu strip, smaller avatar/nav/close,
 * address cards and main sections wrap in a row when space allows.
 */
@media (min-width: 541px) {
    #cuenta-modal .cliente-modal-close {
        /* width: 4.5rem; */
        /* height: 3.25rem; */
        /* top: 1rem; */
        /* right: 1rem; */
    }

    #cuenta-modal .cuenta-menu {
        left: 50%;
        right: auto;
        width: min(42rem, calc(100% - 2rem));
        transform: translate(-50%, -100%);
        border-radius: 0 0 2rem 2rem;
        padding: 2rem 0 0;
        width: 100%;
    }

    #cuenta-modal.cliente-modal.lity-opened .cuenta-menu {
        transform: none;
        left: auto;
        margin: 0 auto;
        padding-right: 5rem;
    }

    #cuenta-modal .cuenta-user-info {
        margin-bottom: 0;
    }

    #cuenta-modal .user-avatar {
        width: 4.6rem;
        height: 4.6rem;
    }

    #cuenta-modal .cuenta-user-info h3 {
        /* font-size: 1.85rem; */
        /* font-weight: 700; */
    }

    #cuenta-modal .cuenta-nav ul {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.65rem;
        max-width: 36rem;
        margin-left: 0;
        margin-right: auto;
    }

    #cuenta-modal .cuenta-nav li {
        flex: 1 1 9rem;
        max-width: fit-content;
        min-width: fit-content;
    }

    #cuenta-modal .cuenta-nav li a {
        min-height: 0;
        padding: 0.65rem 0.85rem;
        font-size: 1.15rem;
        border-radius: 3rem;
        text-shadow: none;
    }

    #cuenta-modal .cuenta-nav .cuenta-nav-icon {
        width: 1.15rem;
        height: 1.15rem;
    }

    #cuenta-modal .cuenta-content {
        margin: 0;
        padding: 0;
    }

    /* Mi cuenta: stack Datos / Direcciones / Facturación side by side when they fit */
    #cuenta-modal .cuenta-section:not(#mis-pedidos-section) {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
    }

    #cuenta-modal .cuenta-section:not(#mis-pedidos-section) > .section-header {
        flex: 1 1 100%;
        display: none;
    }

    #cuenta-modal .cuenta-section:not(#mis-pedidos-section) > #change-password-section {
        flex: 1 1 100%;
    }

    #cuenta-modal .cuenta-section:not(#mis-pedidos-section) > .cuenta-data-section:not(#change-password-section) {
        flex: 1 1 18rem;
        min-width: min(100%, 17rem);
        box-sizing: border-box;
        background: #fff;
        border-radius: 2rem;
        box-shadow: 0rem 0.5rem 2rem color-mix(in srgb, var(--color-primary), #2e2e2e29 78%);
        padding: 2rem;
        min-width: 340px;
    }

    /* Narrow panels: keep single-column fields readable */
    #cuenta-modal .cuenta-section:not(#mis-pedidos-section) .form-row {
        grid-template-columns: 1fr;
    }

    /* Address cards: row + wrap */
    #cuenta-modal #direcciones-list {
        flex-direction: column;
        flex-wrap: wrap;
    }

    #cuenta-modal #direcciones-list .direccion-card {
        flex: 1;
        min-width: min(100%, 15rem);
        max-width: 100%;
    }

    /* Sub-vistas del panel: una columna, sin mínimo rígido (evita recorte horizontal). */
    #cuenta-modal #cuenta-nav-panel-body .cuenta-section:not(#mis-pedidos-section) {
        flex-direction: column;
    }

    #cuenta-modal #cuenta-nav-panel-body .cuenta-section:not(#mis-pedidos-section) > .cuenta-data-section:not(#change-password-section) {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .cuenta-menu {
        padding-right: 0 !important;
    }
}