        /* --- VARIABLES --- */
        :root {
            --bg-main: #000000;
            --bg-card: #1C1C1E;
            --bg-input: #2C2C2E;
            --accent-pink: #F5AECB;
            --accent-mint: #8EEECE;
            --accent-blue: #AEE2FF;
            --accent-orange: #FFD4A9;
            --text-white: #FFFFFF;
            --text-grey: #8E8E93;
            --radius-xl: 30px;
            --radius-lg: 20px;
            --radius-md: 16px;
            --brand-yape: #742284;
            --brand-paypal: #0070BA;
            --mobile-max-width: 600px;
        }

        /* --- BASE --- */
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-main);
            color: var(--text-white);
            margin: 0;
            padding: 0;
            padding-bottom: 90px; 
            -webkit-tap-highlight-color: transparent;
            overscroll-behavior-y: none;
        }

        /* --- ESTRUCTURA PRINCIPAL --- */
        .app-wrapper {
            width: 100%;
            min-height: 100vh;
        }

        .app-container {
            max-width: var(--mobile-max-width);
            margin: 0 auto;
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }

        /* Sidebar Desktop (Oculto en móvil) */
        .desktop-sidebar {
            display: none;
        }

        h2, h3, h4, p { margin: 0; }
        .hidden { display: none !important; }

        .view-content {
            padding: 20px;
            animation: fadeIn 0.3s ease;
            padding-top: 10px;
        }

        /* ESTILO ESPECÍFICO PARA VISTAS DE AUTENTICACIÓN */
        .auth-view {
            min-height: calc(100vh - 90px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* --- ESTILOS RESPONSIVE (PC / TABLET) --- */
        @media (min-width: 1024px) {
            body {
                padding-bottom: 0;
                background-color: #111;
                display: flex;
                justify-content: center;
                align-items: center;
                height: 100vh;
                overflow: hidden;
            }

            .app-wrapper {
                max-width: 1400px;
                height: 95vh;
                background: var(--bg-main);
                border-radius: var(--radius-xl);
                display: grid;
                grid-template-columns: 280px 1fr;
                overflow: hidden;
                box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
                border: 1px solid #333;
            }

            .desktop-sidebar {
                display: flex !important;
                flex-direction: column;
                background: var(--bg-card);
                padding: 30px;
                border-right: 1px solid var(--bg-input);
            }

            .app-container {
                max-width: 100%;
                margin: 0;
                height: 100%;
                overflow-y: auto;
                padding-bottom: 20px;
            }

            .bottom-nav { display: none !important; }

            .categories-grid {
                grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
                gap: 20px !important;
            }

            #view-chat {
                height: 100% !important;
                max-width: 800px;
                margin: 0 auto;
                border-left: 1px solid var(--bg-input);
                border-right: 1px solid var(--bg-input);
                position: relative !important;
                top: auto !important;
                left: auto !important;
                z-index: 10 !important;
            }
            
            .chat-input-container {
                position: absolute !important;
                bottom: 0;
                width: 100%;
                padding-bottom: 15px !important; 
            }

            .search-box { max-width: 600px; }

            #view-detail, #view-profile, #view-my-web-edit {
                max-width: 900px;
                margin: 0 auto;
            }

            .modal-box {
                max-width: 500px !important;
                border: 1px solid #444;
            }
            
            .auth-view {
                max-width: 400px;
                margin: 0 auto;
                height: 100%;
                min-height: 100%;
            }
        }

        /* SIDEBAR DESKTOP STYLES */
        .sidebar-logo {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 40px;
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--accent-mint);
        }

        .sidebar-menu {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .sidebar-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 15px;
            border-radius: var(--radius-md);
            cursor: pointer;
            color: var(--text-grey);
            transition: 0.2s;
            font-weight: 500;
        }

        .sidebar-item:hover {
            background: var(--bg-input);
            color: white;
        }

        .sidebar-item.active {
            background: var(--accent-blue);
            color: black;
            font-weight: bold;
        }

        /* MODALES */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 3000;
            display: flex;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.2s;
            backdrop-filter: blur(5px);
        }

        .modal-box {
            background: var(--bg-card);
            width: 85%;
            max-width: 400px;
            max-height: 90vh;
            overflow-y: auto;
            border-radius: var(--radius-lg);
            padding: 25px;
            text-align: center;
            border: 1px solid var(--bg-input);
            position: relative;
        }

        .modal-title {
            font-size: 1.2rem;
            margin-bottom: 20px;
            font-weight: bold;
            color: white;
        }

        .modal-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .modal-item {
            padding: 15px;
            background: var(--bg-input);
            border-radius: var(--radius-md);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-item:active {
            background: var(--accent-blue);
            color: black;
        }

        .list-row-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--bg-input);
            padding: 15px;
            border-radius: var(--radius-md);
            margin-bottom: 10px;
            text-align: left;
        }

        .notif-item {
            text-align: left;
            border-left: 3px solid var(--accent-mint);
        }

        /* HEADER & INPUTS */
        .top-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            margin-top: 10px;
        }

        .location-badge {
            display: flex;
            align-items: center;
            gap: 5px;
            background: var(--bg-input);
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: 0.2s;
            max-width: 70%;
        }

        .location-badge span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .icon-btn {
            background: var(--bg-card);
            padding: 8px;
            border-radius: 50%;
            cursor: pointer;
            transition: 0.2s;
        }

        .search-box {
            background: var(--bg-input);
            border-radius: var(--radius-xl);
            padding: 12px 20px;
            display: flex;
            align-items: center;
            margin-bottom: 25px;
        }

        .search-box input {
            background: transparent;
            border: none;
            color: white;
            width: 100%;
            margin-left: 10px;
            font-size: 1rem;
            outline: none;
        }

        /* CATEGORÍAS */
        .categories-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
        }

        .cat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            padding: 10px;
            border-radius: var(--radius-md);
            transition: bg 0.2s;
        }

        .cat-item:hover { background: var(--bg-input); }

        .cat-icon {
            width: 60px;
            height: 60px;
            background: var(--bg-card);
            border-radius: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 8px;
            font-size: 1.5rem;
            color: white;
        }

        .cat-name { font-size: 0.85rem; color: var(--text-grey); }

        /* LISTAS & STORIES */
        .list-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .stories-container {
            display: flex;
            gap: 15px;
            overflow-x: auto;
            padding-bottom: 10px;
            margin-bottom: 20px;
            scrollbar-width: none;
        }

        .story-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 70px;
            cursor: pointer;
        }

        .story-ring {
            width: 62px;
            height: 62px;
            border-radius: 50%;
            padding: 2px;
            background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 5px;
        }

        .story-ring img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 3px solid var(--bg-main);
            object-fit: cover;
        }

        .service-card {
            background: var(--bg-card);
            border-radius: var(--radius-md);
            padding: 15px;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 15px;
            cursor: pointer;
            transition: transform 0.1s;
        }

        .service-card:hover { transform: scale(1.01); background: #252528; }

        .provider-img {
            width: 55px;
            height: 55px;
            border-radius: 50%;
            object-fit: cover;
        }

        /* VISOR DE HISTORIAS */
        #story-viewer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: black;
            z-index: 2000;
            display: flex;
            flex-direction: column;
            touch-action: none; 
            overflow: hidden;
        }

        .story-progress-bar {
            display: flex;
            gap: 5px;
            padding: 10px;
            margin-top: 10px;
            z-index: 2005;
        }

        .progress-segment {
            height: 3px;
            background: rgba(255, 255, 255, 0.3);
            flex: 1;
            border-radius: 2px;
            overflow: hidden;
        }

        .progress-fill { height: 100%; background: white; width: 0%; }

        .story-header-info {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 0 15px;
            color: white;
            z-index: 2005;
        }

        .story-content {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            will-change: transform, opacity;
            transform-origin: center center;
        }

        .story-content img {
            max-width: 100%;
            max-height: 85vh;
            pointer-events: none;
            user-select: none;
        }

        .story-nav-left {
            position: absolute;
            top: 0;
            left: 0;
            width: 30%;
            height: 100%;
            z-index: 2002;
        }

        .story-nav-right {
            position: absolute;
            top: 0;
            right: 0;
            width: 30%;
            height: 100%;
            z-index: 2002;
        }

        .close-story {
            position: absolute;
            top: 20px;
            right: 20px;
            color: white;
            z-index: 2010;
            cursor: pointer;
        }

        /* PERFIL */
        #detail-cover {
            height: 250px;
            width: 100%;
            background-size: cover;
            background-position: center;
            position: relative;
            background-color: #333;
        }

        .cover-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100px;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
        }

        /* PEDIDOS */
        .tabs-header {
            display: flex;
            border-bottom: 1px solid var(--bg-input);
            margin-bottom: 20px;
        }

        .tab-btn {
            flex: 1;
            text-align: center;
            padding: 15px;
            color: var(--text-grey);
            position: relative;
            cursor: pointer;
        }

        .tab-btn.active { color: var(--accent-mint); font-weight: bold; }

        .tab-btn.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 3px;
            background: var(--accent-mint);
            border-radius: 2px 2px 0 0;
        }

        .order-card {
            background: var(--bg-card);
            border-radius: var(--radius-md);
            padding: 20px;
            margin-bottom: 15px;
            border-left: 4px solid var(--text-grey);
        }

        .order-card.active { border-left-color: var(--accent-mint); }

        .order-status {
            font-size: 0.75rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 3px 8px;
            border-radius: 5px;
            float: right;
        }

        /* FORM */
        .form-group {
            margin-bottom: 20px;
            text-align: left;
        }

        .form-label {
            display: block;
            color: var(--text-grey);
            margin-bottom: 8px;
            font-size: 0.9rem;
        }

        .form-input {
            width: 100%;
            background: var(--bg-input);
            border: none;
            padding: 15px;
            border-radius: var(--radius-md);
            color: white;
            font-size: 1rem;
            box-sizing: border-box;
        }

        .form-input:focus { outline: 1px solid var(--accent-blue); }

        .photo-upload-box {
            border: 2px dashed var(--bg-input);
            border-radius: var(--radius-md);
            padding: 20px;
            text-align: center;
            color: var(--text-grey);
            cursor: pointer;
            margin-bottom: 20px;
        }

        .btn-primary {
            width: 100%;
            background: var(--accent-blue);
            color: #000;
            padding: 15px;
            border-radius: var(--radius-lg);
            font-weight: bold;
            border: none;
            font-size: 1rem;
            cursor: pointer;
            margin-top: 10px;
            transition: 0.2s;
        }

        .btn-primary:hover { background: #9ad8ff; }

        .btn-secondary {
            background: var(--bg-input);
            color: white;
            width: 100%;
            padding: 15px;
            border-radius: var(--radius-lg);
            border: none;
            font-weight: bold;
            cursor: pointer;
            transition: 0.2s;
        }

        .btn-secondary:hover { background: #3a3a3d; }

        .btn-danger {
            background: rgba(255, 107, 107, 0.1);
            color: #ff6b6b;
            border: 1px solid #ff6b6b;
        }

        .btn-brand {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            padding: 15px;
            border-radius: var(--radius-md);
            border: none;
            font-weight: bold;
            color: white;
            cursor: pointer;
            margin-bottom: 10px;
        }

        .btn-option-active { background: var(--accent-mint) !important; color: black !important; }

        /* DETALLES */
        .price-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            color: var(--text-grey);
        }

        .price-total {
            display: flex;
            justify-content: space-between;
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid var(--bg-input);
            font-size: 1.2rem;
            font-weight: bold;
            color: var(--accent-mint);
        }

        .video-card {
            width: 100%;
            border-radius: var(--radius-md);
            overflow: hidden;
            margin-bottom: 25px;
            background: black;
            position: relative;
        }

        .video-card video {
            width: 100%;
            height: 200px;
            object-fit: cover;
            display: block;
        }

        .features-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 25px;
        }

        .feature-badge {
            background: rgba(142, 238, 206, 0.1);
            border: 1px solid var(--accent-mint);
            padding: 10px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.9rem;
            color: var(--text-white);
        }

        /* --- CHAT --- */
        #view-chat {
            background: var(--bg-main);
            z-index: 500;
            padding: 0;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .chat-header {
            padding: 15px;
            background: var(--bg-card);
            display: flex;
            align-items: center;
            gap: 15px;
            border-bottom: 1px solid var(--bg-input);
            flex: 0 0 auto; 
        }

        .chat-messages-area {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 15px;
            padding-bottom: 90px;
        }

        .message-bubble {
            max-width: 75%;
            padding: 12px 16px;
            border-radius: 18px;
            font-size: 0.95rem;
            line-height: 1.4;
            position: relative;
        }

        .msg-received {
            background: var(--bg-input);
            color: white;
            align-self: flex-start;
            border-bottom-left-radius: 4px;
        }

        .msg-sent {
            background: var(--accent-mint);
            color: black;
            align-self: flex-end;
            border-bottom-right-radius: 4px;
            font-weight: 500;
        }

        .chat-input-container {
            position: absolute; 
            bottom: 0;
            left: 0;
            width: 100%;
            background: var(--bg-card);
            padding: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
            border-top: 1px solid var(--bg-input);
            box-sizing: border-box;
            z-index: 510;
            padding-bottom: calc(15px + env(safe-area-inset-bottom));
        }

        @media (min-width: 1024px) {
            .chat-input-container {
                position: absolute;
                bottom: 0;
                width: 100%;
                padding-bottom: 15px !important; 
            }
        }

        /* PERFIL STATS */
        .profile-stats {
            display: flex;
            justify-content: space-around;
            width: 100%;
            margin-bottom: 20px;
        }

        .stat-box { text-align: center; }
        .stat-val { font-weight: bold; font-size: 1.1rem; color: var(--accent-blue); }
        .stat-lbl { font-size: 0.75rem; color: var(--text-grey); }

        /* NAV MOVIL */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: var(--bg-card);
            padding: 10px 0;
            display: flex;
            justify-content: space-around;
            border-top-left-radius: 25px;
            border-top-right-radius: 25px;
            z-index: 100;
            padding-bottom: 20px;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-grey);
            font-size: 0.7rem;
            cursor: pointer;
            width: 20%;
            gap: 4px;
        }

        .nav-item.active { color: var(--accent-mint); }

        .nav-highlight i {
            background: var(--accent-blue);
            color: black;
            padding: 12px;
            border-radius: 50%;
            margin-top: -25px;
            box-shadow: 0 5px 15px rgba(174, 226, 255, 0.4);
        }

        /* Scroll para distritos */
        .city-list-container {
            max-height: 50vh;
            overflow-y: auto;
            text-align: left;
            margin-top: 10px;
        }

        .city-group-title {
            font-size: 0.8rem;
            color: var(--accent-mint);
            text-transform: uppercase;
            margin: 15px 0 5px 0;
            padding-left: 5px;
            letter-spacing: 1px;
        }
        
        .call-phone-btn {
            flex: 1; 
            background: var(--accent-mint);
            border: none; 
            padding: 12px; 
            border-radius: 15px; 
            color: black; 
            font-weight: bold; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            font-size: 1rem;
            gap: 8px;
            text-decoration: none;
            transition: 0.2s;
        }
        
        .call-phone-btn:hover { background: #a4f5d2; }
        
        /* ---------------------------------------------------- */
        /* --- ESTILOS PAGINA WEB USUARIO (NUEVA SECCIÓN) --- */
        /* ---------------------------------------------------- */
        .my-web-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 2000;
            background: white; /* Simula una página web real */
            overflow-y: auto;
            color: #333;
        }

        .web-close-fab {
            position: fixed;
            top: 20px;
            right: 20px;
            background: black;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 2010;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        }

        /* Plantilla Empresarial */
        .biz-hero {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            color: white;
            padding: 80px 20px;
            text-align: center;
            border-bottom-right-radius: 50px;
            border-bottom-left-radius: 50px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        
        .biz-hero h1 { font-size: 2.5rem; margin-bottom: 15px; }
        .biz-hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

        .biz-section { padding: 50px 20px; max-width: 1000px; margin: 0 auto; }

        .biz-card {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
            padding: 25px;
            margin-bottom: 20px;
            border: 1px solid #f0f0f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: transform 0.2s;
        }
        .biz-card:hover { transform: translateY(-5px); }

        /* Plantilla Tienda */
        .store-header {
            background: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 15px rgba(0,0,0,0.05);
            position: sticky;
            top: 0;
            z-index: 2005;
        }

        .store-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 20px;
            padding: 20px;
            max-width: 1200px;
            margin: 0 auto;
        }

        .store-item {
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0,0,0,0.08);
            transition: transform 0.2s;
        }
        .store-item:hover { transform: translateY(-5px); }
        
        .store-item-img {
            height: 150px;
            width: 100%;
            object-fit: cover;
            background: #eee;
        }
        
        /* Lista dinámica en el editor */
        .dynamic-list-item {
            background: var(--bg-card);
            padding: 10px;
            border-radius: 10px;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 1px solid var(--bg-input);
        }
        
        .item-add-btn {
            background: var(--bg-input); 
            border: 1px dashed var(--text-grey); 
            color: var(--text-grey); 
            width: 100%; 
            padding: 10px; 
            border-radius: 10px; 
            cursor: pointer; 
            margin-top: 10px;
            transition: 0.2s;
        }
        .item-add-btn:hover {
            border-color: var(--accent-mint);
            color: var(--accent-mint);
        }

        /* Oculta elementos restringidos por defecto */
[data-show-to] { display: none !important; }