/* ============================================
   Drops — Price Monitoring Platform
   Light theme stylesheet
   ============================================ */

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --text-primary: #1a1d23;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --accent-green: #059669;
    --accent-red: #dc2626;
    --accent-blue: #2563eb;
    --accent-yellow: #d97706;
    --accent-purple: #7c3aed;
    --accent-orange: #ea580c;
    --border: #e2e4e9;
    --sidebar-width: 240px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: 0.15s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 32px;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: block;
}

.sidebar-brand span {
    color: var(--text-primary);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar nav a {
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar nav a.active {
    background: var(--bg-card);
    color: var(--accent-green);
}

.sidebar nav a .nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-stats {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-stats .stat-row {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.sidebar-stats .stat-num {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Main Content */
.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    max-width: 1400px;
    width: 100%;
}

/* Mobile bottom nav — hidden on desktop */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 56px;
}
.mobile-nav a .nav-icon {
    font-size: 20px;
    line-height: 1;
}
.mobile-nav a.active {
    color: var(--accent-blue);
}

.main-wide {
    max-width: 1600px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-green);
    color: #ffffff;
}

.btn-primary:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-accent {
    background: var(--accent-purple);
    color: #ffffff;
}

.btn-accent:hover {
    background: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-success {
    background: var(--accent-green);
    color: #ffffff;
}

.btn-success:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.18);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card-hover:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.card-grid {
    display: grid;
    gap: 16px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1 { grid-template-columns: 1fr; }

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    transition: color 0.3s;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}

.change-up { color: var(--accent-green); }
.change-down { color: var(--accent-red); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-green { background: rgba(5, 150, 105, 0.12); color: var(--accent-green); }
.badge-red { background: rgba(220, 38, 38, 0.12); color: var(--accent-red); }
.badge-blue { background: rgba(37, 99, 235, 0.12); color: var(--accent-blue); }
.badge-yellow { background: rgba(217, 119, 6, 0.12); color: var(--accent-yellow); }
.badge-purple { background: rgba(124, 58, 237, 0.12); color: var(--accent-purple); }

/* Deal Feed */
.deal-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deal-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.deal-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.deal-card .deal-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.deal-card .deal-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.deal-card .deal-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-card .deal-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.deal-card .deal-pricing {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.deal-card .deal-new-price {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.deal-card .deal-old-price {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.deal-card .deal-drop {
    font-size: 15px;
    font-weight: 700;
}

/* Search / Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--transition);
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.filter-bar input {
    flex: 1;
    min-width: 200px;
}

.filter-bar input::placeholder {
    color: var(--text-muted);
}

.filter-bar select {
    min-width: 140px;
    cursor: pointer;
}

.filter-bar input[type="number"] {
    width: 110px;
    min-width: 0;
    flex: none;
}

/* Site Status Grid */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.site-card {
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.site-card:hover {
    border-color: var(--text-muted);
}

.site-card .site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.site-card .site-name {
    font-weight: 600;
    font-size: 15px;
}

.site-card .site-url {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-card .site-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.site-card .site-stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-top: 2px;
}

.site-card .site-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-card .site-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

/* Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.5);
}

.status-dot.inactive {
    background: var(--text-muted);
}

.status-dot.error {
    background: var(--accent-red);
}

/* SSE / Live Indicator */
.live-indicator {
    position: fixed;
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.live-indicator .pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

/* Shimmer / Skeleton Loading */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-hover) 50%,
        var(--bg-card) 100%
    );
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-heading {
    height: 24px;
    width: 40%;
    margin-bottom: 12px;
}

.skeleton-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
}

.skeleton-stat {
    height: 36px;
    width: 60%;
    margin-bottom: 8px;
}

/* Stats animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-value.animated {
    animation: countUp 0.4s ease-out;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.product-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
}

.product-image-container img {
    max-width: 320px;
    max-height: 320px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
}

.product-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 20px 0;
}

.product-mini-stat {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
}

.product-mini-stat .pms-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.product-mini-stat .pms-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.price-chart-container {
    padding: 24px;
}

.price-chart-container canvas {
    width: 100% !important;
}

.all-time-low-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(5, 150, 105, 0.12);
    color: var(--accent-green);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Alerts list */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 13px;
}

/* Forms */
.form-card {
    max-width: 640px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group .form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle .toggle-track {
    width: 44px;
    height: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition);
    position: relative;
}

.toggle .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition);
}

.toggle input:checked + .toggle-track {
    background: rgba(5, 150, 105, 0.2);
    border-color: var(--accent-green);
}

.toggle input:checked + .toggle-track .toggle-thumb {
    left: 22px;
    background: var(--accent-green);
}

/* Site list in settings */
.site-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.site-list-item:hover {
    background: var(--bg-primary);
}

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

.site-list-info {
    flex: 1;
}

.site-list-name {
    font-weight: 600;
    font-size: 14px;
}

.site-list-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.site-list-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Categories list */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 13px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    border: 1px solid var(--border);
    max-width: 380px;
}

.toast-success {
    background: #ecfdf5;
    color: var(--accent-green);
    border-color: rgba(5, 150, 105, 0.2);
}

.toast-error {
    background: #fef2f2;
    color: var(--accent-red);
    border-color: rgba(220, 38, 38, 0.2);
}

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

/* Stat box (compact stat display) */
.stat-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
}

.stat-box .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-box .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Progress bar */
.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    border: 1px solid var(--border);
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state .empty-desc {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
}

/* Section heading */
.section-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Separator */
.sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Price text */
.price {
    font-variant-numeric: tabular-nums;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

/* Modal / Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Tab navigation */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
    margin-bottom: 4px;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .product-detail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 16px 16px 80px;  /* extra bottom for mobile nav */
    }

    .mobile-nav {
        display: flex;
    }

    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
    }

    .deal-card .deal-pricing {
        gap: 2px;
    }

    .deal-card .deal-new-price {
        font-size: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input,
    .filter-bar select,
    .filter-bar input[type="number"] {
        width: 100%;
        min-width: 0;
    }
}
