/* =========================================================================
   YARSELL SCANNER DESIGN SYSTEM & UNIFIED BUTTONS
   ========================================================================= */
.yarsell-scanner-page { max-width: 900px; margin: 30px auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: center; color: #1e293b; }
.yarsell-scanner-hero { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 40px 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.yarsell-scanner-icon { font-size: 52px; margin-bottom: 15px; }
.yarsell-scanner-hero h1 { font-size: 26px; color: #0f172a; margin: 0 0 10px 0; font-weight: 700; }
.yarsell-scanner-desc { color: #64748b; font-size: 15px; max-width: 550px; margin: 0 auto 25px auto; line-height: 1.5; }

/* Общая система кнопок YARSELL */
.yarsell-btn { padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 8px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box; }
.yarsell-btn-primary { background: #2563eb; color: #ffffff; border-color: #2563eb; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.yarsell-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; transform: translateY(-1px); }

.yarsell-btn-secondary { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.yarsell-btn-secondary:hover { background: #f1f5f9; border-color: #94a3b8; color: #0f172a; transform: translateY(-1px); }

.yarsell-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.yarsell-btn-ghost-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.yarsell-btn-ghost-danger:hover { background: #fecaca; border-color: #f87171; }

/* Главные кнопки сканера в Hero-блоке */
.yarsell-hero-buttons { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }

.yarsell-scanner-btn-primary { background: #2563eb; color: #ffffff; border: none; padding: 14px 28px; font-size: 16px; font-weight: 700; border-radius: 10px; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 14px rgba(37,99,235,0.28); display: inline-flex; align-items: center; gap: 8px; }
.yarsell-scanner-btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }

.yarsell-scanner-btn-history { background: #ffffff; color: #1e293b; border: 1.5px solid #cbd5e1; padding: 14px 24px; font-size: 15px; font-weight: 700; border-radius: 10px; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.yarsell-scanner-btn-history:hover { background: #f8fafc; border-color: #94a3b8; transform: translateY(-1px); color: #2563eb; }

.yarsell-history-badge { background: #eff6ff; color: #2563eb; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 12px; border: 1px solid #bfdbfe; }

.yarsell-scanner-btn-secondary { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.yarsell-scanner-btn-secondary:hover { background: #e2e8f0; color: #0f172a; }

/* Модальные окна */
.yarsell-modal { position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(15,23,42,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 15px; }
.yarsell-modal-box { background: #ffffff; border-radius: 14px; width: 100%; max-width: 480px; padding: 24px; position: relative; box-shadow: 0 15px 40px rgba(0,0,0,0.25); box-sizing: border-box; }
.yarsell-modal-close { position: absolute; top: 14px; right: 18px; font-size: 26px; font-weight: bold; color: #64748b; cursor: pointer; line-height: 1; z-index: 10; transition: color 0.15s; }
.yarsell-modal-close:hover { color: #0f172a; }
.yarsell-btn-cancel { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; padding: 8px 20px; font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer; }

/* Кнопка фонарика */
.yarsell-btn-torch { background: #0f172a; color: #ffffff; border: 1px solid #0f172a; padding: 8px 18px; font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.yarsell-btn-torch:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* Всплывающая карточка товара */
.yarsell-product-card-popup { background: #ffffff; border-radius: 14px; width: 100%; max-width: 620px; padding: 26px; position: relative; box-shadow: 0 15px 40px rgba(0,0,0,0.25); animation: yarsellPop 0.25s ease-out; }
@keyframes yarsellPop { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }

.yarsell-product-popup-layout { display: flex; gap: 22px; align-items: flex-start; text-align: left; }

/* Карусель фотографий */
.yarsell-carousel-wrap { width: 180px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.yarsell-carousel-main { width: 180px; height: 180px; border-radius: 10px; overflow: hidden; background: #f8fafc; border: 1px solid #e2e8f0; position: relative; display: flex; align-items: center; justify-content: center; padding: 4px; box-sizing: border-box; }
.yarsell-carousel-main img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity 0.2s; display: block; margin: auto; }

.yarsell-carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: rgba(15,23,42,0.6); color: #ffffff; border: none; font-size: 16px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.15s; z-index: 2; }
.yarsell-carousel-arrow:hover { background: rgba(15,23,42,0.85); }
.yarsell-carousel-prev { left: 6px; }
.yarsell-carousel-next { right: 6px; }

.yarsell-carousel-counter { position: absolute; bottom: 6px; right: 6px; background: rgba(15,23,42,0.65); color: #ffffff; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }

.yarsell-carousel-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.yarsell-carousel-thumb { width: 38px; height: 38px; border-radius: 6px; object-fit: contain; background: #ffffff; border: 1px solid #cbd5e1; cursor: pointer; opacity: 0.7; transition: all 0.15s; padding: 2px; box-sizing: border-box; }
.yarsell-carousel-thumb:hover, .yarsell-carousel-thumb.active { opacity: 1; border-color: #2563eb; transform: scale(1.05); }

.yarsell-product-popup-info { flex: 1; }
.yarsell-popup-code-badge { display: inline-block; background: #f1f5f9; color: #64748b; font-size: 11px; font-family: monospace; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px; }
.yarsell-popup-title { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 4px 0; line-height: 1.3; }

/* Текст цвета и размера в скобках */
.yarsell-popup-sku-traits { font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 8px; }

.yarsell-popup-price { font-size: 22px; font-weight: 800; color: #16a34a; }

.yarsell-popup-actions { display: flex; gap: 10px; margin-top: 15px; margin-bottom: 12px; }
.yarsell-action-btn { flex: 1; padding: 11px 16px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; text-align: center; }
.yarsell-action-cart { background: #2563eb; color: #ffffff; }
.yarsell-action-cart:hover { background: #1d4ed8; }
.yarsell-action-fav { background: #ffffff; color: #334155; border-color: #cbd5e1; }
.yarsell-action-fav:hover { background: #f8fafc; }

.yarsell-detail-link { font-size: 13px; color: #2563eb; text-decoration: none; font-weight: 500; }
.yarsell-detail-link:hover { text-decoration: underline; }

/* =========================================================================
   Модальное окно Истории Сканирований (Единый стиль карточек и кнопок)
   ========================================================================= */
.yarsell-history-modal-box { max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; padding: 22px; }
.yarsell-history-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; margin-bottom: 14px; }

.yarsell-history-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.yarsell-history-item { display: flex; align-items: center; gap: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; transition: all 0.2s; position: relative; }
.yarsell-history-item:hover { background: #ffffff; border-color: #bfdbfe; box-shadow: 0 4px 12px rgba(37,99,235,0.06); transform: translateY(-1px); }

.yarsell-history-thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; border: 1px solid #e2e8f0; background: #ffffff; flex-shrink: 0; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.04); padding: 2px; box-sizing: border-box; }
.yarsell-history-thumb-placeholder { width: 52px; height: 52px; border-radius: 8px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }

.yarsell-history-details { flex: 1; min-width: 0; text-align: left; }
.yarsell-history-title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: color 0.15s; }
.yarsell-history-title:hover { color: #2563eb; }
.yarsell-history-traits { font-size: 12px; color: #475569; margin-bottom: 4px; font-weight: 500; }
.yarsell-history-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #94a3b8; }
.yarsell-history-price { font-size: 14px; font-weight: 800; color: #16a34a; }

/* Кнопка "Три точки" (Меню поделиться) */
.yarsell-history-share-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #cbd5e1; background: #ffffff; color: #475569; font-size: 18px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; flex-shrink: 0; line-height: 1; }
.yarsell-history-share-btn:hover { background: #eff6ff; color: #2563eb; border-color: #2563eb; transform: scale(1.05); }

.yarsell-history-empty { text-align: center; padding: 40px 20px; }

/* Fallback-окно Поделиться */
.yarsell-share-modal-box { max-width: 400px; padding: 24px; text-align: center; }
.yarsell-share-options-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 15px; }
.yarsell-share-copy { width: 100%; }
.yarsell-share-tg { background: #229ed9; color: #ffffff; border-color: #229ed9; }
.yarsell-share-tg:hover { background: #1c87ba; border-color: #1c87ba; }
.yarsell-share-wa { background: #25d366; color: #ffffff; border-color: #25d366; }
.yarsell-share-wa:hover { background: #20b858; border-color: #20b858; }
.yarsell-share-vk { background: #0077ff; color: #ffffff; border-color: #0077ff; }
.yarsell-share-vk:hover { background: #0066dc; border-color: #0066dc; }

/* Toast уведомления */
.yarsell-scanner-toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #ffffff; padding: 10px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.25); z-index: 99999; animation: yarsellToastUp 0.25s ease-out; }
@keyframes yarsellToastUp { from { opacity: 0; transform: translate(-50%, 15px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 600px) {
    .yarsell-product-popup-layout { flex-direction: column; align-items: center; text-align: center; }
    .yarsell-carousel-wrap { width: 160px; margin: 0 auto; }
    .yarsell-carousel-main { width: 160px; height: 160px; }
    .yarsell-hero-buttons { flex-direction: column; width: 100%; }
    .yarsell-scanner-btn-primary, .yarsell-scanner-btn-history { width: 100%; justify-content: center; box-sizing: border-box; }
}
