:root {
  --primary: #1cb5c5;
  --primary-dark: #1695a3;
  --primary-light: #e4f8fa;
  --accent: #438a92;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --bg-white: #ffffff;
  --bg-light: #f8fafc;
  --bg-soft: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #ffffff 0%, #e4f8fa 50%, #f8fafc 100%);
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-lg: 20px;
  --max-width: 1200px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

ul {
  list-style: none;
}

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

.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  text-align: center;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-gray);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 201, 218, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 201, 218, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-white {
  background: white;
  color: var(--primary-dark);
  box-shadow: var(--shadow);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Top bar */
.topbar {
  background: var(--primary);
  color: white;
  padding: 10px 0;
  font-size: 0.875rem;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-info {
  display: flex;
  gap: 24px;
  align-items: center;
}

.topbar-info span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-vision-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 8px 14px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.topbar-vision-toggle:hover,
.topbar-vision-toggle.active {
  background: white;
  color: var(--primary);
  border-color: white;
}

.topbar a {
  color: white;
  font-weight: 500;
}

.topbar a:hover {
  text-decoration: underline;
}

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

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

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-tagline {
  font-size: 0.75rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav a {
  font-weight: 500;
  color: var(--text-dark);
  position: relative;
  padding: 4px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}

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

.nav a:hover::after {
  width: 100%;
}

/* Dropdown menu in desktop nav */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-arrow {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
  vertical-align: 1px;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 260px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 1000;
}

.nav-dropdown:hover .nav-submenu,
.nav-submenu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown:hover .nav-arrow {
  transform: rotate(-135deg);
}

.nav-submenu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-submenu a::after {
  display: none;
}

.nav-submenu a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-phone {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.header-phone a {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.header-phone span {
  font-size: 0.75rem;
  color: var(--text-gray);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: 0.3s;
}

/* Hero */
.hero {
  position: relative;
  padding: 80px 0 100px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-white) 50%, var(--bg-light) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: rgba(37, 201, 218, 0.08);
  border-radius: 50%;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

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

.hero-text {
  font-size: 1.125rem;
  color: var(--text-gray);
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-gray);
}

.hero-image {
  position: relative;
}

.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.hero-image::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 100%;
  height: 100%;
  border: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  z-index: -1;
}

/* Services */
.services {
  background: var(--bg-gradient);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
}

.service-card:hover {
  border-color: var(--primary);
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-text {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.service-link {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.service-link:hover {
  color: var(--primary-dark);
}

.service-card-link {
  text-decoration: none;
  color: inherit;
}

.service-card-link .service-link {
  color: var(--primary);
}

/* Reviews / Why trust */
.reviews {
  background: var(--bg-light);
}

.reviews .service-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
  border-color: rgba(28, 181, 197, 0.15);
}

.reviews .service-card:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, #ffffff 0%, #d5f3f6 100%);
}

/* About */
.about {
  background: var(--bg-light);
}

.about {
  background: var(--bg-light);
}

.about .container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.about-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.about-intro h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.about-intro h2 span {
  color: var(--primary);
}

.about-text {
  color: var(--text-gray);
  margin-bottom: 0;
  max-width: 90%;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.about-feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.about-feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-feature-text strong {
  display: block;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 1rem;
}

.about-feature-text span {
  font-size: 0.875rem;
  color: var(--text-gray);
  line-height: 1.5;
}

/* Doctors */
.doctors {
  background: var(--bg-white);
}

.doctors {
  background: var(--bg-white);
  overflow: hidden;
}

.doctors-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.doctors-slider {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.doctors-track {
  display: flex;
  gap: 30px;
  will-change: transform;
}

.doctor-card {
  flex: 0 0 calc(33.333% - 20px);
  min-width: 260px;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.doctor-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.doctor-card-link {
  text-decoration: none;
  color: inherit;
}

.doctor-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--bg-soft);
}

.doctor-info {
  padding: 24px;
}

.doctor-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.doctor-role {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.doctor-desc {
  font-size: 0.875rem;
  color: var(--text-gray);
  margin-bottom: 16px;
}

.doctor-more {
  display: inline-flex;
  align-self: flex-end;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.doctor-more:hover {
  color: var(--primary-dark);
}

.doctor-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.doctor-arrow:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

.doctor-arrow:active {
  transform: scale(0.95);
}

.doctor-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--bg-white);
  color: var(--text-light);
  border-color: var(--border);
  transform: none;
}

/* Appointment */
.appointment {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.appointment::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.appointment .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.appointment-content h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.appointment-content p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 32px;
}

.appointment-benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.appointment-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.appointment-benefit svg {
  flex-shrink: 0;
}

.appointment-form {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  color: var(--text-dark);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.form-consent {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-gray);
  margin-bottom: 20px;
  cursor: pointer;
}

.form-consent input {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  accent-color: var(--primary);
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.form-consent a {
  color: var(--primary);
  text-decoration: underline;
}

.form-consent a:hover {
  color: var(--primary-dark);
}

.form-submit {
  width: 100%;
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-success {
  display: none;
  background: #d1fae5;
  color: #065f46;
  padding: 16px;
  border-radius: 10px;
  margin-top: 16px;
  text-align: center;
  font-weight: 500;
}

/* Contacts */
.contacts {
  background: var(--bg-light);
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  height: 100%;
}

.contact-card h3 {
  font-size: 1.25rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-card h3 svg {
  color: var(--primary);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.contact-item svg {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.contact-item div strong {
  display: block;
  margin-bottom: 2px;
}

.contact-item div span,
.contact-item div a {
  color: var(--text-gray);
}

.contact-item div a:hover {
  color: var(--primary);
}

.map-container,
.map-placeholder {
  width: 100%;
  min-height: 300px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-gray);
  gap: 12px;
}

.map-container iframe,
.map-container ymaps {
  width: 100% !important;
  min-height: 300px;
  border: 0;
  border-radius: var(--radius);
}

.transport-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transport-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-light);
  border-radius: 8px;
}

.transport-item span {
  font-weight: 600;
  color: var(--primary);
  min-width: 90px;
}

/* Footer */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-light);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-phones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-phones a {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

.footer-phones a:hover {
  color: var(--primary);
}

.footer-address {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 12px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.footer-bottom a {
  color: var(--text-light);
}

.footer-bottom a:hover {
  color: var(--primary);
}

.site-credit {
  background: var(--bg-white);
  padding: 18px 20px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-gray);
  border-top: 1px solid var(--border);
}

.site-credit a {
  color: var(--primary);
  font-weight: 500;
}

.site-credit a:hover {
  color: var(--primary-dark);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
  border: none;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
}

/* FAB */
.fab {
  position: fixed;
  bottom: 95px;
  right: 30px;
  z-index: 1000;
}

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-dark);
  width: 64px;
}

.fab-item svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  color: white;
  background: var(--primary);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.fab-item:hover svg {
  transform: scale(1.1);
}

.fab-label {
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: var(--text-dark);
  background: white;
  padding: 8px 2px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: fit-content;
  min-width: 120%;
  word-break: break-word;
}

.fab-phone svg { background: #10b981; }
.fab-telegram svg { background: #229ed9; }
.fab-whatsapp svg { background: #25d366; }
.fab-instagram svg { background: #e1306c; }
.fab-yandex svg { background: #fc3f1d; }
.fab-2gis svg { background: #00a8e6; }

/* Mobile menu */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 9999;
  padding: 80px 24px 24px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
}

.mobile-nav a.submenu-item {
  padding: 12px 0 12px 20px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-gray);
  border-bottom: 1px solid var(--border);
}

.mobile-nav a.submenu-item:hover {
  color: var(--primary);
}

.mobile-nav a:hover {
  color: var(--primary);
}

.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-dark);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero .container,
  .appointment .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-row {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    order: -1;
    max-width: 600px;
    margin: 0 auto;
  }

  .hero-image {
    order: -1;
  }

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

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

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

@media (max-width: 1047px) {
  .nav,
  .header-actions .header-phone {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 520px) {
  .header-actions .btn-primary {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .topbar-info {
    display: none;
  }

  .topbar-vision-toggle {
    width: 100%;
    justify-content: center;
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .hero {
    padding: 50px 0 70px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-stats {
    gap: 24px;
  }

  .services-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .doctor-card {
    flex: 0 0 calc(50% - 15px);
    min-width: 240px;
  }

  .doctor-arrow {
    display: none;
  }

  .doctors-slider-wrapper {
    gap: 0;
  }

  .doctors-track {
    gap: 15px;
  }

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

  .about-feature {
    gap: 10px;
  }

  .about-feature-icon {
    width: 48px;
    height: 48px;
  }

  .about-feature-text strong {
    font-size: 0.95rem;
  }

  .about-feature-text span {
    font-size: 0.8rem;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .appointment-form {
    padding: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .topbar-vision-toggle {
    font-size: 0.75rem;
    padding: 6px 10px;
  }

  .fab {
    bottom: 85px;
    right: 16px;
  }

  .fab-item {
    width: 56px;
  }

  .fab-item svg {
    width: 44px;
    height: 44px;
    padding: 10px;
  }

  .fab-label {
    font-size: 0.55rem;
    padding: 7px 2px;
    width: fit-content;
    min-width: 120%;
    word-break: break-word;
  }

  .back-to-top {
    bottom: 24px;
    right: 16px;
  }
}

/* Vision impaired mode */
body.vision-impaired {
  font-size: 1.25rem;
  line-height: 1.8;
}

body.vision-impaired .topbar,
body.vision-impaired .footer {
  background: #000000;
  color: #ffffff;
}

body.vision-impaired .topbar a {
  color: #ffffff;
}

body.vision-impaired .header {
  background: #ffffff;
  border-bottom: 2px solid #000000;
}

body.vision-impaired .logo-name {
  color: #000000;
}

body.vision-impaired .nav a,
body.vision-impaired .header-phone a,
body.vision-impaired .header-phone span {
  color: #000000;
  font-weight: 700;
}

body.vision-impaired .nav a::after {
  background: #000000;
  height: 3px;
}

body.vision-impaired .nav-submenu {
  background: #ffffff;
  border: 2px solid #000000;
  box-shadow: none;
}

body.vision-impaired .nav-submenu a:hover {
  background: #000000;
  color: #ffffff;
}

body.vision-impaired .mobile-nav a.submenu-item {
  color: #000000;
}

body.vision-impaired .btn-primary {
  background: #000000;
  color: #ffffff;
  border: 3px solid #000000;
  box-shadow: none;
}

body.vision-impaired .btn-primary:hover {
  background: #ffffff;
  color: #000000;
}

body.vision-impaired .btn-outline {
  border: 3px solid #000000;
  color: #000000;
}

body.vision-impaired .btn-outline:hover {
  background: #000000;
  color: #ffffff;
}

body.vision-impaired .hero,
body.vision-impaired .services {
  background: #ffffff;
}

body.vision-impaired .hero-title,
body.vision-impaired h1,
body.vision-impaired h2,
body.vision-impaired h3 {
  color: #000000;
}

body.vision-impaired .hero-title span,
body.vision-impaired .about-intro h2 span,
body.vision-impaired .section-title span {
  color: #000000;
  text-decoration: underline;
}

body.vision-impaired p,
body.vision-impaired .hero-text,
body.vision-impaired .service-text,
body.vision-impaired .about-text,
body.vision-impaired .doctor-desc,
body.vision-impaired .contact-item div span,
body.vision-impaired .footer-desc,
body.vision-impaired .footer-links a,
body.vision-impaired .footer-bottom a,
body.vision-impaired .footer-address {
  color: #000000;
}

body.vision-impaired a {
  text-decoration: underline;
}

body.vision-impaired .service-card,
body.vision-impaired .doctor-card,
body.vision-impaired .contact-card,
body.vision-impaired .about-feature-icon,
body.vision-impaired .service-icon,
body.vision-impaired .appointment-form,
body.vision-impaired .hero-badge {
  background: #ffffff !important;
  border: 2px solid #000000;
  box-shadow: none;
}

body.vision-impaired .service-card:hover,
body.vision-impaired .doctor-card:hover {
  background: #ffffff !important;
  box-shadow: 0 0 0 4px #000000;
  transform: none;
}

body.vision-impaired .about-feature-icon svg,
body.vision-impaired .service-icon svg {
  stroke: #000000;
}

body.vision-impaired .appointment {
  background: #ffffff;
  border-top: 4px solid #000000;
  border-bottom: 4px solid #000000;
  color: #000000;
}

body.vision-impaired .appointment-content h2,
body.vision-impaired .appointment-content p,
body.vision-impaired .appointment-benefit {
  color: #000000;
}

body.vision-impaired .form-group input,
body.vision-impaired .form-group select,
body.vision-impaired .form-group textarea {
  border: 2px solid #000000;
  background: #ffffff;
  font-size: 1.1rem;
}

body.vision-impaired .form-consent {
  color: #000000;
  font-size: 1rem;
}

body.vision-impaired .form-consent a {
  color: #000000;
}

body.vision-impaired .form-consent input {
  border: 2px solid #000000;
  accent-color: #000000;
  width: 40px;
  height: 40px;
}

body.vision-impaired .service-link,
body.vision-impaired .doctor-role,
body.vision-impaired .contact-item svg,
body.vision-impaired .transport-item span,
body.vision-impaired .map-placeholder svg,
body.vision-impaired .hero-stat-number,
body.vision-impaired .footer-logo,
body.vision-impaired .about-intro h2 span {
  color: #000000;
  stroke: #000000;
}

body.vision-impaired .map-container,
body.vision-impaired .map-placeholder {
  background: #f0f0f0;
  border: 2px solid #000000;
  color: #000000;
}

body.vision-impaired .back-to-top {
  background: #000000;
  color: #ffffff;
  border: 3px solid #000000;
}

body.vision-impaired .fab-item svg {
  background: #000000;
  border: 2px solid #000000;
  color: #ffffff;
}

body.vision-impaired .fab-label {
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
}

body.vision-impaired .mobile-nav {
  background: #ffffff;
}

body.vision-impaired .topbar-vision-toggle {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

body.vision-impaired .topbar-vision-toggle.active {
  background: #ffffff;
  color: #000000;
}

body.vision-impaired .hero::before,
body.vision-impaired .appointment::before {
  display: none;
}

body.vision-impaired .hero-image::before,
body.vision-impaired .service-icon::before,
body.vision-impaired .doctor-card::before {
  display: none;
}

body.vision-impaired * {
  transition: none !important;
  animation: none !important;
}

@media (max-width: 768px) {
  body.vision-impaired .hero-title {
    font-size: 2.5rem;
  }

  body.vision-impaired .section-title {
    font-size: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Internal pages */
.page-content {
  padding: 120px 0 80px;
}

.page-content--contacts {
  padding: 0;
}

.page-content .container > h1,
.page-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 32px;
  line-height: 1.2;
}

.page-menu {
  margin-bottom: 32px;
}

.page-menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
}

.page-menu a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg-light);
  border-radius: 8px;
  color: var(--text-dark);
  font-weight: 500;
  transition: all 0.2s;
}

.page-menu a:hover,
.page-menu a[href*="<?php"],
.page-menu li:last-child a {
  background: var(--primary);
  color: white;
}

.page-item {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dark);
}

.page-item h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text-dark);
}

.page-item p {
  margin-bottom: 16px;
}

.page-item strong {
  font-weight: 700;
}

/* About page */
.main-doctor {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.main-doctor .image {
  text-align: center;
}

.main-doctor .image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin: 0 auto 16px;
}

.main-doctor .name {
  font-size: 0.95rem;
  color: var(--text-gray);
}

.main-doctor .name span {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.main-doctor .content .n {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.main-doctor .content > p {
  font-size: 1.05rem;
  color: var(--text-gray);
  margin-bottom: 24px;
}

.main-doctor .row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.main-doctor .item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-light);
  border-radius: var(--radius);
}

.main-doctor .item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.main-doctor .item span {
  font-weight: 700;
  color: var(--primary);
}

/* Service pages */
.page-content .row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.left-menu {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 140px;
}

.left-menu > p {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-gray);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.left-menu ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.left-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  color: var(--text-dark);
  font-weight: 500;
  transition: all 0.2s;
}

.left-menu a:hover,
.left-menu a.active {
  background: var(--primary);
  color: white;
}

.left-menu img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.service-page .slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.service-page .slider img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.prices {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 24px;
}

.prices .name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.prices table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prices tr:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.prices td {
  padding: 14px 8px;
  vertical-align: top;
}

.prices td:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  color: var(--primary);
}

.prices td b {
  font-size: 1rem;
  color: var(--text-dark);
}

.att {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-dark);
}

/* Doctors list */
.doctors-list .row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.doctors-list .item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--radius);
  transition: all 0.2s;
  height: 100%;
}

.doctors-list a:hover .item {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.doctors-list .image {
  width: 120px;
  height: 160px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doctors-list .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctors-list .content {
  flex: 1;
}

.doctors-list .n {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.doctors-list .prof {
  font-size: 0.95rem;
  color: var(--text-gray);
  margin-bottom: 16px;
}

.doctors-list button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.doctors-list button:hover {
  background: var(--primary-dark);
}

/* Doctor detail */
.doctor-page {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.doctor-page > img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 240px;
}

.doctor-page .content {
  font-size: 1rem;
  line-height: 1.7;
}

.doctor-page .name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.doctor-page .name span {
  display: block;
  color: var(--primary);
}

.doctor-page h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 24px 0 12px;
}

.doctor-page ol,
.doctor-page ul {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doctor-page li {
  color: var(--text-gray);
}

.index-doctors.inner {
  margin-top: 60px;
}

.index-doctors.inner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.index-doctors.inner .list2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.index-doctors.inner .item {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
}

.index-doctors.inner .item:hover {
  box-shadow: var(--shadow);
}

.index-doctors.inner .image {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.index-doctors.inner .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.index-doctors.inner .name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.index-doctors.inner .prof {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 12px;
}

/* Contacts page */
.contacts-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.contacts-page .adress {
  font-size: 1.15rem;
  line-height: 1.8;
}

.contacts-page .adress a.phone {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 12px 0;
}

.contacts-page .adress img {
  width: 40px;
  height: 40px;
  margin-top: 12px;
  margin-right: 12px;
  display: inline-block;
}

.contacts-page .bus {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 24px;
}

.contacts-page .bus > span {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.contacts-page .bus p {
  margin-bottom: 12px;
}

/* Legal/docs galleries */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin: 20px 0 40px;
}

.gallery a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  background: var(--bg-light);
}

.gallery a:hover {
  transform: translateY(-4px);
}

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

.gallery br,
.gallery dl,
.gallery dt {
  display: contents;
}

/* 404 page */
.error-page {
  text-align: center;
  padding: 100px 20px 120px;
  background: var(--bg-gradient);
}

.error-page .container {
  max-width: 720px;
}

.error-illustration {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
}

.error-code {
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -4px;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.error-subtitle {
  font-size: 1.125rem;
  color: var(--text-gray);
  margin-bottom: 32px;
  line-height: 1.6;
}

.error-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 40px;
}

.error-contacts {
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.error-contacts p {
  font-size: 1rem;
  color: var(--text-gray);
  margin-bottom: 8px;
}

.error-phone {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.error-phone:hover {
  color: var(--primary);
}

@media (max-width: 640px) {
  .error-code {
    font-size: 5rem;
    letter-spacing: -2px;
  }

  .error-title {
    font-size: 1.5rem;
  }

  .error-illustration {
    width: 140px;
    height: 140px;
  }
}

.reviews-page {
  padding: 40px 0 80px;
}

.reviews-page h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.reviews-subtitle {
  font-size: 1.125rem;
  color: var(--text-gray);
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.review-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.review-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.review-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-meta strong {
  font-size: 1.05rem;
  color: var(--text-dark);
}

.review-meta span {
  font-size: 0.875rem;
  color: var(--text-gray);
}

.review-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dark);
  flex-grow: 1;
}

.review-text br {
  margin-bottom: 8px;
}

.review-sources {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-gradient);
  border-radius: var(--radius-lg);
}

.review-sources-top {
  margin-bottom: 48px;
}

.review-sources h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.review-sources p {
  font-size: 1rem;
  color: var(--text-gray);
  margin-bottom: 24px;
}

.review-source-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.review-source-btns .btn {
  gap: 10px;
}

.btn-2gis {
  background: #3f8a6e;
  color: white;
  border-color: #3f8a6e;
  box-shadow: 0 4px 14px rgba(63, 138, 110, 0.35);
}

.btn-2gis:hover {
  background: #35725a;
  border-color: #35725a;
  color: white;
}

.btn-yandex {
  color: #fc3f1d;
  border-color: #fc3f1d;
}

.btn-yandex:hover {
  background: #fc3f1d;
  color: white;
  border-color: #fc3f1d;
}

@media (max-width: 768px) {
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .review-card {
    padding: 20px;
  }

  .review-source-btns {
    flex-direction: column;
    width: 100%;
  }

  .review-source-btns .btn {
    width: 100%;
  }
}

/* Responsive internal pages */
@media (max-width: 1024px) {
  .main-doctor,
  .doctor-page,
  .page-content .row,
  .contacts-page {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .main-doctor .image,
  .doctor-page > img {
    max-width: 280px;
    margin: 0 auto;
  }

  .main-doctor .row {
    grid-template-columns: 1fr;
  }

  .left-menu {
    position: static;
  }

  .doctors-list .row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 100px 0 60px;
  }

  .page-content h1 {
    font-size: 1.75rem;
  }

  .page-menu ul {
    gap: 8px;
  }

  .page-menu a {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .doctors-list .item {
    flex-direction: column;
    text-align: center;
  }

  .doctors-list .image {
    margin: 0 auto;
  }

  .prices td {
    padding: 10px 6px;
    font-size: 0.9rem;
  }

  .contacts-page .adress a.phone {
    font-size: 1.2rem;
  }

  .gallery img {
    height: 200px;
  }
}

/* ===== Дипломы и сертификаты: плитка + лайтбокс ===== */
.diploma-section {
  margin-top: 48px;
}

.diploma-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-dark);
}

.diploma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.diploma-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--primary-light);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.diploma-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.diploma-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.diploma-item:hover img {
  transform: scale(1.05);
}

.diploma-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
  background-size: 0;
  transition: background 0.3s ease;
  pointer-events: none;
}

.diploma-item:hover::after {
  background-color: rgba(0, 0, 0, 0.35);
  background-size: 48px 48px;
}

.diploma-caption {
  display: none;
}

.diploma-item.diploma-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--primary-light);
  padding: 16px;
  text-align: center;
}

.diploma-text-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
}

.diploma-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.diploma-text-inner p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-gray);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diploma-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-text {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  color: var(--text-dark);
  padding: 32px;
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.7;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.5);
  padding: 6px 14px;
  border-radius: 20px;
}

@media (max-width: 640px) {
  .diploma-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .lightbox-prev,
  .lightbox-next {
    display: none;
  }
}

