/* Стилове за инструментите на списъка (Един магазин / Mix & Match / Пазарувам сега).
   Ползват се и на екрана на конкретен списък, и на екрана „всички списъци".
   На екрана на списъка някои правила се дублират с inline <style> — безвредно. */

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}
.action-btn {
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
}
.action-btn .btn-main { display: flex; align-items: center; gap: 6px; }
.action-btn .btn-desc { font-size: 0.7rem; font-weight: 400; opacity: 0.85; }
.action-btn-primary { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.action-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4); }
.action-btn-secondary { background: linear-gradient(135deg, #3498db, #2980b9); }
.action-btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4); }

/* Панел „Пазарувам сега" */
.store-now-panel {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    margin-bottom: 80px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.sn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sn-title { font-weight: 700; color: var(--accent-brown, #7a5c3e); font-size: 1.05rem; }
.sn-sub { font-size: .8rem; color: #999; }
.sn-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.sn-pill { display: inline-flex; align-items: center; gap: 6px; background: #f4f4f5; border: 1.5px solid #eef0f2; border-radius: 999px; padding: 6px 13px; font-size: .85rem; font-weight: 600; color: #444; cursor: pointer; transition: all .15s ease; }
.sn-pill img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; background: #fff; }
.sn-pill:hover { border-color: #27ae60; }
.sn-pill.active { background: #e8f5e9; border-color: #27ae60; color: #1b5e20; }

/* Autocomplete „друг магазин" */
.sn-store-ac { position: relative; flex: 1; min-width: 160px; }
.sn-store-ac input { width: 100%; border: 1.5px solid #eef0f2; border-radius: 999px; padding: 7px 14px; font-size: .85rem; color: #444; background: #f4f4f5; }
.sn-store-ac input:focus { outline: none; border-color: #27ae60; background: #fff; }
.sn-store-sug { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; z-index: 50; display: none; }
.sn-store-sug.show { display: block; }
.sn-sug-item { padding: 9px 14px; font-size: .88rem; color: #333; cursor: pointer; border-bottom: 1px solid #f2f2f2; }
.sn-sug-item:last-child { border-bottom: none; }
.sn-sug-item:hover { background: #f4f8f5; }

.sn-similar { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #555; margin-bottom: 4px; cursor: pointer; }
.sn-similar input { width: 17px; height: 17px; cursor: pointer; }
.sn-loading, .sn-empty { text-align: center; color: #999; padding: 18px; font-size: .9rem; }
.sn-list { margin-top: 10px; }
.sn-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f2f2f2; }
.sn-row:last-child { border-bottom: none; }
.sn-img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.sn-row-missing .sn-img { opacity: .45; filter: grayscale(1); }   /* „Без цена в тази верига“: снимката избледняла */
.sn-info { flex: 1; min-width: 0; }
.sn-name { font-weight: 600; color: #333; font-size: .9rem; line-height: 1.3; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sn-savly { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 6px; color: #fff; font-size: .72rem; font-weight: 700; }
.sn-badges { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 5px; }
.sn-badge { font-size: .7rem; font-weight: 600; border-radius: 6px; padding: 2px 7px; }
.sn-cheap { background: #e8f5e9; color: #1b7a34; }
.sn-promo { background: #fdecea; color: #c0392b; }
.sn-price { font-weight: 700; color: #222; font-size: .95rem; text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; line-height: 1.2; }
.sn-price small { font-weight: 400; color: #999; font-size: .68rem; }
.sn-missing-h { margin-top: 14px; font-weight: 600; color: #6b7280; font-size: .85rem; }
.sn-missing-sub { margin-top: 2px; font-size: .78rem; color: #9ca3af; }
.sn-row-missing .sn-name { color: #999; }
.sn-alt { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: .82rem; color: #1976d2; text-decoration: none; }
.sn-alt b { color: #1b7a34; }
.sn-alt-img { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid #eef0f2; }
.sn-summary { margin-top: 14px; padding: 11px 12px; background: #f6fbf7; border: 1px solid #d9efdf; border-radius: 10px; font-size: .85rem; color: #37613f; text-align: center; }

/* Модал за резултати + overlay (клас-базирани; ползвани и от рендерите) */
.results-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100050; align-items: center; justify-content: center; padding: 20px; }
.results-modal.show { display: flex; }
.results-modal-content { background: white; border-radius: 20px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.results-modal-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; border-radius: 20px 20px 0 0; }
.results-modal-body { padding: 20px; }
.results-modal-close { width: 36px; height: 36px; border-radius: 50%; border: none; background: #f5f5f5; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 100060; }
.loading-spinner { width: 50px; height: 50px; border: 4px solid #f0f0f0; border-top-color: #3498db; border-radius: 50%; animation: sptools-spin 1s linear infinite; }
.loading-text { margin-top: 15px; color: #666; font-weight: 500; }
@keyframes sptools-spin { to { transform: rotate(360deg); } }

@media (max-width: 576px) {
    .action-buttons { grid-template-columns: 1fr; }
}

/* Картата за отстъпка на избраната верига (karti.php) */
.sn-card-btn, .sn-card-add { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin: 10px 0 4px;
    border-radius: 12px; font-weight: 700; text-decoration: none; font-size: .95rem; padding: 8px 12px; text-align: center; }
.sn-card-btn { background: var(--primary-blue, #4461F2); color: #fff; }
.sn-card-btn:hover { color: #fff; }
.sn-card-add { background: #f2f5ff; color: var(--primary-blue, #4461F2); border: 1px dashed #c9cfe0; font-size: .88rem; }
