/* Fuentes OpenRunde */
@font-face {
    font-family: 'OpenRunde';
    src: url('../fonts/OpenRunde-Regular.woff2') format('woff2'),
         url('../fonts/OpenRunde-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenRunde';
    src: url('../fonts/OpenRunde-Medium.woff2') format('woff2'),
         url('../fonts/OpenRunde-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenRunde';
    src: url('../fonts/OpenRunde-Semibold.woff2') format('woff2'),
         url('../fonts/OpenRunde-Semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenRunde';
    src: url('../fonts/OpenRunde-Bold.woff2') format('woff2'),
         url('../fonts/OpenRunde-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    font-family: 'OpenRunde', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#map {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
}

.gm-style iframe+div {
    border: none !important;
}

.sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 340px;
    max-height: calc(95vh - 40px);
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 16px;
    transition: all 0.5s ease;
    animation: slide-in 0.5s forwards;
    color: #333;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 16px;
    z-index: 800;
}

/* Scrollbar personalizada flotante para el sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Firefox */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.logo-title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 4px 0;
}

.logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.map-title {
    font-size: 17px;
    color: #5f6368;
    font-weight: 600;
}

#search-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

#search {
    flex-grow: 1;
    padding: 12px 40px 12px 16px;
    font-size: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    color: #333;
}

#search:focus {
    outline: none;
    border-color: #4285f4;
    background-color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
}

#search::placeholder {
    color: #5f6368;
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

.user-icon {
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    margin-right: 5px;
}

.user-icon .material-symbols-outlined {
    font-size: 35px;
    color: #1E88E5;
}

.user-icon.logged-in {
    background-color: #1E88E5;
    color: white;
}

.add-place-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4285f4;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 16px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
    border: none;
}

.add-place-btn:hover {
    background-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
    transform: translateY(-1px);
}

.add-place-btn .material-symbols-outlined {
    margin-right: 8px;
    font-size: 22px;
}

.place-info {
    display: none;
    margin-top: 20px;
    color: #333;
}

.place-info-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.place-info h2 {
    font-weight: 700;
    font-size: 22px;
    margin: 0;
    color: #202124;
    line-height: 1.2;
}

.place-category {
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
    margin: 0 !important;
}

.place-subsidiary {
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
    margin: 0 !important;
}

.place-subsidiary::before {
    content: "Sucursal ";
}

.place-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #5f6368;
    margin-top: 16px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.place-info p {
    font-weight: 400;
    margin: 0;
    color: #5f6368;
}

.payment-card {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
    color: #333;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Noto Emoji', sans-serif;
}

.noto-emoji-face {
    font-family: "Noto Emoji", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
}

.comments-section,
.terminals-section {
    margin-top: 20px;
}

.comments-section h3,
.terminals-section h3 {
    font-weight: bold;
    margin-bottom: 10px;
}

.comment-card,
.terminal-card {
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.comment-card h4,
.terminal-card h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #202124;
}

.comment-card p,
.terminal-card p {
    margin: 5px 0;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.5;
}

/* Sección de lugares cercanos */
.nearby-section {
    margin-top: 20px;
}

.nearby-section h3 {
    font-weight: bold;
    margin-bottom: 10px;
}

.nearby-place-card {
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    /* No aplicar animación automáticamente, se controla desde JS */
}

.nearby-place-card:hover {
    border-color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nearby-place-card h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    line-height: 1.3;
}

.nearby-place-card .nearby-category {
    font-size: 13px;
    color: #5f6368;
    margin: 0 0 8px 0;
}

.nearby-place-card .nearby-subsidiary {
    font-size: 13px;
    color: #5f6368;
    margin: 0 0 10px 0;
}

.nearby-place-card .nearby-subsidiary::before {
    content: "Sucursal ";
}

.nearby-place-card .nearby-payment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Noto Emoji', sans-serif;
}

.nearby-payment-chip .noto-emoji-face {
    font-size: 14px;
}

.zoom-message-card {
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    cursor: default;
    text-align: center;
}

/* Skeleton Loader para lugares cercanos */
.nearby-skeleton {
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-line.title {
    width: 70%;
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-line.subtitle {
    width: 50%;
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line.chip {
    width: 35%;
    height: 32px;
    margin-bottom: 0;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Animaciones de crossfade controladas desde JS */

.close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #c7c7c75c;
    color: white;
    border: none;
    border-radius: 50%;
    padding: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    text-align: center;
    line-height: 20px;
    font-weight: bold;
}

.terminal-icon {
    display: inline-block;
    background-image: url('path_to_terminal_icon.svg');
    background-size: cover;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.nearby-places {
    margin-top: 20px;
    display: none;
    min-height: 380px;
    transition: min-height 0.3s ease;
}

.nearby-places .nearby-title {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
}

.terminal-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.terminal-list li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 14px;
}

.pac-container {
    background-color: white !important;
    color: #333 !important;
    border-radius: 12px;
    font-family: 'OpenRunde', sans-serif;
    padding: 8px;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    margin-top: 4px !important;
}

.pac-item {
    background-color: white !important;
    color: #333 !important;
    border-radius: 8px;
    margin: 4px 0;
    padding: 10px 12px;
    transition: background 0.2s ease;
}

.pac-item:hover {
    background-color: #f8f9fa !important;
}

.pac-item .pac-icon {
    display: inline-block;
    background-image: url('path_to_terminal_icon.svg');
    background-size: cover;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.pac-item-query {
    font-weight: 600;
    color: #333 !important;
}

.pac-item .pac-item-query,
.pac-item span {
    color: #5f6368 !important;
}

.custom-marker {
    filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.053));
    /* Sombra más nítida y compacta */
    animation: markerDrop 0.5s ease-out;
    transform-origin: bottom center;
    transition: all 0.3s ease;
}

.custom-marker.selected {
    transform: scale(1.4);
    filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.15));
    z-index: 1000 !important;
}

/* Animación de caída/rebote para marcadores */
@keyframes markerDrop {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    60% {
        transform: translateY(10px) scale(1.1);
        opacity: 1;
    }
    80% {
        transform: translateY(-5px) scale(0.95);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Animación alternativa para clústeres */
@keyframes clusterAppear {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   FAB DE CAPAS Y MENÚ (VISIBLE EN DESKTOP Y MÓVIL)
   ============================================ */

/* FAB de capas (esquina superior derecha) */
.layers-fab {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: white;
    color: #333;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    transition: all 0.3s ease;
}

.layers-fab:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.layers-fab .material-symbols-outlined {
    font-size: 24px;
}

/* Menú contextual de capas */
.layers-menu {
    position: fixed;
    top: 85px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 899;
    min-width: 200px;
    overflow: hidden;
    animation: slideInFromTop 0.3s ease;
}

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

.layers-menu-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.layers-menu-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.layers-menu-content {
    padding: 12px 0;
}

.layer-option {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.layer-option:hover {
    background: #f8f9fa;
}

.layer-option input[type="radio"] {
    margin: 0;
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #1E88E5;
}

.layer-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    flex: 1;
}

.layer-label .material-symbols-outlined {
    font-size: 20px;
    color: #666;
}

.layer-option input[type="radio"]:checked + .layer-label {
    font-weight: 600;
    color: #1E88E5;
}

.layer-option input[type="radio"]:checked + .layer-label .material-symbols-outlined {
    color: #1E88E5;
}

/* ============================================
   FIN DE ESTILOS DE CAPAS
   ============================================ */

/* ============================================
   BOTTOM SHEET PARA MÓVIL
   ============================================ */

.bottom-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    pointer-events: none;
}

.bottom-sheet.active {
    display: block;
    pointer-events: auto;
}

.bottom-sheet.closing .bottom-sheet-overlay {
    opacity: 0 !important;
}

.bottom-sheet.closing .bottom-sheet-content {
    transform: translateY(100%) !important;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet.active .bottom-sheet-overlay {
    opacity: 1;
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    touch-action: none;
    user-select: none;
}

.bottom-sheet.expanded .bottom-sheet-content {
    transform: translateY(0) !important;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #dadce0;
    border-radius: 2px;
    margin: 12px auto 8px;
    cursor: grab;
    transition: background 0.2s ease;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
    background: #bdc1c6;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 20px;
}

.bottom-sheet-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bottom-sheet-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
}

.bs-category {
    margin: 0;
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
}

.bs-subsidiary {
    margin: 0;
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
}

.bs-subsidiary::before {
    content: "Sucursal ";
}

.bottom-sheet-close {
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    align-self: flex-start;
}

.bottom-sheet-close:hover {
    background: #e0e0e0;
}

.bottom-sheet-close .material-symbols-rounded {
    font-size: 20px;
    color: #5f6368;
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.bottom-sheet-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 20px 0 12px 0;
}

.bottom-sheet-body h3:first-child {
    margin-top: 0;
}

.bottom-sheet-body p {
    color: #5f6368;
    font-size: 14px;
    margin: 0 0 8px 0;
}

/* Animaciones del BottomSheet */
@keyframes bottomSheetFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   FIN DE BOTTOM SHEET
   ============================================ */

/* ============================================
   BOTTOM SHEET PARA LOGIN (MÓVIL)
   ============================================ */

.login-bottom-sheet {
    z-index: 2000; /* Mayor que el de lugares */
}

.login-bottom-sheet .bottom-sheet-content {
    max-height: 95vh !important;
    min-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-bottom-sheet .bottom-sheet-body {
    padding: 20px 24px;
}

.login-bottom-sheet .bottom-sheet-header {
    cursor: grab;
    user-select: none;
}

.login-bottom-sheet .bottom-sheet-header:active {
    cursor: grabbing;
}

.login-bottom-sheet .bottom-sheet-close {
    background: #f1f3f4;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.login-bottom-sheet .bottom-sheet-close:hover {
    background: #e8eaed;
}

.login-bottom-sheet .bottom-sheet-close .material-symbols-outlined {
    font-size: 24px;
}

/* Ajustar padding del contenedor de auth en móvil */
.login-bottom-sheet .auth-popup-container {
    padding: 10px;
    max-width: 450px;
    margin: 0 auto;
}

#login-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

#login-bottom-sheet-overlay.active {
    display: block;
}

/* Ocultar por defecto */
#login-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    pointer-events: auto;
}

#login-bottom-sheet.active {
    display: block;
}

/* BottomSheet para perfil (reusa estilos del login-bottom-sheet) */
#profile-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

#profile-bottom-sheet-overlay.active {
    display: block;
}

#profile-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    pointer-events: auto;
}

#profile-bottom-sheet.active {
    display: block;
}

.profile-bottom-sheet .bottom-sheet-content {
    max-height: 95vh !important;
    min-height: 70vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-bottom-sheet .bottom-sheet-body {
    /* Make body fill sheet width so sidebar can occupy full width */
    padding: 0; /* user preference: no extra horizontal padding */
    max-width: none;
    margin: 0;
}

/* Force the profile BottomSheet and its inner profile to occupy the full
   available width on mobile. Some devices or other rules may leave a
   thin inset; these stronger rules ensure the profile content stretches
   edge-to-edge inside the rounded bottom-sheet. */
.profile-bottom-sheet .bottom-sheet-content,
.profile-bottom-sheet .bottom-sheet-body,
.profile-bottom-sheet .user-profile-modern {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.profile-bottom-sheet .bottom-sheet-header {
    cursor: grab;
}

/* Back button on the left of the bottom-sheet header (hidden until info visible) */
.profile-bottom-sheet .bottom-sheet-back {
    background: transparent;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: auto;
    transition: background 0.12s ease;
    flex-shrink: 0;
}
.profile-bottom-sheet .bottom-sheet-back:hover {
    background: rgba(0,0,0,0.04);
}
.profile-bottom-sheet .bottom-sheet-back .material-symbols-outlined {
    font-size: 22px;
}

/* When bottom sheet has info open, show back button and space header */
.profile-bottom-sheet.has-info .bottom-sheet-back {
    display: flex !important;
}
.profile-bottom-sheet.has-info .bottom-sheet-header { 
    justify-content: space-between;
}

.profile-bottom-sheet .bottom-sheet-close {
    background: #f1f3f4;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.profile-bottom-sheet .bottom-sheet-close .material-symbols-outlined {
    font-size: 24px;
}

/* ============================================
   FIN DE BOTTOM SHEET LOGIN
   ============================================ */


/* Estilos específicos para dispositivos móviles */
@media screen and (max-width: 850px) {

    /* Ocultar la sidebar en móviles */
    .sidebar {
        display: none;
    }
    
    /* Si quieres mostrar el sidebar en móvil, usa estos estilos:
    .sidebar {
        top: 10px;
        left: 10px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }
    */

    /* Estilos para el mapa en móviles */
    #map {
        width: 100%;
        height: 100%;
    }

    /* Botones flotantes (FABs) */
    .fab {
        display: flex;
        position: fixed;
        top: 20px;
        width: 40px;
        height: 40px;
        background-color: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        color: white;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        z-index: 1000;
        align-items: center;
        justify-content: center;
    }

    /* Posición de los FABs */
    .search-fab {
        right: 70px;
    }

    .user-fab {
        right: 20px;
    }

    .add-place-fab {
        right: 20px;
        top: 120px;
        background-color: #4CAF50;
    }

    .add-place-fab:hover {
        background-color: #45a049;
    }

    .fab .material-symbols-outlined {
        font-size: 24px;
    }

    /* Ajustar posición del FAB de capas en móvil */
    .layers-fab {
        width: 40px;
        height: 40px;
        top: 70px;
    }

    .layers-menu {
        top: 120px;
    }

    /* Overlay y contenedor de búsqueda en móvil */
    #mobile-search-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        z-index: 999;
        align-items: center;
        justify-content: center;
    }

    .mobile-search-container {
        position: relative;
        width: 80%;
        margin: 0 auto;
    }

    #mobile-search {
        width: 100%;
        padding: 12px 40px 12px 12px;
        font-size: 16px;
        border: 1px solid #ccc;
        border-radius: 20px;
        background-color: rgba(255, 255, 255, 0.9);
    }

    .mobile-clear-search {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background-color: transparent;
        border: none;
        color: #999;
        font-size: 24px;
        cursor: pointer;
        display: none;
    }



    /* Estilos para el contenedor de búsqueda en móviles */
    #search-container {
        position: fixed;
        top: 20px;
        right: 20px;
        width: auto;
        display: flex;
        align-items: center;
        z-index: 1000;
    }

    /* Campo de búsqueda oculto por defecto */
    #search {
        width: 0;
        padding: 0;
        border: none;
        background: none;
        transition: width 0.3s;
        overflow: hidden;
        opacity: 0;
    }

    /* Campo de búsqueda activo */
    #search.active {
        width: 200px;
        padding: 12px;
        border: 1px solid #ccc;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 20px;
        opacity: 1;
    }

    /* Botón de búsqueda */
    .search-button {
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        font-size: 24px;
    }

    /* Estilos para el ícono de usuario en móviles */
    .user-icon {
        position: fixed;
        top: 20px;
        right: 20px;
        font-size: 35px;
        color: white;
        cursor: pointer;
        z-index: 1000;
    }

    /* Mostrar la información del lugar en pantalla completa en móvil */
    .place-info {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        overflow-y: auto;
        padding: 20px;
        z-index: 1000;
        display: none;
        color: white;
    }


    .place-info h2 {
        font-weight: bold;
        font-size: 24px;
        margin-bottom: 10px;
        text-align: center;
    }

    .place-info p {
        font-weight: 400;
        margin: 0;
        text-align: center;
    }

    /* Mostrar el botón de cerrar en móvil */
    .close-btn {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        background-color: transparent;
        color: white;
        border: none;
        font-size: 30px;
        cursor: pointer;
        z-index: 1001;
    }

    /* Ocultar otros elementos cuando la información del lugar está visible */
    .place-info.active~.fab,
    .place-info.active~#search-container {
        display: none;
    }

    /* Estilos para las tarjetas dentro de la información del lugar */
    .payment-card,
    .subsidiary-card,
    .payment-methods-card,
    .terminal-card,
    .comment-card {
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding: 15px;
        margin: 15px 0;
        color: white;
    }

    /* Estilos para los encabezados dentro de la información del lugar */
    .place-info h3 {
        font-weight: bold;
        margin-bottom: 10px;
        font-size: 18px;
    }

    /* Estilos para los íconos de métodos de pago */
    .payment-method-icons {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;
    }

    .payment-method {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 1.5px solid white;
        border-radius: 15px;
        padding: 10px;
        width: 80px;
        height: 50px;
        box-sizing: border-box;
    }

    .payment-icon {
        width: 50px;
        height: 40px;
    }

    /* Estilos para las secciones de comentarios y terminales */
    .comments-section,
    .terminals-section {
        margin-top: 20px;
    }

    .comments-section h3,
    .terminals-section h3 {
        font-weight: bold;
        margin-bottom: 10px;
        font-size: 18px;
    }

    /* Estilos para los textos dentro de las tarjetas */
    .comment-card h4,
    .terminal-card h4 {
        margin: 0;
        font-size: 16px;
        font-weight: medium;
    }

    .comment-card p,
    .terminal-card p {
        margin: 5px 0;
        font-size: 14px;
    }

    /* Estilos para el mapa en el popup de agregar lugar */
    #add-place-popup #map-popup {
        width: 100%;
        height: 200px;
    }

    /* Ajustes para el formulario en el popup de agregar lugar */
    #add-place-popup .popup-content {
        flex-direction: column;
        align-items: center;
    }

    #add-place-popup .form-fields {
        width: 100%;
        padding: 0;
    }

    /* Ajustes para los botones en el popup */
    #add-place-popup .popup-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    #add-place-popup .popup-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Estilos para el overlay en móviles */
    #overlay {
        display: none;
    }

    /* Mostrar el overlay cuando el popup está activo */
    .popup.active+#overlay {
        display: block;
    }
}


@keyframes slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slide-in {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.popup {
    display: none;
    flex-direction: column;
    align-items: stretch; /* Estira el contenido al ancho del popup */
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    /* Ancho ajustado para el nuevo diseño de auth */
    max-width: 90%;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0; /* Sin padding para que el contenido ocupe todo el popup */
    z-index: 2000;
    animation: popup-open 0.3s ease-out forwards;
    overflow: hidden; /* Evita desbordes de bordes redondeados */
}

/* Cuando el popup contiene el perfil de usuario, hacerlo más ancho */
.popup:has(.user-profile-modern) {
    width: 900px;
    max-width: 95%;
}

/* Cuando el popup contiene la verificación de email, hacerlo más ancho */
.popup:has(.auth-popup-verification) {
    width: 650px;
    max-width: 90%;
    max-height: 85vh; /* Altura máxima fija */
}

/* Hacer el contenedor de verificación más amplio y scrolleable */
.auth-popup-container.auth-popup-verification {
    max-width: 600px;
    padding: 40px 60px;
    max-height: 80vh; /* Altura máxima */
    overflow-y: auto; /* Hacer scrolleable */
    overflow-x: hidden;
}

/* Estilos personalizados para el scrollbar */
.auth-popup-container.auth-popup-verification::-webkit-scrollbar {
    width: 8px;
}

.auth-popup-container.auth-popup-verification::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.auth-popup-container.auth-popup-verification::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.auth-popup-container.auth-popup-verification::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Hacer que el contenedor de contenido del popup ocupe todo el ancho disponible */
#popup-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0; /* Sin padding para que el contenido use todo el espacio */
    flex: 1 1 auto; /* Ocupa todo el alto disponible dentro del popup */
}

.popup h2 {
    margin-top: 0;
    font-size: 24px;
    text-align: center;
    width: 100%;
    /* Para centrar el título */
}

.login-input {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.popup button {
    width: 32%;
    padding: 10px;
    background-color: #1E88E5;
    color: white;
    border: none;
    border-radius: 120px;
    cursor: pointer;
    font-size: 16px;
}

/* Botones dentro del popup de login específicamente */
#popup button {
    width: 100%;
}

.popup button .material-symbols-outlined {
    display: block;
    text-align: center;
    font-size: 20px;
}

.popup button.login {
    background-color: #1E88E5;
    color: white;
}

.popup button.register {
    background-color: white;
    color: #1E88E5;
    border: 2px solid #1E88E5;
}

.popup button.logout {
    background-color: #FF5252;
    color: white;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 24px;
    z-index: 10; /* Por encima del contenido */
    background: #f1f3f4;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    line-height: 1;
    padding: 0;
}

.popup-close:hover {
    background: #e8eaed;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

/* ============================================
   NUEVO DISEÑO DE POPUP DE AUTENTICACIÓN
   ============================================ */

/* Contenedor del popup de auth */
.auth-popup-container {
    padding: 40px 50px;
    max-width: 450px;
    margin: 0 auto;
}

/* Header del popup */
.auth-popup-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-popup-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.auth-popup-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Formulario */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grupo de input */
.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cuando el grupo solo contiene un botón, quitar el gap */
.auth-input-group:has(button:only-child) {
    gap: 0;
}

.auth-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input:focus {
    border-color: #1E88E5;
    background: #f8fbff;
}

.auth-input::placeholder {
    color: #999;
}

/* Botones */
.auth-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box; /* Asegurar que respete el width 100% */
}

.auth-btn-primary {
    background: #1E88E5;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.2);
    margin-top: 4px; /* Pequeño espacio adicional después de los inputs */
    width: 100%;
}

.auth-btn-primary:hover {
    background: #1976D2;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-secondary {
    background: white;
    color: #1E88E5;
    border: 2px solid #e0e0e0;
}

.auth-btn-secondary:hover {
    background: #f8fbff;
    border-color: #1E88E5;
}

/* Divisor */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.auth-divider span {
    padding: 0 16px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

/* Mensaje de auth actualizado */
#auth-message.auth-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

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

/* ============================================
   ESTILOS DE VERIFICACIÓN DE EMAIL
   ============================================ */

/* Icono de verificación */
.verification-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #1E88E5 0%, #1976D2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.verification-icon .material-symbols-outlined {
    font-size: 40px;
    color: white;
}

/* Email destacado */
.verification-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fbff;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    margin-top: 16px;
}

.verification-email .material-symbols-outlined {
    color: #1E88E5;
    font-size: 20px;
}

.verification-email strong {
    color: #1E88E5;
    font-size: 15px;
}

/* Instrucciones paso a paso */
.verification-instructions {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.instruction-step:hover {
    background: #f0f2f5;
    transform: translateX(4px);
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1E88E5 0%, #1976D2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.step-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Acciones de verificación */
.verification-actions {
    margin-top: 32px;
}

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

/* Botones de enlace */
.auth-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: #1E88E5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.auth-link-btn:hover {
    background: #f8fbff;
}

.auth-link-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Botón primario con icono */
.auth-btn-primary .material-symbols-outlined {
    font-size: 20px;
    margin-right: 8px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Nota de verificación */
.verification-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fffbf0;
    border: 1px solid #ffe9a8;
    border-radius: 8px;
    margin-top: 24px;
}

.verification-note .material-symbols-outlined {
    color: #f9a825;
    font-size: 20px;
    flex-shrink: 0;
}

.verification-note p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.verification-note strong {
    color: #f9a825;
    font-weight: 600;
}

/* ============================================
   FIN DE ESTILOS DE VERIFICACIÓN
   ============================================ */

@keyframes popup-open {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-info .user-icon {
    font-size: 40px;
    width: 80px;
    height: 80px;
    line-height: 80px;
    background-color: #1E88E5;
    color: white;
    text-align: center;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.login-card {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    color: #5f6368;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.login-card h2 {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
}

#search-results {
    margin-top: 10px;
    margin-bottom: 20px;
}

#search-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

#search-description {
    font-size: 14px;
    color: #5f6368;
}

.overlay.active {
    display: block;
}

#add-place-popup .popup-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: row;
    /* Asegura que los elementos se alineen en fila */
}

#map-popup {
    width: 600px;
    height: 300px;
    /* Ajusta la altura según sea necesario */
    position: relative;
}



.form-fields {
    width: 100%;
    /* Asegura que la sección ocupe todo el espacio */
    padding-left: 20px;
}


.popup-buttons {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 20px;
}

.popup-content {
    display: flex;
    flex-direction: row;
    /* Alinea el mapa y los campos del formulario en una fila */
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Asegura que el contenido ocupe todo el espacio disponible */
}


.popup button:hover {
    background-color: #1565c0;
}

.form-fields input,
.form-fields select {
    width: 100%;
    /* Asegura que los inputs y selects ocupen todo el ancho disponible */
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    /* Asegura que el padding no afecte el ancho del input */
}

.form-fields label {
    display: block;
    font-size: 16px;
    /* Asegura que todos los labels tengan el mismo tamaño */
    margin-bottom: 8px;
}


#next-section {
    margin-right: 10px;
    width: auto;
    /* Permite que el botón se ajuste al contenido */
    padding: 10px 20px;
    /* Ajusta el relleno para que sea más pequeño */
}

#submit-form {
    margin-right: 10px;
}

.popup button:hover {
    background-color: #1565c0;
}

.terminal-entry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Dos columnas, una para las etiquetas y otra para los selectores */
    grid-template-rows: auto auto;
    /* Dos filas para distribuir etiquetas y selectores */
    grid-gap: 10px;
    /* Espaciado entre elementos */
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.05);
    /* Fondo ligero */
    border-radius: 5px;
}

.delete-icon {
    cursor: pointer;
    color: red;
    margin-left: 10px;
}

/* Estilos para el contenedor de las terminales */
#terminals-container {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.terminal-entry select {
    grid-column: span 1;
    /* Cada selector ocupa una columna */
    grid-row: 2;
    /* Los selectores están en la segunda fila */
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.terminal-entry label {
    grid-column: span 1;
    /* Cada etiqueta ocupa una columna */
    grid-row: 1;
    /* Las etiquetas están en la primera fila */
    text-align: left;
}

#add-terminal {
    display: block;
    width: 100%;
    background-color: #1E88E5;
    color: white;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: center;
}


#add-terminal:hover {
    background-color: #1565c0;
}

select:disabled {
    background-color: #f0f0f0;
    color: #888;
    cursor: not-allowed;
}

.radio-group {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.radio-group label {
    font-size: 16px;
    cursor: pointer;
}

/* Estilo para el campo de opinión */
.popup-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    resize: none;
    /* Evitar que el textarea se pueda redimensionar */
    min-height: 100px;
    margin-bottom: 20px;
}

#coordinates-display {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    /* Fondo blanco semitransparente */
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    z-index: 1000;
    /* Asegura que esté por encima del mapa */
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
    /* Sombra para dar un efecto de elevación */
}

.material-symbols-outlined {
    display: block;
    text-align: center;
    font-size: 40px;
}

/* Card para Sucursal */
.subsidiary-card {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 14px 16px;
    border-radius: 10px;
    margin: 10px 0 16px 0;
    color: #333;
}

.category-card {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 14px 16px;
    border-radius: 10px;
    margin: 10px 0 16px 0;
    color: #333;
}

#category-name {
    padding-top: 8px;
    color: #5f6368;
    font-size: 14px;
}

.payment-methods-card {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 14px 16px;
    border-radius: 10px;
    margin: 10px 0 16px 0;
    color: #333;
}

.payment-methods-card h3 {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
    color: white;
}

.payment-method-icons {
    display: flex;
    justify-content: center;
    /* Centra los íconos horizontalmente */
    align-items: center;
    /* Centra los íconos verticalmente */
    gap: 20px;
    /* Espacio entre los íconos */
}


.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1.5px solid white;
    /* Borde blanco */
    border-radius: 15px;
    /* Bordes redondeados */
    padding: 10px;
    /* Espaciado interno */
    width: 80px;
    /* Ancho fijo */
    height: 50px;
    /* Alto fijo */
    box-sizing: border-box;
    /* Incluir el borde en el tamaño total */
}

.payment-icon {
    width: 50px;
    height: 40px;
}

.payment-method p {
    font-size: 14px;
    text-align: center;
    margin: 0;
    color: white;
}

/* Estilos para mensajes de autenticación */
.auth-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

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

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

.auth-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Estilos para acciones de verificación */
.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.verification-actions button {
    width: 100% !important;
}

/* Mejoras para formularios de autenticación */
.popup form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup form button {
    margin-top: 0;
}

/* Estilos específicos para el formulario de registro */
#register-form .login-input {
    margin-bottom: 10px;
}

/* Estilos para el popup de verificación */
.verification-form {
    text-align: center;
}

.verification-form p {
    margin: 10px 0;
    line-height: 1.5;
}

.verification-form strong {
    color: #1E88E5;
}

/* Estilos para las instrucciones de verificación por email */
.verification-instructions {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.verification-instructions h3 {
    color: #1E88E5;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.verification-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.verification-instructions li {
    margin: 8px 0;
    color: #555;
    line-height: 1.4;
}

.verification-note {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    text-align: center;
}

.verification-note p {
    margin: 0;
    color: #856404;
}

.verification-note small {
    font-size: 13px;
}

/* Estilos para los botones de verificación */
.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.verification-actions button {
    width: 100% !important;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
}

/* Estilos para el popup de éxito */
.success-message {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 0.6s ease-in-out;
}

.success-message h2 {
    color: #28a745;
    margin: 20px 0 15px 0;
    font-size: 24px;
}

.success-message p {
    margin: 10px 0;
    color: #555;
    line-height: 1.5;
}

.success-message button {
    margin-top: 25px;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    padding: 12px 30px;
    font-weight: 600;
}

.success-message button:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-3px);
    }
}

/* Estilos para el perfil de usuario */
.user-profile {
    max-width: 400px;
    width: 100%;
}

.profile-header {
    text-align: center;
    margin-bottom: 25px;
}

.profile-header .user-icon {
    width: 60px;
    height: 60px;
    background-color: #1E88E5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px auto;
}

.profile-header h2 {
    margin: 0;
    color: #333;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-section label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.profile-section input[type="email"][disabled] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.profile-section small {
    color: #6c757d;
    font-size: 12px;
    margin-top: -4px;
}

.profile-info {
    padding: 10px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.profile-actions button {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Estilos para el formulario de cambio de contraseña */
.change-password-form {
    max-width: 400px;
    width: 100%;
}

.change-password-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

/* Responsivo para móviles */
@media (max-width: 480px) {
    .user-profile,
    .change-password-form {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .profile-actions {
        gap: 8px;
    }
    
    .profile-actions button {
        padding: 10px;
        font-size: 14px;
    }
}

/* Estilos para el setup de perfil inicial */
.profile-setup-container {
    max-width: 400px;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 32px;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast específico para el setup */
.profile-setup-container .setup-toast {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    min-width: 300px;
    text-align: center;
}

.profile-setup-container h2 {
    text-align: center;
    margin-bottom: 6px;
    color: #1a1a1a;
    font-size: 26px;
    font-weight: 600;
    width: 100%;
}

.profile-setup-container p {
    text-align: center;
    color: #5f6368;
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
}

/* Editor de avatar */
.avatar-editor-section {
    margin-bottom: 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#profile-setup-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-editor-section > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
    width: 100%;
}

.avatar-preview-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 400;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #4285f4;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.avatar-upload-btn:hover {
    background-color: #1a73e8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

#avatar-input {
    display: none;
}

/* Menú desplegable del avatar */
.avatar-menu-container {
    position: relative;
}

.avatar-dropdown-menu {
    position: absolute;
    bottom: -58px;
    right: -157px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 160px;
    z-index: 1000;
    transform-origin: top left;
    animation: dropdown-bounce-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Posición cuando hay foto (con opciones extendidas) */
.avatar-dropdown-menu.has-photo {
    bottom: -138px;
    right: -154px;
}

/* Animación suave para aparecer desde esquina superior izquierda */
@keyframes dropdown-bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animación suave para desaparecer hacia esquina superior izquierda */
@keyframes dropdown-bounce-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.avatar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    padding: 10px 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500;
    color: #333 !important;
    transition: background 0.2s ease;
    text-align: left !important;
}

/* Respetar display: none inline */
.avatar-menu-item[style*="display: none"] {
    display: none !important;
}

.avatar-menu-item:hover {
    background: #f5f5f5 !important;
}

.avatar-menu-item.danger {
    color: #f44336 !important;
}

.avatar-menu-item.danger:hover {
    background: #ffebee !important;
}

.avatar-menu-item .material-symbols-outlined {
    font-size: 20px !important;
    color: #5f6368 !important;
    background: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
}

.avatar-menu-item.danger .material-symbols-outlined {
    color: #f44336 !important;
}

/* Botones de editar/eliminar avatar (obsoletos, mantenidos por compatibilidad) */
#avatar-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.btn-edit-avatar,
.btn-remove-avatar {
    padding: 7px 14px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    transition: all 0.2s ease !important;
}

.btn-edit-avatar {
    background: #4285f4 !important;
    color: white !important;
}

.btn-edit-avatar:hover {
    background: #1a73e8 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(66, 133, 244, 0.3);
}

.btn-remove-avatar {
    background: #f44336 !important;
    color: white !important;
}

.btn-remove-avatar:hover {
    background: #d32f2f !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(244, 67, 54, 0.3);
}

/* Secciones del perfil */
.profile-section {
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.profile-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: left;
}

.profile-section .login-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    outline: none;
}

.profile-section .login-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

/* Wrapper para el input de username con @ */
.username-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.username-prefix {
    position: absolute;
    left: 16px;
    color: #5f6368;
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.username-input {
    padding-left: 38px !important;
    width: 100%;
    box-sizing: border-box;
}

.profile-section small {
    display: block;
    margin-top: 6px;
    color: #5f6368;
    font-size: 12px;
}

/* Modal del editor de imagen */
.image-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 3000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.image-editor-modal.active {
    display: flex;
}

.image-editor-modal.closing {
    animation: fadeOut 0.3s ease forwards;
}

.image-editor-modal.closing .image-editor-content {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.image-editor-content {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

.image-editor-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.crop-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    height: 350px;
    margin: 16px auto;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#crop-preview {
    max-width: 100%;
    max-height: 100%;
}

.editor-controls {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.editor-controls label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.editor-controls input[type="range"] {
    width: 100%;
    height: 6px;
    margin-bottom: 10px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.editor-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4285f4;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.editor-controls input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(66, 133, 244, 0.4);
}

.editor-controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4285f4;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.editor-controls input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(66, 133, 244, 0.4);
}

.editor-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
}

.editor-buttons button {
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 20px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-width: auto !important;
    background: #f5f5f5 !important;
    color: #666 !important;
}

.editor-buttons .btn-cancel {
    background: #f5f5f5 !important;
    color: #666 !important;
}

.editor-buttons .btn-cancel:hover {
    background: #e8e8e8 !important;
    color: #333 !important;
}

.editor-buttons .btn-save {
    background: #f5f5f5 !important;
    color: #666 !important;
}

.editor-buttons .btn-save:hover {
    background: #e8e8e8 !important;
    color: #333 !important;
}

/* Mensaje de disponibilidad del username */
#username-availability,
#profile-username-availability {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 12px;
    margin-top: 6px;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

#username-availability.show,
#profile-username-availability.show {
    max-height: 30px;
    opacity: 1;
    margin-top: 6px;
}

/* Botones de acción del setup */
.setup-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.setup-actions button {
    padding: 13px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 200px;
}

.btn-skip {
    background-color: #f8f9fa;
    color: #5f6368;
    border: 2px solid #e0e0e0;
}

.btn-skip:hover {
    background-color: #e8eaed;
    border-color: #dadce0;
    transform: translateY(-1px);
}

.btn-complete {
    background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.btn-complete:hover {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.btn-complete:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive para el setup de perfil */
@media (max-width: 480px) {
    .profile-setup-container {
        max-width: 100%;
        padding: 24px 20px;
        padding-top: 40px;
    }
    
    .profile-setup-container h2 {
        font-size: 22px;
    }
    
    .avatar-preview-container {
        width: 90px;
        height: 90px;
    }
    
    .avatar-preview {
        width: 90px;
        height: 90px;
        font-size: 36px;
    }
    
    .avatar-upload-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .image-editor-content {
        padding: 24px 16px;
    }
    
    .crop-container {
        height: 280px;
    }
    
    .setup-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .setup-actions button {
        width: 100%;
        min-width: unset;
    }
}
/* Fix of stray braces above */

/* ===== NUEVO DISEÑO DE PERFIL MODERNO ===== */

.user-profile-modern {
    width: 100%;
    max-width: none;
    background: white;
    border-radius: 20px;
    padding: 0;
    position: relative;
    max-height: 85vh;
    height: 85vh; /* Fijo para mantener el mismo tamaño siempre */
    min-height: 600px; /* Mínimo para pantallas pequeñas */
    display: flex;
    flex-direction: column;
}

.profile-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    min-height: 0;
}

/* Mobile BottomSheet behavior: sidebar fills sheet initially; info section slides in on demand */
.profile-bottom-sheet .user-profile-modern .profile-layout {
    /* single column layout in BottomSheet so the sidebar naturally fills width */
    position: relative;
    grid-template-columns: 1fr; /* override desktop two-column grid on mobile sheet */
}

/* Ensure the user-profile root clips off-canvas info panel so no edge peeks through */
.profile-bottom-sheet .user-profile-modern {
    overflow: hidden;
}

.profile-bottom-sheet .user-profile-modern .settings-sidebar {
    width: 100%;
    box-shadow: none;
    border-right: none;
    transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.36, 1), opacity 0.25s ease;
}

/* Info section sits off-canvas to the right and slides in */
.profile-bottom-sheet .user-profile-modern .profile-info-section {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    /* move slightly further right so no thin edge is visible on some devices */
    transform: translateX(115%);
    transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.36, 1);
    box-shadow: -6px 0 20px rgba(0,0,0,0.08);
    background: white;
    z-index: 2;
    overflow: auto;
}

/* When info-visible is set on the root, slide info into view and scale down sidebar */
.profile-bottom-sheet .user-profile-modern.info-visible .profile-info-section {
    transform: translateX(0);
}

.profile-bottom-sheet .user-profile-modern.info-visible .settings-sidebar {
    transform: translateX(-20%);
    opacity: 0.98;
}

/* Ensure desktop popup keeps original two-column layout */
.popup:has(.user-profile-modern) .profile-layout {
    grid-template-columns: 220px 1fr;
}

/* SECCIÓN IZQUIERDA - SIDEBAR */
.profile-avatar-section,
.settings-sidebar {
    background: white;
    padding: 24px 16px 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    position: relative;
    border-right: none;
    overflow: visible;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
}

/* Wrapper de los items del sidebar (para agruparlos arriba) */
.settings-sidebar > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Contenedor para logout en la esquina inferior izquierda */
.sidebar-logout {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    margin-top: auto;
    border: 1px solid transparent;
}
.sidebar-logout:hover {
    background: rgba(244, 67, 54, 0.06);
    border-color: rgba(244, 67, 54, 0.2);
}
.sidebar-logout .material-symbols-outlined {
    color: #d32f2f;
    font-size: 22px;
}
.sidebar-logout .logout-text {
    color: #d32f2f;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Encabezado lateral para las secciones del sidebar */
.profile-side-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}
.profile-side-header:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
}
.profile-side-header.selected {
    background: #f0f4ff;
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.1);
}
.profile-side-header .side-section-icon {
    color: #5f6368;
    font-size: 22px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}
.profile-side-header.selected .side-section-icon {
    color: #4285f4;
}
.profile-side-header .side-section-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.profile-side-header.selected .side-section-name {
    color: #4285f4;
}

.profile-avatar-container {
    position: relative;
    width: 100%;
    max-width: 140px; /* más pequeño */
    aspect-ratio: 1 / 1;
    margin: 0 auto 20px auto; /* centrar respecto a profile-content y dar separación inferior */
    overflow: visible;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #e9e9e9; /* sin sombra */
    box-shadow: none;
}

.profile-avatar-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 4px solid #e9e9e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(50px, 7vw, 70px);
    font-weight: 700;
    color: white;
    box-shadow: none; /* sin sombra */
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    background: #000;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.avatar-edit-btn:hover {
    transform: scale(1.1);
    background: #333;
}

.avatar-edit-btn .material-symbols-outlined {
    color: white;
    font-size: 20px;
}

/* MENÚ CONTEXTUAL DEL AVATAR */
.avatar-menu {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 8px;
    min-width: 180px;
    z-index: 10000;
    border: 1px solid #e0e0e0;
}

.avatar-menu-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
}

.avatar-menu-item:hover {
    background: #f5f5f5;
}

.avatar-menu-item.delete {
    color: #f44336;
}

.avatar-menu-item.delete:hover {
    background: #ffebee;
}

.avatar-menu-item .material-symbols-outlined {
    font-size: 20px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
}

.avatar-menu-item.delete .material-symbols-outlined {
    color: #f44336;
}

/* SECCIÓN DERECHA - INFORMACIÓN */
.profile-info-section {
    padding: 0; /* sin padding para que la barra sticky ocupe todo el ancho */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Contenido interno con padding propio, dejando la barra sticky fuera para ancho completo */
.profile-content {
    padding: 30px 40px 30px 40px; /* mover padding aquí */
}

.profile-info-section h2 {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

/* Título fijo arriba a la izquierda del panel derecho */
.profile-header-title {
    padding: 16px 20px 0 20px; /* margen superior y lateral */
}
.profile-header-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    text-align: left;
}

/* Toast de perfil centrado arriba */
#profile-message.profile-toast {
    position: sticky; /* permanece visible al hacer scroll del panel derecho */
    top: 12px;
    margin: 0 auto; /* centra horizontalmente dentro del panel */
    left: auto;
    transform: translateY(-8px); /* estado base para animación */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(640px, calc(100% - 40px)); /* ancho legible y respetar padding */
    background: #333;
    color: #fff;
    padding: 12px 16px; /* más grande y cómodo */
    border-radius: 999px; /* pill */
    font-size: 14px; /* más legible */
    line-height: 1.25;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    white-space: normal; /* permitir varias líneas si es necesario */
    text-align: center;
}

/* Variantes de color */
#profile-message.profile-toast.success { background: #2E7D32; }
#profile-message.profile-toast.error { background: #C62828; }
#profile-message.profile-toast.info { background: #455A64; }

/* Entrada/salida */
#profile-message.profile-toast.profile-toast-visible {
    animation: toast-slide-down 220ms ease-out forwards;
}
#profile-message.profile-toast.profile-toast-hiding {
    animation: toast-slide-up 200ms ease-in forwards;
}

/* Animaciones específicas para el setup toast (mantiene translateX) */
.profile-setup-container .setup-toast.profile-toast-visible {
    animation: setup-toast-slide-down 220ms ease-out forwards;
}
.profile-setup-container .setup-toast.profile-toast-hiding {
    animation: setup-toast-slide-up 200ms ease-in forwards;
}

@keyframes toast-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-slide-up {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

@keyframes setup-toast-slide-down {
    from { opacity: 0; transform: translate(-50%, -8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes setup-toast-slide-up {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -8px); }
}

/* Barra flotante para el botón de guardar */
.profile-save-bar {
    position: sticky; /* se mantiene visible dentro del flujo del panel derecho */
    bottom: 0;
    flex-shrink: 0;
    background: #fff; /* tema claro */
    padding: 10px 40px; /* alinea con padding del contenido en desktop */
    height: auto; /* ajusta alto al contenido */
    border-top: 1px solid #eaeaea;
    border-radius: 0; /* integrado al panel, sin esquinas internas */
    /* Oculta por defecto hasta que haya cambios */
    display: none;
    opacity: 0;
    transform: translateY(16px);
    justify-content: flex-start; /* botones a la izquierda */
    align-items: center;
    z-index: 100;
    box-shadow: none; /* sin sombra para integrarse */
    margin: 0; /* ancho del panel derecho */
    will-change: transform, opacity;
}

/* Estado visible con animación de entrada hacia arriba */
.profile-save-bar.is-visible {
    display: flex;
    animation: savebar-slide-up 180ms ease-out forwards;
}

@keyframes savebar-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estado de salida con animación hacia abajo */
.profile-save-bar.is-hiding {
    display: flex;
    animation: savebar-slide-down 160ms ease-in forwards;
}

@keyframes savebar-slide-down {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(16px);
    }
}
.savebar-actions {
    display: flex;
    gap: 8px; /* más compacto */
    padding: 0;
    margin-left: auto;
    margin-right: 60px;
}

/* Cancelar con el mismo estilo que Guardar dentro de la barra */
.profile-save-bar .btn-cancel-profile {
    background: #fff;
    color: #111;
    border: 1px solid #ddd;
    border-radius: 999px; /* pill */
    padding: 6px 20px; /* más ancho horizontalmente */
    font-size: 13px; /* igual que Guardar */
    font-weight: 600;
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-save-bar .btn-save-profile-fixed {
    background: #fff;
    color: #111;
    border: 1px solid #ddd;
    border-radius: 999px; /* pill */
    padding: 6px 24px; /* más ancho horizontalmente */
    font-size: 13px; /* más pequeño */
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-save-profile-fixed:disabled {
    opacity: 0.6;
}

/* Estados hover/active y disabled compartidos para cancelar y guardar dentro de la barra */
.profile-save-bar .btn-cancel-profile:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hover/active claros dentro de la barra */
.profile-save-bar .btn-save-profile-fixed:not(:disabled):hover,
.profile-save-bar .btn-cancel-profile:not(:disabled):hover {
    background: #f7f7f7;
    transform: none;
    box-shadow: none;
}
.profile-save-bar .btn-save-profile-fixed:not(:disabled):active,
.profile-save-bar .btn-cancel-profile:not(:disabled):active {
    background: #efefef;
}

/* La barra ocupa exactamente el ancho interno de profile-info-section */
.profile-info-section .profile-save-bar {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.btn-save-profile-fixed {
    padding: 8px 14px; /* ligeramente más grande para mejor legibilidad */
    border: none;
    border-radius: 8px; /* más compacto */
    font-size: 14px; /* un poco más grande */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px; /* separación más cómoda */
    background: #2196F3;
    color: white;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
    width: auto;
    max-width: 240px; /* un poco más ancho sin ser exagerado */
    line-height: 1.25;
}

.btn-save-profile-fixed:not(:disabled):hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-save-profile-fixed:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-save-profile-fixed .material-symbols-outlined {
    font-size: 18px; /* ligeramente mayor para balance visual */
}

.profile-form-modern {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: none; /* respetar mayúsculas/minúsculas del texto */
    letter-spacing: 0.5px;
}

.form-input {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

/* Estilos para username input con @ en form-group */
.form-group .username-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.form-group .username-prefix {
    position: absolute;
    left: 14px;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.form-group .username-input {
    padding-left: 36px !important;
    width: 100%;
    box-sizing: border-box;
}

.input-hint {
    font-size: 11px;
    color: #999;
    margin-top: -4px;
}

.info-text {
    padding: 12px 14px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

/* ACCIONES DEL PERFIL - PARTE INFERIOR */
.profile-actions-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    margin-bottom: 0; /* sin espacio fijo; se agrega sólo cuando la save bar está visible */
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
    transition: margin-bottom 180ms ease;
}

/* Agregar un poco de espacio sólo cuando la save bar está visible */
.profile-info-section.savebar-active .profile-actions-bottom {
    margin-bottom: 16px; /* poco espacio, de forma fluida */
}

.profile-actions-bottom .btn-secondary,
.profile-actions-bottom .btn-danger {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
    width: auto;
    max-width: 240px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
    width: 100%;
    max-width: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.profile-actions-bottom .btn-secondary {
    background: #9E9E9E;
    color: white;
}

.profile-actions-bottom .btn-secondary:hover {
    background: #757575;
}

.profile-actions-bottom .btn-secondary .material-symbols-outlined,
.profile-actions-bottom .btn-danger .material-symbols-outlined {
    font-size: 18px;
}

.profile-actions-bottom .btn-danger {
    background: #f44336;
    color: white;
    border: none;
}

.profile-actions-bottom .btn-danger:hover {
    background: #d32f2f;
}

.btn-danger {
    background: transparent;
    color: #f44336;
    border: 2px solid #f44336;
}

.btn-danger:hover {
    background: #f44336;
    color: white;
}

.btn-primary .material-symbols-outlined,
.btn-secondary .material-symbols-outlined,
.btn-danger .material-symbols-outlined {
    font-size: 20px;
}

/* MODAL DE RECORTE */
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.crop-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.crop-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.crop-container {
    max-height: 400px;
    margin-bottom: 20px;
}

.crop-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* MODAL DE CONFIRMACIÓN DE CIERRE DE SESIÓN */
.logout-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.logout-confirm-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.logout-confirm-icon {
    width: 80px;
    height: 80px;
    background: #ffebee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.logout-confirm-icon .material-symbols-outlined {
    font-size: 40px;
    color: #f44336;
}

.logout-confirm-content h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.logout-confirm-content p {
    margin: 0 0 30px 0;
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

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

.btn-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #f5f5f5;
    color: #333;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-logout-confirm {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #f44336;
    color: white;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
}

.btn-logout-confirm:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* MODAL DE CONFIRMACIÓN DE ELIMINAR AVATAR */
.delete-avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.delete-avatar-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.delete-avatar-icon {
    width: 80px;
    height: 80px;
    background: #ffebee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.delete-avatar-icon .material-symbols-outlined {
    font-size: 40px;
    color: #f44336;
}

.delete-avatar-content h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.delete-avatar-content p {
    margin: 0 0 30px 0;
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

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

.btn-delete-confirm {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: #f44336;
    color: white;
    transition: all 0.3s ease;
    font-family: 'OpenRunde', sans-serif;
}

.btn-delete-confirm:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    
    .profile-avatar-section,
    .settings-sidebar {
        padding: 40px 20px;
    }
    
    .profile-avatar-container {
        width: 100%;
        max-width: 140px; /* consistente con desktop reducido */
        aspect-ratio: 1 / 1;
    }
    
    .profile-avatar-initial {
        font-size: 60px;
    }
    
    .avatar-edit-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }
    
    .avatar-edit-btn .material-symbols-outlined {
        font-size: 18px;
    }
    
    .avatar-menu {
        top: calc(100% + 10px);
    }
    
    .profile-info-section {
        padding: 0;
    }
    
    .profile-info-section h2 {
        font-size: 20px;
    }
    .profile-content {
        padding: 20px; /* padding interno en mobile */
    }
    
    .profile-save-bar {
        padding: 10px 20px; /* alinea con padding del contenido en mobile */
        border-radius: 0; /* integrado también en mobile */
        margin: 0; /* ocupa todo el ancho del panel derecho */
    }
    
    .btn-save-profile-fixed {
        padding: 8px 14px; /* igual que desktop para consistencia */
        font-size: 14px;
    }
    
    .profile-actions-bottom {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 0; /* sin espacio fijo; controlado por savebar-active */
    }

    .profile-info-section.savebar-active .profile-actions-bottom {
        margin-bottom: 16px; /* pequeño espacio también en mobile */
    }
    
    .profile-actions-bottom .btn-secondary,
    .profile-actions-bottom .btn-danger {
        width: 100%;
        max-width: 100%;
    }
    
    .user-profile-modern {
        width: 95%;
        max-height: 95vh;
    }
}

/* Ajustes específicos: cuando el setup de perfil se muestra dentro del BottomSheet en móvil
   hacer que el contenedor ocupe el ancho horizontal disponible del sheet y use box-sizing
   para evitar overflow causado por padding. Aplica solo en pantallas móviles. */
@media (max-width: 850px) {
    /* Target explícito del bottom-sheet de perfil */
    #profile-bottom-sheet .bottom-sheet-content .profile-setup-container,
    #profile-bottom-sheet-content .profile-setup-container {
        max-width: 100%;
        width: 100%;
        padding: 0px 16px; /* padding horizontal reducido */
        padding-bottom: 150px; /* dar espacio inferior para evitar solapamientos con el sheet */
        box-sizing: border-box;
        border-radius: 12px 12px 0 0; /* opcional: redondeo superior acorde al sheet */
        align-items: flex-start; /* formulario a la izquierda para ocupar ancho */
    }

    /* Ajustar toast dentro del bottom-sheet para que no requiera min-width fijo */
    #profile-bottom-sheet .profile-setup-container .setup-toast,
    #profile-bottom-sheet-content .profile-setup-container .setup-toast {
        left: 16px;
        right: 16px;
        transform: none;
        min-width: 0;
    }

    /* Asegurar que los inputs y formularios usen el 100% del ancho disponible */
    #profile-bottom-sheet .profile-setup-container input,
    #profile-bottom-sheet-content .profile-setup-container input,
    #profile-bottom-sheet .profile-setup-container #profile-setup-form,
    #profile-bottom-sheet-content .profile-setup-container #profile-setup-form {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Regla específica para cuando el setup se inserta directamente dentro
   del bottom-sheet. Asegura que el contenedor ocupe exactamente el ancho
   interior del sheet, sin márgenes laterales ni max-width que lo limiten. */
#profile-bottom-sheet .profile-setup-container,
#profile-bottom-sheet-content > .profile-setup-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0px 16px !important; /* asegurar padding horizontal y top 0 en móvil */
    padding-bottom: 150px !important; /* espacio inferior consistente */
    box-sizing: border-box !important;
    align-items: stretch !important;
}

/* Si algún elemento interno tiene min-width que provoque overflow, lo anulamos dentro del sheet */
#profile-bottom-sheet .profile-setup-container * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Hacer el icono de cámara más pequeño dentro del setup de perfil */
.profile-setup-container .avatar-upload-btn .material-symbols-outlined,
.profile-setup-container .avatar-menu-container .material-symbols-outlined {
    font-size: 17px !important;
    line-height: 1;
}