:root {
    --primary-color: #e21b1b;
    --secondary-color: #1a73e8;
    --bg-light: #f8fafc;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --radius: 12px;
}

body.dark-theme {
    --bg-light: #0f172a;
    --text-dark: #f1f5f9;
    --text-gray: #94a3b8;
    --border-color: #1e293b;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

body.dark-theme header,
body.dark-theme .city-card,
body.dark-theme .pharmacy-card,
body.dark-theme .search-box {
    background: #1e293b;
}

body.dark-theme .home-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

body.dark-theme .btn-icon:hover {
    background: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Redesign */
.main-header {
    background: #fff;
    min-height: 80px;
    display: flex;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 26px;
    font-weight: 900;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -1.5px;
    text-transform: uppercase;
}

.logo span {
    color: var(--primary-color);
}

.top-nav {
    display: flex;
    gap: 15px;
}

.top-nav a {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.top-nav a:hover {
    background: #f1f5f9;
    color: var(--text-dark);
}

/* Home Section Overhaul */
.home-hero {
    background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.location-trigger {
    display: flex;
    justify-content: center;
    margin: -15px auto 40px;
}

#findMe.btn {
    background: #fff;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#findMe.btn:hover {
    background: var(--bg-light);
    border-color: var(--secondary-color);
}

.search-box {
    max-width: 600px;
    margin: 0 auto 40px;
    background: #fff;
    padding: 10px;
    border-radius: 50px;
    display: flex;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0 25px;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.search-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: scale(1.05);
}

/* Cities Grid Redesign */
.cities-wrapper {
    padding: 40px 0;
}

.grid-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.city-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.city-card i {
    color: var(--primary-color);
    font-size: 10px;
}

.city-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(226, 27, 27, 0.1);
    transform: translateY(-2px);
    color: var(--primary-color);
}

/* List Page Redesign */
.list-section {
    padding: 40px 0;
}

.pharmacy-list {
    max-width: 900px;
    margin: 0 auto;
}

.pharmacy-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 0;
    /* Changed from 25px to accommodate inner padding */
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pharmacy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.pharmacy-info h2 {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.pharmacy-info p {
    color: var(--text-gray);
    font-size: clamp(14px, 3.5vw, 15px);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.4;
}

.pharmacy-info i {
    color: var(--primary-color);
    width: 16px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 320px;
    flex-shrink: 0;
}

body.dark-theme .card-footer {
    border-top-color: #334155 !important;
}

.btn {
    min-height: 48px;
    /* Touch target minimum */
    padding: 12px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-directions {
    background: var(--secondary-color);
    color: #fff;
}

.btn-call {
    background: #22c55e;
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Footer Refined */
.main-footer {
    background: #1e1e1e;
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 800;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #888;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-top {
        justify-content: center;
    }

    .top-nav {
        display: none;
    }

    .hero-title {
        font-size: 24px;
    }

    .pharmacy-card {
        flex-direction: column;
        gap: 20px;
    }

    .action-buttons {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .btn {
        min-height: 42px;
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 8px;
    }

    .search-box {
        padding: 5px;
        margin-bottom: 25px;
    }

    .search-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

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