@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600&display=swap');

/* =====================================================================
   VET CLINIC MAP — Frontend CSS
   Palette: #083387 (primary) · #fff · #3a3a3a · shadows subtle
   ===================================================================== */

:root {
  --vcm-blue:       #083387;
  --vcm-blue-light: #e8eef9;
  --vcm-blue-mid:   #3056a0;
  --vcm-white:      #ffffff;
  --vcm-dark:       #3a3a3a;
  --vcm-muted:      #6b7280;
  --vcm-border:     #dde3ef;
  --vcm-bg:         #f4f6fb;
  --vcm-shadow-sm:  0 1px 4px rgba(8,51,135,.08);
  --vcm-shadow-md:  0 4px 16px rgba(8,51,135,.12);
  --vcm-shadow-lg:  0 8px 32px rgba(8,51,135,.16);
  --vcm-radius:     10px;
  --vcm-radius-sm:  6px;
  --vcm-panel-w:    340px;
  --vcm-font:       'Open Sans', sans-serif;
}

/* ── Wrapper ─────────────────────────────────────────────────────── */
.vcm-app {
  font-family: var(--vcm-font);
  color: var(--vcm-dark);
  background: var(--vcm-bg);
  border-radius: var(--vcm-radius);
  overflow: hidden;
  box-shadow: var(--vcm-shadow-md);
}

/* ── Search bar ──────────────────────────────────────────────────── */
.vcm-search-bar {
  background: var(--vcm-blue);
  padding: 14px 20px;
}

.vcm-search-inner {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.vcm-select-wrap,
.vcm-input-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.vcm-select-wrap select,
.vcm-input-wrap input[type="search"] {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--vcm-radius-sm);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-family: var(--vcm-font);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.vcm-select-wrap select option { color: var(--vcm-dark); background: #fff; }

.vcm-select-wrap select:focus,
.vcm-input-wrap input:focus {
  border-color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.2);
}

.vcm-select-wrap select::placeholder,
.vcm-input-wrap input::placeholder { color: rgba(255,255,255,.6); }

/* icons inside inputs */
.vcm-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: .75;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
}
.vcm-icon-map   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7'/%3E%3C/svg%3E"); }
.vcm-icon-city  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4'/%3E%3C/svg%3E"); }
.vcm-icon-search{ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E"); }

.vcm-count-badge {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Layout ──────────────────────────────────────────────────────── */
.vcm-layout {
  display: flex;
  height: var(--map-height, 680px);
  min-height: 500px;
}

/* ── Left panel ──────────────────────────────────────────────────── */
.vcm-panel {
  width: var(--vcm-panel-w);
  flex-shrink: 0;
  background: var(--vcm-white);
  border-right: 1px solid var(--vcm-border);
  display: flex;
  flex-direction: column;
}

.vcm-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--vcm-border) transparent;
}

/* Clinic card */
.vcm-card {
  background: var(--vcm-white);
  border: 1px solid var(--vcm-border);
  border-radius: var(--vcm-radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow .2s, border-color .2s, transform .15s;
  position: relative;
}

.vcm-card:hover {
  box-shadow: var(--vcm-shadow-md);
  border-color: var(--vcm-blue-mid);
  transform: translateY(-1px);
}

.vcm-card.vcm-card--active {
  border-color: var(--vcm-blue);
  box-shadow: var(--vcm-shadow-md);
  background: var(--vcm-blue-light);
}

.vcm-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--vcm-blue);
  margin: 0 0 4px;
  line-height: 1.4;
}

.vcm-card__addr {
  font-size: 12px;
  color: var(--vcm-muted);
  margin: 0;
  line-height: 1.5;
}

.vcm-card__dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vcm-border);
}
.vcm-card.vcm-card--has-places .vcm-card__dot { background: #22c55e; }

/* Loading / empty */
.vcm-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 2rem;
  color: var(--vcm-muted);
  font-size: 14px;
}

.vcm-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--vcm-border);
  border-top-color: var(--vcm-blue);
  border-radius: 50%;
  animation: vcm-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes vcm-spin { to { transform: rotate(360deg); } }

.vcm-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--vcm-muted);
  font-size: 14px;
}

/* ── Map ─────────────────────────────────────────────────────────── */
.vcm-map-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

#vcm-map {
  width: 100%;
  height: 100%;
}

/* Marker cluster colours */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background-color: rgba(8,51,135,.15); }
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(8,51,135,.75);
  color: #fff;
  font-family: var(--vcm-font);
  font-weight: 600;
  font-size: 13px;
}

/* Custom pin */
.vcm-pin {
  width: 30px;
  height: 30px;
}

/* ── Drawer (side panel on pin click) ───────────────────────────── */
.vcm-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--vcm-white);
  box-shadow: var(--vcm-shadow-lg);
  z-index: 800;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  border-radius: var(--vcm-radius) 0 0 var(--vcm-radius);
}

.vcm-drawer:not([hidden]) {
  transform: translateX(0);
  display: block;
}

.vcm-drawer[hidden] { display: block; } /* keep in DOM for animation */

.vcm-drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: var(--vcm-bg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--vcm-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 1;
}
.vcm-drawer-close:hover { background: var(--vcm-border); color: var(--vcm-dark); }

.vcm-drawer-body { padding: 20px; }

/* Drawer content */
.vcm-detail__header {
  padding-right: 30px;
  margin-bottom: 16px;
}

.vcm-detail__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--vcm-blue);
  margin: 0 0 4px;
  line-height: 1.4;
}

.vcm-detail__addr {
  font-size: 13px;
  color: var(--vcm-muted);
  margin: 0;
}

.vcm-detail__divider {
  height: 1px;
  background: var(--vcm-border);
  margin: 14px 0;
}

.vcm-detail__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--vcm-dark);
}

.vcm-detail__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  fill: none;
  stroke: var(--vcm-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vcm-detail__row a {
  color: var(--vcm-blue);
  text-decoration: none;
  word-break: break-all;
}
.vcm-detail__row a:hover { text-decoration: underline; }

/* Stars rating */
.vcm-stars {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vcm-stars__val { font-weight: 600; color: var(--vcm-blue); }
.vcm-stars__count { color: var(--vcm-muted); font-size: 12px; }
.vcm-star {
  color: #f59e0b;
  font-size: 14px;
}
.vcm-star--empty { color: var(--vcm-border); }

/* Hours */
.vcm-hours { font-size: 12px; color: var(--vcm-muted); margin-top: 4px; line-height: 1.7; }

/* CTA button */
.vcm-btn-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  margin-top: 16px;
  background: var(--vcm-blue);
  color: #fff;
  border: none;
  border-radius: var(--vcm-radius-sm);
  font-family: var(--vcm-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
  box-shadow: var(--vcm-shadow-sm);
}
.vcm-btn-route:hover {
  background: var(--vcm-blue-mid);
  box-shadow: var(--vcm-shadow-md);
}

/* ── Responsive / mobile ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .vcm-layout {
    flex-direction: column;
    height: auto;
  }

  .vcm-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--vcm-border);
    max-height: 320px;
  }

  #vcm-map {
    height: 420px;
  }

  .vcm-map-wrap {
    height: 420px;
  }

  .vcm-drawer {
    width: 100%;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: var(--vcm-radius) var(--vcm-radius) 0 0;
    transform: translateY(100%);
    max-height: 70vh;
  }
  .vcm-drawer:not([hidden]) { transform: translateY(0); }

  .vcm-search-inner { gap: 8px; }
  .vcm-select-wrap,
  .vcm-input-wrap { flex: 1 1 140px; }
  .vcm-count-badge { display: none; }
}

/* ── Fix: mobile search — kolumnowy układ ───────────────────────── */
@media (max-width: 600px) {
  .vcm-search-inner {
    flex-direction: column;
    gap: 8px;
  }

  .vcm-select-wrap,
  .vcm-input-wrap {
    flex: none;
    width: 100%;
  }

  .vcm-count-badge { display: none; }
}

/* ── Fix: krzyż zamknięcia drawera — reset motywu ───────────────── */
/* Astra / WooCommerce globalny CSS nadpisuje button { width: 100% }  */
.vcm-drawer-close {
  width: 30px  !important;
  height: 30px !important;
  min-width: 0 !important;
  max-width: 30px !important;
  flex: 0 0 30px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  box-sizing: content-box !important;
  font-size: 20px !important;
  border-radius: 50% !important;
  background: var(--vcm-bg) !important;
  color: var(--vcm-muted) !important;
  border: none !important;
  box-shadow: none !important;
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}
.vcm-drawer-close:hover {
  background: var(--vcm-border) !important;
  color: var(--vcm-dark) !important;
}

/* ── Fix: przycisk trasy — kolor tekstu i ikony reset motywu ─────── */
.vcm-btn-route,
.vcm-btn-route:link,
.vcm-btn-route:visited,
.vcm-btn-route:hover,
.vcm-btn-route:focus {
  color: #ffffff !important;
}
.vcm-btn-route svg,
.vcm-btn-route .vcm-detail__icon {
  stroke: #ffffff !important;
}

/* ── Hint (lista ukryta do czasu wyszukania) ─────────────────────── */
.vcm-hint {
  font-size: 13px;
  color: var(--vcm-muted);
  text-align: center;
  padding: 2rem 1.5rem;
  line-height: 1.6;
}
