/* ============================================================
   Apteki24h — style główny (szablon)
   Paleta: zieleń (emerald) + niebieski (blue) na jasnym tle
   ============================================================ */

:root {
  /* kolory główne */
  --green: #10b981;
  --green-dark: #059669;
  --green-light: #d1fae5;
  --green-lighter: #ecfdf5;

  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #dbeafe;
  --blue-lighter: #eff6ff;

  /* statusy */
  --status-open: #10b981;
  --status-closing: #f59e0b;
  --status-closed: #9ca3af;

  /* neutralne */
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  /* odstępy i zaokrąglenia */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .08);

  --container: 1200px;
}

/* reset kompaktowy */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ==================== HEADER ==================== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 12px; padding-bottom: 12px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; color: var(--green-dark);
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  display: grid; place-items: center; color: #fff; font-weight: 900;
}
.main-nav { display: flex; gap: 20px; font-size: .95rem; }
.main-nav a { color: var(--text); }
.main-nav a:hover { color: var(--green-dark); text-decoration: none; }
.lang-switcher {
  display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius-sm);
  padding: 4px; border: 1px solid var(--border);
}
.lang-switcher a {
  padding: 4px 10px; border-radius: 4px; color: var(--text-muted);
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
.lang-switcher a.active { background: var(--green); color: #fff; }

/* ==================== HERO (home) ==================== */
.hero {
  background: linear-gradient(135deg, var(--green-lighter) 0%, var(--blue-lighter) 100%);
  padding: 60px 0 50px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.4rem; font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--blue-dark) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead {
  font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px;
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.search-box {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 20px;
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px;
  align-items: end;
}
.search-box .field { text-align: left; }
.search-box label {
  display: block; font-size: .8rem; color: var(--text-muted);
  font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em;
}
.search-box input, .search-box select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus, .search-box select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light);
}
.btn {
  padding: 10px 22px; border: none; border-radius: var(--radius-sm);
  background: var(--green); color: #fff; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: scale(.98); }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-outline {
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.search-options {
  margin-top: 16px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.checkbox {
  display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted);
  cursor: pointer; font-size: .95rem;
}
.checkbox input { accent-color: var(--green); }

/* ==================== SEKCJE ==================== */
.section { padding: 50px 0; }
.section-alt { background: var(--surface); }
.section-title {
  font-size: 1.6rem; margin-bottom: 8px; text-align: center;
}
.section-subtitle {
  text-align: center; color: var(--text-muted); margin-bottom: 30px;
}

/* grid miast/województw */
.city-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.city-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: var(--radius);
  transition: all .15s; color: var(--text); display: flex;
  align-items: center; justify-content: space-between;
}
.city-card:hover {
  border-color: var(--green); box-shadow: var(--shadow);
  transform: translateY(-2px); text-decoration: none;
}
.city-card strong { display: block; font-size: 1.02rem; }
.city-card .count { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.city-card .arrow { color: var(--green); font-weight: 800; }

.voi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.voi-card {
  background: linear-gradient(135deg, var(--blue-lighter) 0%, var(--green-lighter) 100%);
  border: 1px solid var(--blue-light); padding: 14px 16px;
  border-radius: var(--radius); color: var(--text);
  display: flex; justify-content: space-between; align-items: center;
  transition: all .15s;
}
.voi-card:hover {
  border-color: var(--blue); transform: translateY(-2px);
  box-shadow: var(--shadow); text-decoration: none;
}
.voi-card .num {
  background: var(--blue); color: #fff; font-size: .8rem;
  padding: 2px 8px; border-radius: 12px; font-weight: 600;
}

/* sekcja 24h CTA */
.cta-24h {
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  color: #fff; padding: 40px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  flex-wrap: wrap;
}
.cta-24h h2 { color: #fff; font-size: 1.8rem; margin-bottom: 8px; }
.cta-24h p { color: rgba(255, 255, 255, .9); margin-bottom: 0; }
.cta-24h .btn {
  background: #fff; color: var(--green-dark); font-weight: 700;
}
.cta-24h .btn:hover { background: var(--green-lighter); }

/* ==================== BREADCRUMBS ==================== */
.breadcrumbs {
  padding: 14px 0; font-size: .9rem; color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--green-dark); }
.breadcrumbs .sep { margin: 0 8px; color: var(--text-light); }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

/* ==================== MIASTO: hero + opis ==================== */
.city-hero {
  background: var(--surface); padding: 30px 0 20px; border-bottom: 1px solid var(--border);
}
.city-hero h1 {
  font-size: 2rem; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.city-hero .count-badge {
  background: var(--green-light); color: var(--green-dark);
  padding: 4px 12px; border-radius: 20px; font-size: 1rem; font-weight: 600;
}
.city-hero .meta {
  color: var(--text-muted); font-size: .95rem;
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px;
}
.city-hero .toggle-24h {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--green-lighter);
  border: 1px solid var(--green-light); border-radius: var(--radius);
  color: var(--green-dark); font-weight: 600;
}
.city-hero .toggle-24h:hover { background: var(--green-light); text-decoration: none; }

.ai-desc {
  background: var(--surface); border-left: 4px solid var(--blue);
  padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text); margin: 24px 0; line-height: 1.7;
  box-shadow: var(--shadow-sm);
}

/* ==================== LAYOUT mapa + lista ==================== */
.city-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 24px;
  margin-top: 20px;
}
.map-wrap {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); position: sticky; top: 80px;
  height: calc(100vh - 100px); min-height: 500px;
}
#map { width: 100%; height: 100%; }

/* ==================== FILTRY ==================== */
.filters-bar {
  background: var(--surface); padding: 14px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.filters-bar .search-input {
  flex: 1; min-width: 200px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.filters-bar select {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff;
}

/* ==================== LISTA APTEK ==================== */
.pharmacy-list { display: grid; gap: 12px; }
.pharmacy-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  transition: all .15s; position: relative;
}
.pharmacy-card:hover {
  border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-1px);
}
.pharmacy-card .top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}
.pharmacy-card h3 {
  font-size: 1.1rem; margin: 0;
}
.pharmacy-card h3 a { color: var(--text); }
.pharmacy-card h3 a:hover { color: var(--green-dark); text-decoration: none; }
.pharmacy-card .address {
  color: var(--text-muted); font-size: .92rem; margin: 4px 0;
}
.pharmacy-card .address .icon { color: var(--blue); margin-right: 4px; }
.pharmacy-card .bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  flex-wrap: wrap; gap: 10px;
}
.pharmacy-card .phone {
  color: var(--blue-dark); font-weight: 600; font-size: .95rem;
}
.pharmacy-card .actions { display: flex; gap: 8px; }
.pharmacy-card .btn-sm {
  padding: 6px 12px; font-size: .85rem; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong);
  cursor: pointer; transition: all .15s;
}
.pharmacy-card .btn-sm:hover { background: var(--green-lighter); border-color: var(--green); }

/* ==================== BADGE STATUSU ==================== */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px; font-size: .82rem; font-weight: 600;
  white-space: nowrap;
}
.status-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  animation: pulse 2s infinite;
}
.status-badge.open { background: var(--green-light); color: var(--green-dark); }
.status-badge.open .dot { background: var(--status-open); }
.status-badge.closing { background: #fef3c7; color: #92400e; }
.status-badge.closing .dot { background: var(--status-closing); animation: pulse-warn 1s infinite; }
.status-badge.closed { background: #f3f4f6; color: var(--text-muted); }
.status-badge.closed .dot { background: var(--status-closed); animation: none; }
.status-badge.h24 {
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  color: #fff;
}
.status-badge.h24 .dot { background: #fff; }
.status-badge.unknown { background: var(--bg); color: var(--text-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.badge-24h {
  display: inline-block; padding: 2px 8px; background: var(--blue); color: #fff;
  font-size: .72rem; font-weight: 700; border-radius: 4px; letter-spacing: .05em;
  margin-left: 6px; vertical-align: middle;
}

/* ==================== KARTA APTEKI ==================== */
.pharmacy-hero {
  background: var(--surface); padding: 30px 0; border-bottom: 1px solid var(--border);
}
.pharmacy-hero h1 {
  font-size: 2rem; margin-bottom: 8px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.pharmacy-hero .subtitle {
  color: var(--text-muted); font-size: 1.05rem;
}

.pharmacy-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 24px;
}
.info-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.info-card h2 {
  font-size: 1.15rem; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--green-light); display: flex; align-items: center; gap: 8px;
}
.info-row {
  display: flex; padding: 8px 0; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row .key {
  min-width: 130px; color: var(--text-muted); font-size: .9rem; font-weight: 500;
}
.info-row .val { color: var(--text); font-weight: 500; }
.info-row .val a { color: var(--blue-dark); }

.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td {
  padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: .95rem;
}
.hours-table tr.today td {
  background: var(--green-lighter); font-weight: 600; color: var(--green-dark);
}
.hours-table .day { width: 40%; color: var(--text-muted); }
.hours-table tr.today .day { color: var(--green-dark); }
.hours-table .hours { text-align: right; }

.map-tall {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); height: 400px; margin-bottom: 20px;
}

/* ==================== PAGINACJA ==================== */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin: 32px 0 20px; flex-wrap: wrap;
}
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: all .15s;
}
.pagination a:hover {
  border-color: var(--green); color: var(--green-dark);
  background: var(--green-lighter); text-decoration: none;
}
.pagination .current {
  background: var(--green); color: #fff; border-color: var(--green);
  cursor: default;
}
.pagination .dots {
  border: none; background: transparent; color: var(--text-muted);
  font-weight: 400;
}
.pagination .prev, .pagination .next {
  padding: 0 16px; font-weight: 500;
}
.pagination .disabled {
  color: var(--text-light); background: var(--bg); cursor: not-allowed;
  border-color: var(--border);
}
.pagination .disabled:hover {
  border-color: var(--border); color: var(--text-light);
  background: var(--bg); cursor: not-allowed;
}
.pagination-info {
  text-align: center; color: var(--text-muted); font-size: .9rem;
  margin-top: -8px; margin-bottom: 20px;
}

/* ==================== "W POBLIŻU" ==================== */
.nearby-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-top: 16px;
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: #1f2937; color: #d1d5db; padding: 40px 0 20px; margin-top: 60px;
}
.site-footer a { color: #9ca3af; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer ul li { padding: 3px 0; font-size: .9rem; }
.footer-bottom {
  border-top: 1px solid #374151; padding-top: 20px; text-align: center;
  font-size: .85rem; color: #9ca3af;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .search-box { grid-template-columns: 1fr 1fr; }
  .search-box .btn-field { grid-column: 1 / -1; }
  .city-layout, .pharmacy-layout { grid-template-columns: 1fr; }
  .map-wrap { position: static; height: 400px; min-height: 400px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 1.8rem; }
  .search-box { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-24h { flex-direction: column; text-align: center; }
  .city-hero h1 { font-size: 1.4rem; }
  .pharmacy-hero h1 { font-size: 1.5rem; }
  .info-row { flex-direction: column; gap: 2px; }
  .info-row .key { min-width: auto; }
}
