:root {
    --bg-color: #030508;
    --sidebar-bg: #0a0d14;
    --card-bg: rgba(22, 28, 45, 0.7);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #0ea5e9;
    --accent: #10b981;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #0ea5e9 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 50vw;
    height: 50vw;
    background: var(--primary);
    top: -10vw;
    right: -10vw;
}

.blob-2 {
    width: 40vw;
    height: 40vw;
    background: var(--secondary);
    bottom: -10vw;
    left: -10vw;
    animation-delay: -5s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5vw, 5vw) scale(1.1); }
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 380px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

/* Cart Container */
.cart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.cart-header h2 {
    font-size: 1.25rem;
    font-family: 'Outfit', sans-serif;
}

.item-count {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Custom Scrollbar */
.cart-items::-webkit-scrollbar {
    width: 4px;
}

.cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.empty-cart {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
}

.cart-item {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

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

.item-info .item-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.item-info .item-sku {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.item-price {
    font-weight: 700;
    color: var(--text-main);
}

.cart-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.total-row span:first-child {
    color: var(--text-muted);
    font-size: 1rem;
}

.total-price {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.btn-checkout {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-clear {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    min-height: unset;
    padding: 0;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-line {
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    position: absolute;
    top: 0;
    animation: scan 3s linear infinite;
    opacity: 0.6;
}

@keyframes scan {
    0% { top: 10%; opacity: 0; }
    50% { opacity: 0.8; }
    100% { top: 90%; opacity: 0; }
}

.focus-brackets {
    width: 300px;
    height: 300px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.focus-brackets::before, .focus-brackets::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary);
}

.focus-brackets::before {
    top: -4px;
    left: -4px;
    border-right: 0;
    border-bottom: 0;
}

.focus-brackets::after {
    bottom: -4px;
    right: -4px;
    border-left: 0;
    border-top: 0;
}

.detection-status {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.status-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 20px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Info Section */
.info-section {
    height: 200px;
}

.info-card {
    min-height: unset;
    height: 100%;
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.info-header h3 {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.info-body {
    width: 100%;
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
}

.product-result {
    display: flex;
    gap: 2rem;
    animation: fadeIn 0.4s ease-out;
}

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

.product-main-info {
    flex: 1;
}

.product-name {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.5rem;
}

.product-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sku-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
}

.category-tag {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.85rem;
}

.product-price-info {
    text-align: right;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.price-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Notifications */
.notification-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 320px; }
    .product-name { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; overflow-y: auto; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--glass-border); }
    .main-content { height: auto; }
    .camera-wrapper { aspect-ratio: 4/3; }
}

.brand-tag, .unit-tag {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.item-details {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.item-qty {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ── Primary button (scan, save) ───────────────────────────────────────── */
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* ── Unrecognized-item panel ────────────────────────────────────────────── */
.no-match {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.no-match strong {
    color: #f87171;
}

.vector-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.4rem;
    width: fit-content;
}

.vector-hint:hover {
    background: rgba(139, 92, 246, 0.2);
}

/* ── Notification variants ──────────────────────────────────────────────── */
.notification.success { border-left: 3px solid var(--accent); }
.notification.warning { border-left: 3px solid #f59e0b; }
.notification.error   { border-left: 3px solid #ef4444; }

/* ── Modal shared ───────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 8, 0.88);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden { display: none; }

.modal-container {
    background: #0f1420;
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-container::-webkit-scrollbar { width: 4px; }
.modal-container::-webkit-scrollbar-track { background: transparent; }
.modal-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.83rem;
    max-width: 500px;
}

.modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 1rem;
}

.modal-close:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-main);
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.modal-footer-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Similar products grid ──────────────────────────────────────────────── */
.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.similar-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.similar-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.similar-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
}

.similar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-card-body {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.similar-name {
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.3;
}

.similar-meta {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.similar-score-bar { margin: 0.4rem 0; }

.score-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.score-track {
    height: 3px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.similar-price {
    font-weight: 800;
    color: var(--accent);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
}

.btn-add-similar {
    width: 100%;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-top: none;
    color: var(--primary);
    padding: 0.65rem;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-add-similar:hover {
    background: rgba(139, 92, 246, 0.28);
    color: white;
}

/* ── Gemma conflict card (amber theme) ──────────────────────────────────── */
.gemma-conflict-card {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15), inset 0 0 20px rgba(245, 158, 11, 0.04);
}

.gemma-conflict-card:hover {
    border-color: rgba(245, 158, 11, 0.7);
}

.gemma-conflict-thumb {
    background: rgba(245, 158, 11, 0.08);
    color: rgba(245, 158, 11, 0.7);
}

.gemma-score-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.btn-add-gemma {
    width: 100%;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-top: none;
    color: #f59e0b;
    padding: 0.65rem;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.btn-add-gemma:hover {
    background: rgba(245, 158, 11, 0.28);
    color: white;
}

.gemma-label {
    color: #f59e0b !important;
    border-top-color: rgba(245, 158, 11, 0.2) !important;
}

/* ── Add-product form ───────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    color: var(--text-main);
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.05);
}

.form-group input::placeholder { color: var(--text-muted); opacity: 0.55; }

.required { color: #f87171; }
.hint { color: var(--text-muted); font-weight: 400; font-size: 0.72rem; text-transform: none; }

.image-upload-zone {
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--glass-border);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.image-upload-zone:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.03);
    color: var(--text-main);
}

.upload-icon { font-size: 1.1rem; line-height: 1; }

/* ── Modal camera preview ────────────────────────────────────────────────── */
.modal-camera-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 0.6rem;
    border: 1px solid var(--glass-border);
}

#modal-camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── "or" divider between capture and upload ─────────────────────────────── */
.photo-or-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.6rem 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.photo-or-divider::before,
.photo-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* ── Photo preview strip ─────────────────────────────────────────────────── */
.image-preview-strip {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.75rem;
}

/* Wrapper holds the thumb + the remove button */
.preview-thumb-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.preview-thumb {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    display: block;
}

.preview-thumb.captured {
    border-color: rgba(139, 92, 246, 0.55);
}

.preview-thumb.cam-capture {
    border-color: rgba(16, 185, 129, 0.55);
}

.preview-remove-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border: 2px solid #0f1420;
    border-radius: 50%;
    color: white;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-capture-photo {
    width: 100%;
    background: rgba(16, 185, 129, 0.07);
    border: 1px dashed rgba(16, 185, 129, 0.35);
    color: var(--accent);
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-capture-photo:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.55);
}

.btn-save {
    width: 100%;
    margin-top: 1.25rem;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* ── "Not this product?" correction button ─────────────────────────────── */
.btn-wrong-product {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(239, 68, 68, 0.65);
    padding: 0.28rem 0.7rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.6rem;
    font-family: 'Inter', sans-serif;
    width: fit-content;
}

.btn-wrong-product:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
}

/* ── Similar modal body (flex container for multiple sections) ───────────── */
.similar-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* ── Section labels inside similar modal ────────────────────────────────── */
.modal-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.modal-section-label:first-child { border-top: none; padding-top: 0; }

/* ── Catalog product list (compact rows) ────────────────────────────────── */
.catalog-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.catalog-grid::-webkit-scrollbar { width: 3px; }
.catalog-grid::-webkit-scrollbar-track { background: transparent; }
.catalog-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.catalog-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: var(--transition);
}

.catalog-card:hover { border-color: rgba(139, 92, 246, 0.3); }

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

.catalog-card-name {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-card-meta {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 0.15rem;
}

.catalog-card-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.catalog-card-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
}

.btn-add-catalog {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--primary);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-add-catalog:hover {
    background: rgba(139, 92, 246, 0.25);
    color: white;
}

/* ── Manage catalog button (sidebar) ────────────────────────────────────── */
.btn-manage-catalog {
    width: 100%;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.12);
    color: var(--text-muted);
    padding: 0.55rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.btn-manage-catalog:hover {
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

/* ── Manage catalog modal ────────────────────────────────────────────────── */
.modal-container--wide { max-width: 760px; }

.manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.manage-list::-webkit-scrollbar { width: 3px; }
.manage-list::-webkit-scrollbar-track { background: transparent; }
.manage-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.manage-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.2s ease-out;
}

.manage-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.manage-thumb img { width: 100%; height: 100%; object-fit: cover; }

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

.manage-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage-meta { color: var(--text-muted); font-size: 0.72rem; margin-bottom: 0.2rem; }

.manage-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
}

.manage-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.btn-delete-product {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #f87171;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-delete-product:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-delete-product:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .modal-container { padding: 1.25rem; max-height: 90vh; }
    .form-grid { grid-template-columns: 1fr; }
    .similar-grid { grid-template-columns: repeat(2, 1fr); }
}

