:root {
  --g400: #f5c842;
  --g600: #d4a017;
  --g800: #b8860b;
  --g900: #7a5500;
  --dark: #1a1005;
  --cream: #fdfaf3;
}
.sec-gold-line {
  width: 40px; height: 3px; border-radius: 9999px;
  background: linear-gradient(90deg, var(--g400), var(--g800));
  margin-bottom: 10px;
}
.fu { 
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease; 
}
.fu.vis { opacity: 1; transform: translateY(0); }
.gold-pill-sm {
  display: inline-block; font-size: 11px;
  padding: 3px 12px; border-radius: 9999px;
  border: 1px solid rgba(245,200,66,.45);
  background: rgba(245,200,66,.1);
  color: var(--g800); letter-spacing: .05em;
}
.media-tab {
  padding: 7px 20px; border-radius: 9999px; font-size: 13px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
  background: transparent;
  color: #6b7280;
}
.media-tab.active, .media-tab:hover {
  border-color: var(--g400);
  background: rgba(245,200,66,.1);
  color: var(--g800);
}
.media-item {
  position: relative; border-radius: 14px; overflow: hidden;
  cursor: pointer; background: #111;
  border: 1px solid rgba(245,200,66,.15);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  will-change: transform;
}
.media-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 36px rgba(245,200,66,.2);
  border-color: var(--g400);
}
.media-item img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .5s ease;
  display: block;
}
.media-item:hover img { transform: scale(1.06); }
.media-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
      rgba(26,16,5,.85) 0%,
      rgba(26,16,5,.2) 60%,
      transparent 100%);
  opacity: 0; transition: opacity .3s ease;
  display: flex; flex-direction: column;
  justify-content: flex-end; padding: 16px;
}
.media-item:hover .media-overlay { opacity: 1; }
.play-badge {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(245,200,66,.9);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
  z-index: 2;
}
.media-item:hover .play-badge {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--g400);
}
.type-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 10px; padding: 3px 10px; border-radius: 9999px;
  font-family: 'IBM Plex Sans Thai', sans-serif; font-weight: 500;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 240px 200px;
  gap: 14px;
}
.media-grid .item-featured {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}
.media-grid .item-sm { /* auto */ }
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox-inner {
  position: relative; max-width: 900px; width: 92vw;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(245,200,66,.3);
}
#lightbox-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(245,200,66,.2); color: var(--g400);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
#lightbox-close:hover { background: rgba(245,200,66,.4); }
#lightbox img { width: 100%; max-height: 80vh; object-fit: contain; display: block; }
#lightbox iframe { width: 100%; height: 50vw; max-height: 500px; display: block; border: 0; }
.csr-card {
  background: #fff;
  border: 1px solid rgba(245,200,66,.22);
  border-radius: 16px; overflow: hidden;
  transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}
.csr-card:hover {
  border-color: var(--g400);
  box-shadow: 0 10px 32px rgba(245,200,66,.18);
  transform: translateY(-4px);
}
.csr-card img {
  width: 100%; height: 200px;
  object-fit: cover; object-position: center;
  transition: transform .5s ease;
}
.csr-card:hover img { transform: scale(1.04); }

.csr-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 3px 10px; border-radius: 9999px;
}
.csr-stat {
  text-align: center; padding: 20px 16px;
  border: 1px solid rgba(245,200,66,.2);
  border-radius: 14px;
  background: rgba(245,200,66,.05);
  transition: border-color .25s ease, background .25s ease;
}
.csr-stat:hover {
  border-color: var(--g400);
  background: rgba(245,200,66,.1);
}
@media (max-width: 768px) {
  .media-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .media-grid .item-featured {
    grid-column: 1 / 3; grid-row: auto;
    height: 220px;
  }
}
@media (max-width: 480px) {
  .media-grid { grid-template-columns: 1fr; }
  .media-grid .item-featured { grid-column: 1; }
}

.contact-btn-line:hover {
  background: #05a847 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6,199,85,0.35);
}
.contact-btn-line:active {
  transform: translateY(0);
  box-shadow: none;
}
.contact-btn-fb:hover {
  background: #0550cc !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(8,102,255,0.35);
}
.contact-btn-fb:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn-gold {
  background: #f5c842;
  color: #ffffff;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-gold:hover {
  background: #d4a017;
  transform: translateY(-1px);
}
.btn-gold:active {
  background: #b8860b;
  transform: translateY(0);
}

/* Doctors */
#ds3 {
  --g100: #fdfaf3;
  --g200: #f9e9b8;
  --g400: #f5c842;
  --g600: #d4a017;
  --g800: #b8860b;
  --dark: #1a1005;
  --mid:  #2a1b05;
}
#ds3 {
  background: var(--g100);
  padding: 48px 0 40px;
  position: relative;
  overflow: hidden;
}
.ds3-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 2rem;
}
.ds3-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: flex-end;
  margin-bottom: 56px;
}
.ds3-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 14px; border-radius: 9999px;
  background: rgba(245,200,66,.15);
  color: var(--g800); letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 14px;
}
.ds3-h1 {
  font-size: clamp(1.55rem, 4vw, 3rem);
  font-weight: 500; line-height: 1.15;
  color: var(--dark); margin: 0;
}
.ds3-h1 em {
  font-style: normal; color: var(--g800);
}
.ds3-desc {
  font-size: 14px; color: #6b7280;
  line-height: 1.8; max-width: 380px;
  margin-bottom: 28px;
}
.ds3-nav {
  display: flex; gap: 10px; align-items: center;
}
.ds3-arrow {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid rgba(245,200,66,.5);
  background: transparent; color: var(--g800);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
}
.ds3-arrow:hover {
  background: var(--g400); border-color: var(--g400);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245,200,66,.35);
}
.ds3-arrow:active { transform: scale(.93); }
.ds3-scroll-wrap {
  position: relative;
}
.ds3-scroll-wrap::before,
.ds3-scroll-wrap::after {
  content: '';
  position: absolute; top: 0; bottom: 0;
  width: 60px; z-index: 2; pointer-events: none;
}
.ds3-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--g100), transparent);
}
.ds3-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--g100), transparent);
}
.ds3-track {
  display: flex; gap: 24px;
  overflow-x: auto;
  padding-top:    16px;
  padding-bottom: 32px;
  padding-left:   max(2rem, calc((100vw - 80rem) / 2 + 2rem));
  padding-right:  max(2rem, calc((100vw - 80rem) / 2 + 2rem));
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.ds3-track::-webkit-scrollbar { display: none; }
.ds3-card {
  flex-shrink: 0;
  width: 270px;
  border-radius: 22px;
  overflow: visible;
  position: relative;
  cursor: pointer;
}
.ds3-photo-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, #e8dcc8 0%, #c9b07a 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
}
.ds3-card:hover .ds3-photo-wrap {
  box-shadow: 0 16px 40px rgba(0,0,0,.16);
}
.ds3-card.active-card .ds3-photo-wrap {
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
}
.ds3-photo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
}
.ds3-photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(26,16,5,.82) 0%,
    rgba(26,16,5,.15) 48%,
    transparent 100%
  );
}
.ds3-photo-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  background: rgba(26,16,5,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--g400);
  font-size: 10px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 9999px;
  letter-spacing: .04em;
  max-width: 82%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ── Info box (ลอยออกมาจากรูป) ── */
.ds3-info-box {
  margin: -32px 14px 0;
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px 14px;
  position: relative; z-index: 3;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transition: box-shadow .3s ease;
}
.ds3-card:hover .ds3-info-box {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.ds3-card.active-card .ds3-info-box {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.ds3-name {
  font-size: 14px; font-weight: 600;
  color: #111827; line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ds3-specialty {
  font-size: 11px; color: var(--g800);
  margin-bottom: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* stars + rating */
.ds3-stars {
  display: flex; align-items: center; gap: 2px;
  margin-bottom: 12px;
}
/* Appointment button ในการ์ด */
.ds3-card-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px 0;
  border-radius: 8px; font-size: 12px; font-weight: 500;
  background: rgba(245,200,66,.13);
  color: var(--g800); cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.ds3-card-btn:hover {
  background: var(--g400); color: #fff;
}
/* ── "ดูแพทย์ทั้งหมด" header link ── */
.ds3-see-all {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px; font-size: 13px; font-weight: 500;
  color: var(--g800); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.ds3-see-all:hover { border-bottom-color: var(--g800); }

/* ── ปุ่ม "ดูแพทย์ทั้งหมด" ใต้การ์ด ── */
.ds3-viewall-wrap {
  text-align: center;
  padding: 24px 2rem 0;
  max-width: 80rem;
  margin: 0 auto;
}
.ds3-all-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 32px; border-radius: 9999px;
  color: var(--g800); font-size: 14px; font-weight: 500;
  text-decoration: none; background: rgba(245,200,66,.13);
  transition: background .2s ease;
}
.ds3-all-btn:hover { background: rgba(245,200,66,.22); }

@media (min-width: 1024px) {
  .ds3-hide-desktop { display: none; }
}

/* ── Responsive section แพทย์ ── */

/* Tablet: 721–1023px */
@media (max-width: 1023px) and (min-width: 721px) {
  .ds3-card { width: 248px; }
}

/* Mobile: ≤720px */
@media (max-width: 720px) {
  .ds3-header {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 28px;
  }
  .ds3-desc { margin-bottom: 8px; }
  .ds3-see-all { margin-top: 10px; }
  /* Scroll snap: 1 card at a time */
  .ds3-track {
    scroll-snap-type: x mandatory;
    scroll-padding-left: 2rem;
    gap: 16px;
  }
  .ds3-card {
    scroll-snap-align: start;
    /* fluid: แสดง ~1.3 card บนหน้าจอทุกขนาด */
    width: clamp(200px, 72vw, 260px);
  }
  .ds3-info-box { margin: -26px 10px 0; padding: 13px 13px 11px; }
}

/* Small mobile: ≤480px — 1 card เต็มหน้าจอ */
@media (max-width: 480px) {
  #ds3 { padding: 36px 0 28px; }
  .ds3-card { width: calc(100vw - 2rem - 16px); }
}

/* Very small: ≤360px */
@media (max-width: 360px) {
  .ds3-info-box { padding: 11px 11px 10px; }
  .ds3-name { font-size: 13px; }
}

/* Media */
.btn-gold {
  background: #f5c842;
  color: #ffffff;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-gold:hover  { background: #d4a017; transform: translateY(-1px); }
.btn-gold:active { background: #b8860b; transform: translateY(0); }

.nav-arrow:hover {
  background: rgba(245,200,66,0.12) !important;
  border-color: #f5c842 !important;
}