/* vet-dobra-lapa - Modern Web Guidance Rework CSS */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap');

:root {
  --teal-900: #0a4643;
  --teal: #0f6e6a;
  --teal-light: #16938e;
  --teal-soft: #e2f2f0;
  --teal-surface: #eff8f7;
  
  --red: #c8281e;
  --red-hover: #e02f24;
  --red-soft: #fde8e7;
  --red-glow: rgba(200, 40, 30, 0.35);
  
  --amber: #f59e0b;
  --sun: #ffc94d;
  --sun-soft: #fff7d6;
  
  --ink: #142826;
  --muted: #536a68;
  --muted-light: #7c9492;
  --white: #ffffff;
  
  --line: #d2e4e2;
  --line-strong: #b4d2cf;
  
  --font-heading: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  background: var(--teal-surface);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.2;
  color: var(--teal-900);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 6px;
  z-index: 1000;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
}

/* Top 24/7 Red Emergency Ribbon */
.emergency-ribbon {
  background: var(--red);
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.emergency-ribbon a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 10px 16px;
  color: inherit;
  text-decoration: none;
}

.emergency-ribbon .badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.emergency-ribbon .tel {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: #ffffff;
  color: var(--red);
  padding: 2px 12px;
  border-radius: 4px;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  color: var(--teal);
  text-decoration: none;
}

.logo svg {
  width: 32px;
  height: 32px;
  color: var(--teal);
}

.top nav {
  display: none;
  align-items: center;
  gap: 28px;
}

.top nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
  transition: color 0.2s ease;
  padding: 6px 0;
  position: relative;
}

.top nav a:hover {
  color: var(--teal);
}

.top nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.top nav a:hover::after {
  transform: scaleX(1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  cursor: pointer;
}

@media (min-width: 840px) {
  .top nav { display: flex; }
  .drawer-toggle { display: none; }
}

/* Mobile Drawer (Native Dialog) */
dialog.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 85vw);
  height: 100%;
  max-height: 100dvh;
  margin: 0;
  padding: 24px 20px;
  background: var(--white);
  border: none;
  border-right: 4px solid var(--teal);
  color: var(--ink);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), overlay 0.3s allow-discrete, display 0.3s allow-discrete;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

dialog.drawer[open] {
  transform: translateX(0);
}

@starting-style {
  dialog.drawer[open] {
    transform: translateX(-100%);
  }
}

dialog.drawer::backdrop {
  background: rgba(10, 70, 67, 0.5);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity 0.3s ease, overlay 0.3s allow-discrete, display 0.3s allow-discrete;
}

dialog.drawer[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.drawer[open]::backdrop {
    opacity: 0;
  }
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer__close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  cursor: pointer;
}

.drawer nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer nav a {
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 201, 77, 0.4);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  background: #f7bd38;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 201, 77, 0.6);
}

.btn:active {
  transform: translateY(0);
}

.btn--teal {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 110, 106, 0.35);
}
.btn--teal:hover {
  background: var(--teal-light);
  box-shadow: 0 6px 18px rgba(15, 110, 106, 0.5);
  color: #fff;
}

.btn--red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px var(--red-glow);
}
.btn--red:hover {
  background: var(--red-hover);
  color: #fff;
}

.btn--white {
  background: #fff;
  color: var(--teal);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.btn--white:hover {
  background: var(--teal-soft);
}

.btn--outline {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: none;
}
.btn--outline:hover {
  background: var(--teal-soft);
}

.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
}

/* Hero Section */
.hero {
  background: var(--teal);
  color: #ffffff;
  border-radius: 28px;
  padding: 36px 24px;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 110, 106, 0.25);
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

@media (min-width: 800px) {
  .hero {
    padding: 56px 48px;
  }
  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
  }
}

.hero h1 {
  font-size: clamp(32px, 6vw, 50px);
  color: #ffffff;
  margin-bottom: 14px;
  line-height: 1.15;
}

.hero-lead {
  font-size: clamp(16px, 2vw, 19px);
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 28px;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-photo {
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sections */
section {
  padding: 64px 0 0;
}

.section-head {
  margin-bottom: 32px;
}

.section-head h2 {
  font-size: clamp(28px, 5.5vw, 40px);
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
  margin-top: 8px;
  max-width: 56ch;
}

/* 24/7 Emergency Box */
.emergency-card {
  background: var(--white);
  border: 3px solid var(--red);
  border-radius: 24px;
  padding: 32px 24px;
  display: grid;
  gap: 28px;
  box-shadow: 0 10px 30px var(--red-glow);
}

@media (min-width: 800px) {
  .emergency-card {
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    padding: 36px 32px;
  }
}

.emergency-card h2 {
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.emergency-checklist {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
  margin-top: 14px;
}

.emergency-checklist li {
  position: relative;
  padding-left: 22px;
}

.emergency-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}

.emergency-call-box {
  background: var(--red-soft);
  border: 1px dashed var(--red);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.emergency-phone {
  display: block;
  font-size: clamp(32px, 7vw, 48px);
  font-weight: 900;
  color: var(--red);
  text-decoration: none;
  line-height: 1.1;
  margin-bottom: 8px;
}

.emergency-note {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.45;
}

/* Services Section */
.services-layout {
  display: grid;
  gap: 28px;
}

@media (min-width: 800px) {
  .services-layout {
    grid-template-columns: 1.25fr 1fr;
    align-items: start;
    gap: 36px;
  }
}

.services-list {
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 20px;
  box-shadow: 0 4px 16px rgba(15, 110, 106, 0.06);
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.service-item:last-child {
  border-bottom: none;
}

.service-item:hover {
  transform: translateX(4px);
}

.service-info b {
  font-size: 17px;
  font-weight: 800;
  color: var(--teal-900);
}

.service-info p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.service-pricing {
  text-align: right;
  flex: none;
}

.price-eur {
  font-size: 19px;
  font-weight: 900;
  color: var(--teal);
}

.price-bgn {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-light);
}

.services-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.services-gallery figure {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.services-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Doctors Section */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.doctor-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.doctor-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--teal-900);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  flex: none;
  box-shadow: 0 4px 10px rgba(255, 201, 77, 0.4);
}

.doctor-info h3 {
  font-size: 18px;
  color: var(--teal-900);
  margin-bottom: 2px;
}

.doctor-info p {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}

/* Clinic Info & Appointment Grid */
.booking-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 800px) {
  .booking-grid {
    grid-template-columns: 1fr 1.35fr;
    gap: 36px;
    align-items: start;
  }
}

.info-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(15, 110, 106, 0.06);
}

.info-card h3 {
  font-size: 24px;
  color: var(--teal);
  margin-bottom: 16px;
}

.hours-table {
  display: grid;
  gap: 10px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}

.hours-row:last-child {
  border-bottom: none;
}

.hours-row strong {
  font-weight: 800;
}

.contact-links {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--teal-surface);
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  color: var(--teal);
}

.contact-link.viber {
  color: #5b4bd1;
}

/* Appointment Form */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(15, 110, 106, 0.06);
}

.appointment-form {
  display: grid;
  gap: 16px;
}

/* Pet Pills Selector */
.pet-pill-group {
  border: none;
  margin-bottom: 6px;
}

.pet-pill-group legend {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.pet-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pet-pill-label {
  position: relative;
  cursor: pointer;
}

.pet-pill-label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.pet-pill-label span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--teal-surface);
  border: 2px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  transition: all 0.15s ease;
}

.pet-pill-label input:checked + span {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 4px 10px rgba(15, 110, 106, 0.3);
}

.pet-pill-label input:focus-visible + span {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.form-hint {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.form-input, .form-select, .form-textarea {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--teal-surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 48px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 110, 106, 0.2);
}

/* Modern Web Guidance: deferred invalid */
.form-input:user-invalid, .form-select:user-invalid {
  border-color: #ef4444;
}

.form-error {
  display: none;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

.form-input:user-invalid ~ .form-error {
  display: block;
}

/* Native Modal Dialog (Appointment Ticket) */
dialog.modal {
  margin: auto;
  padding: 0;
  background: transparent;
  border: none;
  max-width: min(520px, calc(100vw - 32px));
  border-radius: 20px;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 70, 67, 0.4);
  overscroll-behavior: contain;
}

dialog.modal::backdrop {
  background: rgba(10, 70, 67, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-content {
  background: var(--white);
  border: 3px solid var(--teal);
  border-radius: 24px;
  padding: 32px 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-header .ok-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  margin: 0 auto 12px;
}

.modal-header h3 {
  font-size: 26px;
  color: var(--teal);
}

.modal-ticket {
  background: var(--teal-surface);
  border: 2px dashed var(--teal-light);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.ticket-code {
  font-size: 26px;
  font-weight: 900;
  color: var(--teal-900);
  letter-spacing: 0.06em;
}

/* Floating Mobile Action Bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.bottom-bar.hidden {
  transform: translateY(110%);
}

.bottom-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 52px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  font-size: 15px;
}

.bottom-bar a.emergency-btn {
  background: var(--red);
  color: #fff;
}

.bottom-bar a.viber-btn {
  background: #5b4bd1;
  color: #fff;
}

@media (min-width: 840px) {
  body { padding-bottom: 0; }
  .bottom-bar { display: none; }
}

/* Footer */
footer {
  padding: 36px 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* closed drawer must not be reachable by keyboard or screen readers */
dialog.drawer:not([open]) { visibility: hidden; }

/* phones: the booking grid must not grow wider than the screen */
@media (max-width: 799px) { .booking-grid { grid-template-columns: minmax(0, 1fr); } }
.booking-grid > * { min-width: 0; }
fieldset { min-width: 0; }
.pet-pills { flex-wrap: wrap; }
.appointment-form { grid-template-columns: minmax(0, 1fr); }
.appointment-form > * { min-width: 0; }
.appointment-form input, .appointment-form select, .appointment-form textarea { min-width: 0; max-width: 100%; }
.two-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.two-cols > * { min-width: 0; }
@media (max-width: 379px) { .two-cols { grid-template-columns: minmax(0, 1fr); } }
