/* ============================================
   KROMPARE - Grocery Price Scout PWA
   Modern Mobile-First Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #6366f1;
    --secondary-dark: #4f46e5;
    --accent: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
    
    --header-height: 64px;
    --footer-height: auto;
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--primary-dark); }

/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ============================================
   CONSENT OVERLAY
   ============================================ */
.consent-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.consent-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.consent-modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.consent-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.consent-logo .logo-icon {
    font-size: 3rem;
}

.consent-logo h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.consent-modal h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.consent-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.consent-policies {
    text-align: left;
    margin-bottom: 1.5rem;
}

.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.consent-checkbox:hover {
    background: var(--bg-tertiary);
}

.consent-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.consent-checkbox span:last-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.consent-checkbox a {
    font-weight: 600;
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.app-container.visible {
    opacity: 1;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-desktop {
    display: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem;
    transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.nav-toggle {
    display: flex;
}

.nav-mobile {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.nav-mobile.show {
    display: flex;
}

.nav-mobile a {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--border-radius-sm);
}

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

.list-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.list-badge:empty, .list-badge[data-count="0"] {
    display: none;
}

/* ============================================
   AD BANNERS
   ============================================ */
.ad-banner {
    background: var(--bg-tertiary);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.ad-top {
    min-height: 60px;
}

.ad-sidebar {
    display: none;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    background: var(--bg-tertiary);
    z-index: 50;
}

.ad-placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

.section {
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 0 1rem;
    transition: all var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 0.75rem;
    font-size: 1rem;
    background: transparent;
}

.btn-scan {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.btn-scan:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--bg-primary);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
}

.btn-full {
    width: 100%;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem;
}

.btn-text:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn-scout {
    flex-shrink: 0;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-state p {
    color: var(--text-secondary);
}

/* ============================================
   RESULTS
   ============================================ */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-header h2 {
    font-size: 1.25rem;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Best Value Card */
.best-value-card {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.best-value-badge {
    position: absolute;
    top: -12px;
    left: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.best-value-content {
    margin-top: 0.5rem;
}

.smart-tip {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--primary-light);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.smart-tip::before {
    content: '💡 Smart Tip: ';
    font-weight: 600;
    color: var(--primary-dark);
}

/* Results Grid */
.results-grid {
    display: grid;
    gap: 1rem;
}

/* Product Card */
.product-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-card.best-value {
    border: 2px solid var(--primary);
}

.product-image {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    font-size: 2rem;
}

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

.product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-store {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.product-store img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price-old {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn-favorite {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-favorite:hover, .btn-favorite.active {
    color: var(--danger);
    transform: scale(1.1);
}

.btn-favorite.active svg {
    fill: var(--danger);
}

.btn-add-list {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition-fast);
}

.btn-add-list:hover {
    background: var(--primary-dark);
}

.btn-details {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-details:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Disclaimer */
.disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

/* ============================================
   STORE RESULTS
   ============================================ */
.store-results {
    margin-bottom: 2rem;
}

.store-cards {
    display: grid;
    gap: 0.75rem;
}

.store-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.store-card:hover {
    box-shadow: var(--shadow);
}

.store-logo {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.store-name {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.store-distance {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-directions {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-directions:hover {
    background: var(--primary-dark);
    color: white;
}

/* ============================================
   SHOPPING LIST SIDEBAR
   ============================================ */
.shopping-list {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 360px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-slow);
}

.shopping-list.open {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.list-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
}

.list-header h2 {
    font-size: 1.125rem;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-small {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon-small:hover {
    background: var(--primary);
    color: white;
}

.list-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    animation: slideIn 0.2s ease;
}

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

.list-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.list-item-name {
    flex: 1;
    font-size: 0.95rem;
}

.list-item.checked .list-item-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

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

.btn-remove-item {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.btn-remove-item:hover {
    color: var(--danger);
}

.empty-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-list svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-list .hint {
    font-size: 0.85rem;
}

.manual-add {
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.manual-add input {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}

.manual-add .btn-primary {
    padding: 0.625rem 1rem;
}

.list-footer {
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.list-footer .btn-secondary {
    flex: 1;
    justify-content: center;
    padding: 0.625rem 0.5rem;
    font-size: 0.8rem;
}

/* ============================================
   FAVORITES
   ============================================ */
.favorites-section {
    padding: 1rem 0;
}

.favorites-grid {
    display: grid;
    gap: 1rem;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform var(--transition);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-large {
    max-width: 640px;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.125rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

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

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

/* Stores Grid in Modal */
.stores-search {
    margin-bottom: 1rem;
}

.stores-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
}

.stores-grid {
    display: grid;
    gap: 0.75rem;
}

.store-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.store-item:hover {
    background: var(--bg-tertiary);
}

.store-item-logo {
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.store-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.store-item-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.store-item-actions .btn-add-list {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
}

.store-item-actions a {
    font-size: 0.75rem;
    color: var(--primary);
}

/* Legal Content */
.legal-content {
    font-size: 0.9rem;
}

.legal-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.legal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

/* Contact Form */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Scanner */
#scanner-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-frame {
    width: 200px;
    height: 100px;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
    animation: scanPulse 2s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { border-color: var(--primary); }
    50% { border-color: var(--primary-light); }
}

.scanner-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.scanner-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.history-item-info {
    flex: 1;
}

.history-item-date {
    font-weight: 500;
}

.history-item-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--text-primary);
    color: var(--text-light);
    padding: 3rem 1rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.footer-section h4 {
    color: var(--primary-light);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--primary-light);
}

.app-badges {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.app-badge {
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.app-badge:hover {
    opacity: 1;
}

.app-badge img {
    height: 40px;
    width: auto;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.social-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
    color: var(--primary-light);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 400;
    opacity: 0;
    transition: all var(--transition-slow);
}

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

.toast.success {
    background: var(--primary);
}

.toast.error {
    background: var(--danger);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 0;
}

.about-content h2 {
    margin-bottom: 1.5rem;
}

.about-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.about-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

.company-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    text-align: center;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (min-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .quick-actions {
        flex-direction: row;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .ad-banner {
        display: flex;
    }
    
    .shopping-list {
        max-width: 400px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 2rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .ad-sidebar {
        display: flex;
    }
}

@media (min-width: 1280px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {
    .header, .footer, .ad-banner, .ad-sidebar, .shopping-list, .modal {
        display: none !important;
    }
    
    .app-container {
        display: block;
    }
    
    .main-content {
        max-width: 100%;
        padding: 0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e293b;
        --bg-secondary: #0f172a;
        --bg-tertiary: #334155;
        --bg-card: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --border-color: #334155;
    }
}
</style>