
        /* 7. CSS PARA DEPURACIÓN WASABI */
        .wasabi-error {
            background: #f8d7da;
            color: #721c24;
            padding: 10px 15px;
            margin: 10px 0;
            border-radius: 8px;
            border: 1px solid #f5c6cb;
            font-size: 0.9rem;
        }

        .wasabi-error h4 {
            margin: 0 0 5px 0;
            font-size: 1rem;
        }

        .wasabi-error pre {
            background: #f1f1f1;
            padding: 8px;
            border-radius: 4px;
            overflow-x: auto;
            font-size: 0.8rem;
            margin: 5px 0;
        }

        /* Estilos existentes del view-photo.php */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: "Playfair Display", "Times New Roman", serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            padding: 10px;
            min-height: 100vh;
            overflow-x: hidden;
        }

        .container {
            max-width: 100%;
            margin: 0 auto;
            background: var(--bg-secondary);
            padding: 15px;
            border-radius: 12px;
            box-shadow: var(--shadow-medium);
            border: 1px solid var(--border-color);
        }

        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 15px;
            padding: 10px 16px;
            background: var(--bg-primary);
            color: var(--accent-primary);
            text-decoration: none;
            border-radius: 8px;
            border: 1.5px solid var(--accent-primary);
            font-weight: 600;
            transition: all 0.3s ease;
            cursor: pointer;
            font-size: 14px;
            width: auto;
        }

        .back-link:hover {
            background: var(--accent-primary);
            color: white;
            transform: translateX(-3px);
        }

        .publicacion-container {
            background: var(--bg-glass);
            backdrop-filter: blur(10px);
            padding: 15px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-bottom: 15px;
            box-shadow: var(--shadow-light);
        }

        .publicacion-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 15px;
        }

        .autor-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--bg-primary);
            box-shadow: 0 0 0 2px var(--accent-primary);
            flex-shrink: 0;
        }

        .autor-placeholder {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: var(--bg-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid var(--bg-primary);
            box-shadow: 0 0 0 2px var(--accent-primary);
            color: var(--accent-primary);
            font-size: 1.2rem;
            flex-shrink: 0;
        }

        .autor-info {
            flex: 1;
            min-width: 0;
        }

        .autor-nombre {
            font-weight: 600;
            font-size: 16px;
            color: var(--text-primary);
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .publicacion-meta {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 12px;
            color: var(--text-secondary);
            flex-wrap: wrap;
        }

        .publicacion-meta span {
            white-space: nowrap;
        }

        /* EXTERNAL ICONS CONTAINER */
        .external-icons-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background: var(--bg-glass);
            border-radius: 8px;
            margin-bottom: 10px;
            border: 1px solid var(--border-color);
            flex-wrap: wrap;
            gap: 8px;
        }

        .file-counter {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--accent-primary);
            color: white;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }

        .category-badge {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--accent-primary);
            color: white;
            border-radius: 6px;
            font-weight: 600;
            font-size: 12px;
            white-space: nowrap;
        }

        /* MULTIMEDIA FILES CONTAINER - SWIPE ENABLED */
        .archivos-container {
            position: relative;
            width: 100%;
            background: var(--bg-secondary);
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 10px;
            aspect-ratio: 1/1;
            max-height: 70vh;
            touch-action: pan-y pinch-zoom;
            -webkit-user-select: none;
            user-select: none;
        }

        .archivo-principal {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            -webkit-user-drag: none;
            user-drag: none;
        }

        .video-principal {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            -webkit-user-drag: none;
            user-drag: none;
        }

        /* SWIPE INDICATORS */
        .swipe-indicators {
            position: absolute;
            bottom: 15px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: center;
            gap: 8px;
            z-index: 10;
        }

        .swipe-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            transition: all 0.3s ease;
        }

        .swipe-dot.active {
            background: white;
            transform: scale(1.2);
        }

        /* SWIPE NAVIGATION ARROWS */
        .swipe-arrow {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
            transition: all 0.3s ease;
            opacity: 0;
        }

        .archivos-container:hover .swipe-arrow {
            opacity: 1;
        }

        .swipe-arrow.prev {
            left: 10px;
        }

        .swipe-arrow.next {
            right: 10px;
        }

        .swipe-arrow:hover {
            background: rgba(0, 0, 0, 0.8);
        }

        /* THUMBNAILS */
        .miniaturas-container {
            display: flex;
            gap: 6px;
            padding: 10px;
            background: var(--bg-secondary);
            border-radius: 8px;
            overflow-x: auto;
            margin-bottom: 15px;
            scrollbar-width: thin;
            -webkit-overflow-scrolling: touch;
        }

        .miniaturas-container::-webkit-scrollbar {
            height: 4px;
        }

        .miniaturas-container::-webkit-scrollbar-thumb {
            background: var(--accent-primary);
            border-radius: 2px;
        }

        .miniatura {
            width: 60px;
            height: 60px;
            border-radius: 6px;
            object-fit: cover;
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .miniatura:hover {
            border-color: var(--accent-primary);
            transform: scale(1.05);
        }

        .miniatura.active {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 2px var(--accent-primary);
        }

        .miniatura-video {
            position: relative;
            border: 2px solid transparent;
            width: 60px;
            height: 60px;
            border-radius: 6px;
            overflow: hidden;
            cursor: pointer;
            flex-shrink: 0;
            background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 14px;
        }

        .miniatura-video.active {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 2px var(--accent-primary);
        }

        .miniatura-duracion {
            position: absolute;
            bottom: 2px;
            right: 2px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 2px 4px;
            border-radius: 2px;
            font-size: 10px;
        }

        .publicacion-info {
            padding: 15px;
        }

        /* Status and city container */
        .estado-ciudad-container {
            display: flex;
            gap: 8px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .estado-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 700;
            border: 2px solid;
            white-space: nowrap;
        }

        .estado-disponible {
            background: rgba(40, 167, 69, 0.1);
            color: #155724;
            border-color: #28a745;
        }

        .estado-reservado {
            background: rgba(255, 193, 7, 0.1);
            color: #856404;
            border-color: #ffc107;
        }

        .estado-vendido {
            background: rgba(220, 53, 69, 0.1);
            color: #721c24;
            border-color: #dc3545;
        }

        .ciudad-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border-radius: 6px;
            font-size: 12px;
            font-weight: 700;
            border: 2px solid var(--border-color);
            white-space: nowrap;
        }

        .precio-section {
            text-align: center;
            margin-bottom: 15px;
            padding: 15px;
            background: var(--bg-secondary);
            border-radius: 8px;
            border: 2px solid var(--accent-primary);
        }

        .precio {
            font-size: 24px;
            font-weight: 700;
            color: var(--accent-primary);
            margin-bottom: 8px;
            word-break: break-word;
            line-height: 1.2;
        }

        .badges-container {
            display: flex;
            gap: 8px;
            margin-bottom: 15px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .badge {
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            border: 2px solid;
            white-space: nowrap;
        }

        .badge-condicion {
            background: rgba(201, 169, 110, 0.1);
            color: var(--accent-primary);
            border-color: var(--accent-primary);
        }

        .badge-trueque {
            background: rgba(255, 193, 7, 0.1);
            color: #856404;
            border-color: #ffc107;
        }

        .badge-envio {
            background: rgba(23, 162, 184, 0.1);
            color: #0c5460;
            border-color: #17a2b8;
        }

        .descripcion {
            font-size: 14px;
            line-height: 1.6;
            color: var(--text-secondary);
            margin-bottom: 15px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: 8px;
            border-left: 4px solid var(--accent-primary);
            word-wrap: break-word;
        }

        .estadisticas {
            display: flex;
            justify-content: space-around;
            padding: 12px;
            background: var(--bg-glass);
            border-radius: 8px;
            margin-bottom: 15px;
            border: 1px solid var(--border-color);
        }

        .estadistica {
            text-align: center;
            flex: 1;
        }

        .estadistica-numero {
            font-size: 18px;
            font-weight: 700;
            color: var(--accent-primary);
            display: block;
            line-height: 1.2;
        }

        .estadistica-label {
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .acciones {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 12px 16px;
            background: var(--accent-primary);
            color: white;
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.3s ease;
            font-weight: 600;
            font-size: 14px;
            border: none;
            cursor: pointer;
            flex: 1;
            justify-content: center;
            font-family: inherit;
            min-width: 120px;
            min-height: 44px;
        }

        .btn:hover {
            background: var(--accent-secondary);
            transform: translateY(-2px);
            box-shadow: var(--shadow-medium);
        }

        /* NUEVO: Botón de compra con estilo verde */
        .btn-comprar {
            background: linear-gradient(135deg, #28a745, #20c997) !important;
            color: white !important;
        }

        .btn-comprar:hover {
            background: linear-gradient(135deg, #20c997, #28a745) !important;
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
        }

        .btn-like {
            background: <?php echo $user_liked ? '#dc3545' : 'var(--accent-primary)'; ?>;
        }

        .btn-contactar {
            background: var(--accent-primary);
        }

        .btn:disabled {
            background: var(--text-secondary);
            cursor: not-allowed;
            transform: none;
        }

        .btn:disabled:hover {
            transform: none;
            box-shadow: none;
        }

        .comentarios-section {
            background: var(--bg-glass);
            padding: 15px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-light);
        }

        .comentario-form {
            margin-bottom: 15px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: 8px;
        }

        .comentario-input {
            width: 100%;
            min-height: 80px;
            padding: 12px;
            background: var(--bg-primary);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 14px;
            resize: vertical;
            transition: all 0.3s ease;
            -webkit-appearance: none;
        }

        .comentario-input:focus {
            outline: none;
            border-color: var(--accent-primary);
        }

        .comentario-input::placeholder {
            color: var(--text-secondary);
        }

        .comentario-submit {
            margin-top: 10px;
            width: 100%;
            padding: 12px;
            background: var(--accent-primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: inherit;
            min-height: 44px;
            font-size: 14px;
        }

        .comentario-submit:hover {
            background: var(--accent-secondary);
            transform: translateY(-2px);
        }

        .login-prompt {
            text-align: center;
            padding: 12px;
            background: rgba(255, 193, 7, 0.1);
            border: 2px solid #ffc107;
            border-radius: 8px;
            margin-bottom: 15px;
            color: #856404;
            font-size: 14px;
        }

        .comentario-item {
            padding: 12px;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-primary);
            border-radius: 8px;
            margin-bottom: 10px;
            border: 1px solid var(--border-color);
        }

        .comentario-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
        }

        .comentario-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }

        .comentario-avatar {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--accent-primary);
            flex-shrink: 0;
        }

        .comentario-info {
            flex: 1;
            min-width: 0;
        }

        .comentario-autor {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .comentario-fecha {
            font-size: 11px;
            color: var(--text-secondary);
        }

        .comentario-texto {
            color: var(--text-secondary);
            line-height: 1.5;
            word-wrap: break-word;
            font-size: 14px;
        }

        .no-comentarios {
            text-align: center;
            padding: 20px;
            color: var(--text-secondary);
            font-size: 14px;
        }

        .success-msg {
            background: rgba(40, 167, 69, 0.1);
            color: #155724;
            padding: 10px;
            border-radius: 8px;
            border: 2px solid #28a745;
            margin-bottom: 15px;
            text-align: center;
            font-size: 14px;
        }

        /* PAGINACIÓN COMENTARIOS */
        .paginacion-comentarios {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 20px;
            padding: 15px;
            background: var(--bg-secondary);
            border-radius: 8px;
            flex-wrap: wrap;
        }

        .pagina-btn {
            padding: 8px 12px;
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
            min-width: 40px;
            text-align: center;
        }

        .pagina-btn:hover {
            background: var(--accent-primary);
            color: white;
            border-color: var(--accent-primary);
        }

        .pagina-btn.active {
            background: var(--accent-primary);
            color: white;
            border-color: var(--accent-primary);
        }

        .pagina-btn.disabled {
            background: var(--bg-secondary);
            color: var(--text-secondary);
            cursor: not-allowed;
            opacity: 0.5;
        }

        .info-paginacion {
            font-size: 14px;
            color: var(--text-secondary);
            text-align: center;
            margin: 0 10px;
        }

        /* Theme Selector Styles - Mobile Optimized */
        .theme-selector {
            position: fixed;
            top: 70px;
            right: 10px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 6px;
            background: var(--bg-glass);
            padding: 8px;
            border-radius: 20px;
            backdrop-filter: blur(10px);
            border: 1px solid var(--accent-primary);
        }

        .theme-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid var(--accent-primary);
            background: var(--bg-glass);
            backdrop-filter: blur(10px);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            color: var(--text-primary);
            font-size: 14px;
        }

        .theme-btn:hover {
            transform: scale(1.1);
            background: var(--accent-primary);
            color: white;
        }

        .theme-btn.active {
            background: var(--accent-primary);
            color: white;
            transform: scale(1.1);
        }

        /* Custom Modal Styles */
        .modal-overlay {
            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;
            padding: 20px;
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background: var(--bg-secondary);
            padding: 20px;
            border-radius: 12px;
            width: 100%;
            max-width: 400px;
            border: 2px solid var(--accent-primary);
            max-height: 80vh;
            overflow-y: auto;
        }

        /* Mobile First Responsive Design */
        @media (max-width: 480px) {
            body {
                padding: 8px;
            }
            
            .container {
                padding: 12px;
            }

            .publicacion-container {
                padding: 12px;
            }

            .publicacion-header {
                padding: 10px;
                gap: 10px;
            }

            .autor-avatar, .autor-placeholder {
                width: 45px;
                height: 45px;
            }

            .autor-nombre {
                font-size: 15px;
            }

            .publicacion-meta {
                font-size: 11px;
                gap: 8px;
            }

            .archivos-container {
                aspect-ratio: 1/1;
                max-height: 60vh;
            }

            .precio {
                font-size: 22px;
            }

            .btn {
                min-width: 100px;
                padding: 10px 14px;
                font-size: 13px;
            }

            .acciones {
                gap: 8px;
            }

            .estadisticas {
                padding: 10px;
            }

            .estadistica-numero {
                font-size: 16px;
            }

            .miniatura, .miniatura-video {
                width: 55px;
                height: 55px;
            }

            .theme-selector {
                top: 60px;
                right: 8px;
                padding: 6px;
            }

            .theme-btn {
                width: 32px;
                height: 32px;
                font-size: 12px;
            }

            .external-icons-container {
                padding: 8px;
            }

            .file-counter, .category-badge {
                font-size: 11px;
                padding: 5px 10px;
            }

            .swipe-arrow {
                width: 35px;
                height: 35px;
                opacity: 0.7;
            }
        }

        @media (max-width: 360px) {
            body {
                padding: 6px;
            }
            
            .container {
                padding: 10px;
            }

            .publicacion-container {
                padding: 10px;
            }

            .autor-avatar, .autor-placeholder {
                width: 40px;
                height: 40px;
            }

            .autor-nombre {
                font-size: 14px;
            }

            .precio {
                font-size: 20px;
            }

            .btn {
                min-width: 90px;
                padding: 8px 12px;
                font-size: 12px;
            }

            .miniatura, .miniatura-video {
                width: 50px;
                height: 50px;
            }

            .estadistica-numero {
                font-size: 15px;
            }
        }

        /* Landscape Orientation */
        @media (max-height: 500px) and (orientation: landscape) {
            .archivos-container {
                max-height: 50vh;
                aspect-ratio: 16/9;
            }
            
            .container {
                padding: 10px;
            }
            
            .publicacion-container {
                padding: 10px;
            }
        }

        /* Touch Device Optimizations */
        @media (hover: none) and (pointer: coarse) {
            .btn:hover {
                transform: none;
            }
            
            .back-link:hover {
                transform: none;
            }
            
            .miniatura:hover {
                transform: none;
            }
            
            .swipe-arrow {
                opacity: 0.7 !important;
            }
        }

        /* High DPI Screens */
        @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
            .archivo-principal,
            .video-principal,
            .miniatura {
                image-rendering: -webkit-optimize-contrast;
            }
        }

        /* Safe Area Insets for Notch Phones */
        @supports(padding: max(0px)) {
            body {
                padding-left: max(10px, env(safe-area-inset-left));
                padding-right: max(10px, env(safe-area-inset-right));
                padding-top: max(10px, env(safe-area-inset-top));
                padding-bottom: max(10px, env(safe-area-inset-bottom));
            }
        }
  