/* ===== MarktScience — Premium UI ===== */

/* Store health indicator ring (blinking warning around dot) */
.store-ring {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ef4444;
    animation: store-blink 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes store-blink {
    0%, 100% { opacity: 1; border-color: #ef4444; }
    50% { opacity: 0.2; border-color: #fbbf24; }
}

[data-store].store-error .store-dot {
    opacity: 0.4;
}

[data-store].store-error .store-ring {
    display: block !important;
}

[data-store].store-ok .store-ring {
    display: none !important;
}

/* Store filter active state */
.store-filter-btn.active-filter {
    background: rgba(249, 115, 22, 0.10);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
}
.store-filter-btn.dimmed {
    opacity: 0.35;
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== Category Pills ===== */
.category-pill {
    padding: 0.5rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.category-pill:hover {
    border-color: #fb923c;
    color: #f97316;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    transform: translateY(-1px);
}

.category-pill.active {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* ===== Comparison Card (unified for deals + search) ===== */
.comparison-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comparison-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.12);
}

/* ===== Savings Badge ===== */
.savings-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
    letter-spacing: 0.01em;
}

/* ===== Skeleton Loading ===== */
.skeleton-card {
    background: white;
    border-radius: 1.125rem;
    height: 280px;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(249,115,22,0.04), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== Search Dropdown ===== */
.search-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8fafc;
}

.search-item:hover {
    background: linear-gradient(135deg, #f8fafc, #fff7ed);
}

.search-item:last-child {
    border-bottom: none;
}

/* ===== Card Entrance Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.comparison-card {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.comparison-card:nth-child(1)  { animation-delay: 0.0s; }
.comparison-card:nth-child(2)  { animation-delay: 0.06s; }
.comparison-card:nth-child(3)  { animation-delay: 0.12s; }
.comparison-card:nth-child(4)  { animation-delay: 0.18s; }
.comparison-card:nth-child(5)  { animation-delay: 0.24s; }
.comparison-card:nth-child(6)  { animation-delay: 0.30s; }
.comparison-card:nth-child(7)  { animation-delay: 0.36s; }
.comparison-card:nth-child(8)  { animation-delay: 0.42s; }
.comparison-card:nth-child(9)  { animation-delay: 0.48s; }
.comparison-card:nth-child(10) { animation-delay: 0.54s; }
.comparison-card:nth-child(11) { animation-delay: 0.60s; }
.comparison-card:nth-child(12) { animation-delay: 0.66s; }

/* ===== Hero Section Gradient ===== */
.hero-gradient {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Smooth focus states ===== */
input:focus, button:focus-visible {
    outline: none;
    ring: 2px;
}

/* ===== Body background subtle pattern ===== */
body {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-attachment: fixed;
}

/* ===== Basket Panel ===== */
#basketPanel.open {
    transform: translateX(0);
}

#basketOverlay.open {
    display: block;
    opacity: 1;
}

/* Basket add button on cards */
.basket-add-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.basket-add-btn:hover {
    border-color: #f97316;
    color: #f97316;
    background: #fff7ed;
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.2);
}

.basket-add-btn.in-basket {
    border-color: #22c55e;
    color: white;
    background: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.basket-add-btn.in-basket:hover {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* Basket item in panel */
.basket-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.basket-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Cheapest store highlight in basket totals */
.basket-total-cheapest {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

/* Toast notification for basket actions */
.basket-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    z-index: 80;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.basket-toast.show {
    transform: translateX(-50%) translateY(0);
}