:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #3b82f6;
    --dark: #1f2937;
    --light: #f9fafb;
    --border: #e5e7eb;
    --text-muted: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f3f4f6;
    color: var(--dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea, select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Header & Navbar */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-dark);
    text-decoration: none;
}

.brand-icon {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 8px;
    border-radius: 10px;
    font-size: 1.2rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    padding: 50px 0 60px 0;
    text-align: center;
    position: relative;
    overflow: visible;
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 650px;
    margin: 0 auto 30px auto;
}

/* Search Box Container */
.search-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 10px;
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-input-group {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-input-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    background: #f9fafb;
    box-sizing: border-box;
}

.search-input-group input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.search-input-group .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.state-select {
    width: 150px;
    padding: 14px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.btn-scan-qr {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--dark);
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-scan-qr:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-search {
    background: var(--primary-dark);
    color: #ffffff;
    border: none;
    padding: 14px 26px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-search:hover {
    background: #047857;
}

/* Geo status pill */
.geo-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

/* Product Cards Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-light);
}

.product-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-ean {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 14px;
}

.price-box {
    background: #f0fdf4;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #bbf7d0;
}

.price-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #166534;
}

.price-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #15803d;
    margin: 2px 0 0 0;
}

.price-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px dashed #dcfce7;
    padding-top: 6px;
    margin-top: 6px;
}

.btn-compare {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-compare:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: #ffffff;
    border-radius: 20px;
    max-width: 750px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

/* Lista de Preços por Loja */
.store-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    background: #ffffff;
    transition: all 0.2s;
}

.store-price-row.lowest {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.badge-lowest {
    background: #10b981;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

/* Footer */
footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Chips de Distância - Lista de Compras */
.dist-chip {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dist-chip:hover {
    border-color: #10b981;
    color: #059669;
}

.dist-chip.active {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}
