@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* Escáner Móvil - Ultra Responsive & Premium Design System (100% Isolated) */
:root {
    --bg-dark: #090d16;
    --bg-surface: #111827;
    --card-bg: rgba(30, 41, 59, 0.75);
    --card-border: rgba(255, 255, 255, 0.12);
    --accent-blue: #38bdf8;
    --accent-blue-glow: rgba(56, 189, 248, 0.35);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.35);
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.35);
    --accent-rose: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.scanner-standalone-body,
#product_scanner_standalone_app,
.scanner-fullscreen-wrapper {
    background-color: var(--bg-dark) !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-body) !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* App Header */
.scanner-header-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: 12px;
    padding-left: 16px;
    padding-right: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.scanner-header-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scanner-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo-badge {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.scanner-logo-title h2 {
    font-family: var(--font-heading);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #fff !important;
}

.app-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary) !important;
    display: block;
    font-weight: 500;
}

.header-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.status-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-emerald) !important;
    letter-spacing: 0.5px;
}

/* Content Container */
.scanner-content-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(30px + var(--safe-bottom));
}

/* Controls Card */
.scanner-controls-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.input-search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.search-input-inner {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.7;
}

.scanner-search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1.5px solid var(--card-border) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    padding-left: 44px !important;
    padding-right: 38px !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-family: var(--font-body) !important;
    font-weight: 500 !important;
    outline: none;
    transition: all 0.25s ease;
}

.scanner-search-input:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 4px var(--accent-blue-glow) !important;
    background: rgba(15, 23, 42, 0.95) !important;
}

.btn-clear-input {
    position: absolute;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.scanner-btn {
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scanner-btn:active {
    transform: scale(0.96);
}

.scanner-btn-search {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.scanner-btn-camera {
    width: 100%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: #fff !important;
    font-size: 1.05rem;
    padding: 16px;
    border-radius: 14px;
    box-shadow: 0 6px 20px var(--accent-emerald-glow);
}

.cam-icon {
    font-size: 1.25rem;
}

/* Camera Viewport */
.camera-viewport {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 14px;
    border: 2px solid var(--accent-emerald);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.camera-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-laser-line {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #ef4444 50%, transparent 100%);
    box-shadow: 0 0 14px #ef4444, 0 0 6px #ef4444;
    animation: scanLaser 2.2s infinite ease-in-out;
    z-index: 10;
}

@keyframes scanLaser {
    0% { top: 15%; }
    50% { top: 85%; }
    100% { top: 15%; }
}

.scanner-corner-reticle {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid var(--accent-emerald);
    z-index: 10;
}

.scanner-corner-reticle.top-left { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.scanner-corner-reticle.top-right { top: 16px; right: 16px; border-left: none; border-bottom: none; }
.scanner-corner-reticle.bottom-left { bottom: 16px; left: 16px; border-right: none; border-top: none; }
.scanner-corner-reticle.bottom-right { bottom: 16px; right: 16px; border-left: none; border-top: none; }

.camera-overlay-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.cam-overlay-btn {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-close-cam {
    background: rgba(239, 68, 68, 0.9);
    border: none;
}

.scanner-instruction-tag {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    z-index: 20;
    white-space: nowrap;
}

/* Product Result Card */
.product-result-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--accent-blue-glow);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-blue-glow);
    animation: cardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.badges-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.badge-barcode {
    background: rgba(2, 132, 199, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--accent-blue);
}

.badge-sku {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
}

.stock-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.stock-status-pill.in-stock {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--accent-emerald);
}

.stock-status-pill.out-of-stock {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: var(--accent-rose);
}

.stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Image Wrapper */
.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 210px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    cursor: pointer;
}

.product-img-wrapper img {
    max-width: 90%;
    max-height: 190px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-img-wrapper:hover img {
    transform: scale(1.05);
}

.img-zoom-hint {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Title & Breadcrumb */
.product-title-section {
    margin-bottom: 18px;
}

.category-breadcrumb {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-amber);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff !important;
    margin: 0;
    line-height: 1.35;
}

/* Data Grid */
.product-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.grid-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon {
    font-size: 1.4rem;
}

.card-info {
    display: flex;
    flex-direction: column;
}

.grid-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.grid-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.grid-card-brand { border-color: rgba(56, 189, 248, 0.3); }
.grid-card-brand .grid-value { color: var(--accent-blue); }

.grid-card-car { border-color: rgba(245, 158, 11, 0.3); }
.grid-card-car .grid-value { color: var(--accent-amber); }

/* Price Hero Banner (USD + BCV VES Rate) */
.price-hero-card {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
    border: 1.5px solid #059669;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.25);
}

.price-hero-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #a7f3d0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.price-hero-amount {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: #34d399;
    letter-spacing: -0.5px;
}

.price-hero-bs-sub {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(52, 211, 153, 0.3);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.price-bs-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fde047;
}

.bcv-tag-sub {
    font-size: 0.78rem;
    font-weight: 600;
    color: #a7f3d0;
    opacity: 0.9;
}

/* Card Actions Bar */
.card-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-btn {
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn:active {
    transform: scale(0.95);
}

.btn-action-copy {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border: 1px solid var(--card-border);
}

.btn-action-next {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #fff !important;
}

.btn-action-odoo {
    grid-column: span 2;
    background: rgba(124, 58, 237, 0.2) !important;
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
    color: #c4b5fd !important;
}

/* Empty State */
.scanner-empty-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px dashed var(--card-border);
    border-radius: 20px;
    padding: 36px 20px;
    text-align: center;
}

.empty-icon-pulse {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: floatIcon 3s infinite ease-in-out;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.scanner-empty-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff !important;
    margin: 0 0 8px 0;
}

.scanner-empty-card p {
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.quick-tips-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.tip-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Error Card (Inline) */
.scanner-error-card {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
    padding: 14px 18px;
    border-radius: 14px;
    margin-top: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.2);
}

/* Toast Notification Popup */
.scanner-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--accent-emerald);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
}

/* Odoo-Style Modal Dialog System */
.odoo-modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

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

.odoo-modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(124, 58, 237, 0.2);
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.odoo-modal-header {
    background: rgba(15, 23, 42, 0.9);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.odoo-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.odoo-modal-icon {
    font-size: 1.4rem;
}

.odoo-modal-title h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff !important;
}

.odoo-modal-close-x {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
}

.odoo-modal-body {
    padding: 20px;
}

.odoo-modal-msg-text {
    font-size: 1rem;
    color: var(--text-primary) !important;
    line-height: 1.5;
    margin: 0 0 14px 0;
}

.odoo-technical-box {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 10px;
}

.tech-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-rose);
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}

.tech-code {
    font-family: monospace;
    font-size: 0.82rem;
    color: #fca5a5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.odoo-modal-footer {
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

.odoo-modal-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.odoo-modal-btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.d-none {
    display: none !important;
}
