:root {
    --primary: var(--brand-primary);
    --primary-light: var(--brand-primary-alpha);
    --danger: var(--status-danger);
    --warning: var(--status-warning);
    /* --text-primary and --text-secondary come from theme_tokens.css — not redeclared */
    --bg-page: var(--bg-primary);   /* #f8f9fa light gray */
    --bg-card: var(--card-bg);       /* #ffffff white */
    --border: var(--border-color);   /* #dee2e6 */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; background: var(--bg-page); color: var(--text-primary); min-height: 100vh; }
.header { background: var(--primary); color: var(--text-inverse); padding: 1rem; position: sticky; top: 0; z-index: 1000; }
.header-content { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.5rem; font-weight: 700; text-decoration: none; color: var(--text-inverse); }
.header-badge { background: rgba(255,255,255,0.2); padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; }
.main-container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.search-section { background: var(--bg-card); border-radius: 12px; padding: 1.5rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.search-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.search-title i { color: var(--primary); }
.search-form { display: flex; gap: 1rem; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 200px; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
.search-form button { background: var(--primary); color: var(--text-inverse); border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.search-form button:hover { background: var(--brand-hover); }
.locate-btn { background: var(--brand-primary) !important; }
.locate-btn:hover { background: var(--brand-hover) !important; }
.results-section { display: grid; grid-template-columns: 1fr 400px; gap: 1rem; min-height: 500px; }

@media (max-width: 900px) {
    .results-section { grid-template-columns: 1fr; }
    /* Map goes below list on tablet */
    .map-section { position: static; height: auto; }
    #map { height: 320px; }
}

@media (max-width: 600px) {
    .main-container { padding: 0.75rem; }
    .search-section { padding: 1rem; }
    .search-form { flex-direction: column; gap: 0.75rem; }
    .search-form input { min-width: unset; width: 100%; font-size: 16px; /* prevent iOS zoom */ }
    .search-form button { width: 100%; justify-content: center; min-height: 48px; }
    .locate-btn { width: 100%; min-height: 48px; }
    #map { height: 250px; }
    .pharmacy-header { flex-direction: column; gap: 0.5rem; }
    .pharmacy-badges { flex-wrap: wrap; }
    .action-btn { min-height: 44px; font-size: 0.9rem; }
    .search-title { font-size: 1.1rem; }
}
.pharmacy-list { display: flex; flex-direction: column; gap: 1rem; }
.list-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.list-count { font-weight: 600; color: var(--text-secondary); }
.pharmacy-card { background: var(--bg-card); border-radius: 12px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.pharmacy-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.pharmacy-card.active { border: 2px solid var(--primary); }
.pharmacy-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.pharmacy-name { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.pharmacy-badges { display: flex; gap: 0.5rem; }
.badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.badge-garde { background: var(--primary-light); color: var(--primary); }
.badge-partner { background: var(--brand-primary-alpha); color: var(--brand-primary); }
.badge-verified { background: var(--status-warning-light, rgba(245,158,11,0.12)); color: var(--status-warning); }
.pharmacy-info { display: flex; flex-direction: column; gap: 0.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.pharmacy-info-row { display: flex; align-items: center; gap: 0.5rem; }
.pharmacy-info-row i { width: 16px; color: var(--text-secondary); }
.pharmacy-actions { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.action-btn { flex: 1; padding: 0.5rem; border: none; border-radius: 6px; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none; }
.action-btn-call { background: var(--primary); color: var(--text-inverse); }
.action-btn-directions { background: var(--brand-primary); color: var(--text-inverse); }
.map-section { background: var(--bg-card); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: sticky; top: 80px; height: fit-content; }
#map { height: 500px; width: 100%; }
.empty-state { text-align: center; padding: 3rem; color: var(--text-secondary); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.loading { display: none; text-align: center; padding: 2rem; }
.loading.active { display: block; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.duty-times { background: var(--primary-light); padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.85rem; margin-top: 0.5rem; }
.duty-times strong { color: var(--primary); }
.footer { text-align: center; padding: 2rem; color: var(--text-secondary); font-size: 0.9rem; }
.footer a { color: var(--primary); text-decoration: none; }
