:root {
    color-scheme: dark;
    --bg: #07101c;
    --panel: rgba(14, 24, 39, 0.9);
    --line: rgba(164, 188, 220, 0.18);
    --text: #f7f8fb;
    --muted: #9aa8ba;
    --red: #ff3439;
    --orange: #ff7640;
    --violet: #9b56ff;
}

* { box-sizing: border-box; }

html {
    background: var(--bg);
}

body {
    margin: 0 auto;
    width: min(100%, var(--app-mobile-width, 430px));
    max-width: var(--app-page-max-width, 430px);
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at 75% 8%, rgba(255, 52, 57, 0.25), transparent 34%), var(--bg);
    color: var(--text);
    padding-bottom: 24px;
}

a { color: inherit; }

.pharmacy-page .site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    width: min(100%, var(--app-mobile-width, 430px));
    border-radius: 0 0 26px 26px;
    background: rgba(7, 16, 28, 0.94);
    border: 1px solid rgba(164, 188, 220, 0.16);
    border-top: 0;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(22px);
}

.pharmacy-page .site-header .top-row {
    padding-top: 14px;
}

.pharmacy-page .section-tabs {
    padding-bottom: 12px;
}

.pharmacy-page .home-side-menu:not([hidden]) {
    display: block;
}

.pharmacy-page.home-menu-open {
    overflow: hidden;
}

.pharmacy-shell {
    width: min(100%, var(--app-mobile-width, 430px));
    max-width: var(--app-page-max-width, 430px);
    margin: 0 auto;
    padding: 138px 18px 132px;
}

.pharmacy-hero {
    min-height: 190px;
    border-radius: 0 0 34px 34px;
    background: linear-gradient(90deg, rgba(7, 16, 28, 0.94), rgba(7, 16, 28, 0.68) 58%, rgba(7, 16, 28, 0.24)), #07101c url("../images/bursadaki-nobetci-eczaneler.png") right center / contain no-repeat;
    margin: 0 -18px 18px;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-bottom: 1px solid var(--line);
}

.pharmacy-hero h1,
.pharmacy-hero p {
    max-width: 58%;
}

.pharmacy-hero h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.04;
    letter-spacing: 0;
}

.pharmacy-hero p {
    margin: 10px 0 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
}

.sync-card button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: rgba(12, 22, 36, 0.7);
    text-decoration: none;
    color: var(--text);
    font-size: 30px;
}

.hero-copy p {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 800;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.64rem, 8.64vw, 4.8rem);
    line-height: 0.92;
    letter-spacing: 0;
}

.hero-copy span {
    color: var(--red);
}

.sync-card,
.search-card,
.pharmacy-item,
.stale-warning {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.sync-card {
    border-radius: 24px;
    padding: 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
}

.sync-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--red), var(--orange));
    font-size: 34px;
    font-weight: 900;
}

.sync-card p,
.sync-card strong {
    margin: 0;
}

.sync-card p {
    color: var(--muted);
    font-size: 0.875rem;
}

.sync-card a {
    color: var(--text);
    font-weight: 500;
}

.sync-card button {
    color: var(--orange);
    cursor: pointer;
}

.search-card {
    margin-top: 14px;
    border-radius: 26px;
    padding: 16px;
}

.district-select {
    display: block;
}

.district-select summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    list-style: none;
    border-radius: 20px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 10px 26px rgba(255, 97, 50, 0.28);
    color: var(--text);
    cursor: pointer;
    font-size: 1.02rem;
    font-weight: 900;
}

.district-select summary::-webkit-details-marker {
    display: none;
}

.district-select summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}

.district-select[open] summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
}

.district-select summary span {
    min-width: 0;
}

.district-select summary b {
    margin-left: auto;
    font-size: 0.98rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 0 18px;
    background: rgba(8, 17, 30, 0.82);
}

.search-box span {
    font-size: 30px;
    color: var(--muted);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.district-rail {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding: 12px 0 0;
    margin: 0;
    scrollbar-width: auto;
    mask-image: none;
}

.district-rail::-webkit-scrollbar {
    display: none;
}

.district-rail button,
.district-rail a {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0 16px;
    background: rgba(8, 17, 30, 0.64);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    white-space: normal;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.district-rail button:active,
.district-rail a:active {
    transform: scale(0.97);
}

.district-rail button.active,
.district-rail a.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 10px 26px rgba(255, 97, 50, 0.28);
}

.district-rail span {
    margin-left: 5px;
    color: inherit;
    opacity: 0.78;
}

.location-toggle {
    margin-top: 14px;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-radius: 22px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(80, 44, 160, 0.7), rgba(255, 52, 57, 0.22));
}

.location-toggle b,
.location-toggle small {
    display: block;
}

.location-toggle small {
    color: var(--text);
    opacity: 0.78;
    margin-top: 5px;
}

.location-toggle input {
    appearance: none;
    flex: 0 0 auto;
    width: 56px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(8, 17, 30, 0.72);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.26);
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.location-toggle input::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    top: 4px;
    left: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.32);
    transition: transform 0.2s ease;
}

.location-toggle input:checked {
    border-color: rgba(255, 120, 76, 0.85);
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 10px 24px rgba(255, 97, 50, 0.22);
}

.location-toggle input:checked::after {
    transform: translateX(20px);
}

.stale-warning {
    margin-top: 14px;
    border-radius: 18px;
    padding: 14px 16px;
    color: #ffd9cb;
    font-size: 13px;
    font-weight: 300;
}

.pharmacy-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.pharmacy-item {
    border-radius: 24px;
    padding: 18px;
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 14px;
}

.pharmacy-mark {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--red);
    background: rgba(255, 52, 57, 0.12);
    border: 1px solid rgba(255, 52, 57, 0.35);
    font-size: 34px;
    font-weight: 900;
}

.pharmacy-item h2 {
    margin: 0 0 6px;
    font-size: 1.08rem;
    line-height: 1.15;
}

.pharmacy-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.pharmacy-card h2 {
    margin: 0 0 12px;
    font-size: 1.22rem;
}

.pharmacy-card p,
.pharmacy-card span {
    display: block;
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.45;
}

.pharmacy-card span {
    color: var(--muted);
}

.pharmacy-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.pharmacy-item p + p {
    margin-top: 6px;
}

.pharmacy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: var(--orange);
    font-weight: 800;
}

.pharmacy-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pharmacy-actions a {
    min-height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 900;
    background: rgba(25, 37, 58, 0.86);
}

.pharmacy-actions a:first-child {
    color: var(--red);
}

.empty-state {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px;
    background: rgba(12, 22, 36, 0.82);
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
}

@media (min-width: 960px) and (max-width: 520px) {
    .pharmacy-hero {
        min-height: 250px;
    }

    .pharmacy-hero h1 {
        font-size: 2.4rem;
    }

    .pharmacy-item {
        grid-template-columns: 72px 1fr auto;
        align-items: center;
    }

    .pharmacy-mark {
        width: 72px;
        height: 72px;
    }

    .pharmacy-actions {
        grid-column: auto;
        width: 180px;
    }
}
