/**
 * Top Dog How It Works — front styles (scoped .tdhw-*).
 */

.tdhw-root *,
.tdhw-root *::before,
.tdhw-root *::after {
  box-sizing: border-box;
}

.tdhw {
  --tdhw-card-radius: 28px;
  padding: clamp(32px, 5vw, 48px) clamp(16px, 4vw, 24px) clamp(40px, 6vw, 56px);
  background: var(--tdhw-navy, #0f1a2e);
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

.tdhw__inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.tdhw__tabs-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: clamp(20px, 4vw, 32px);
}

.tdhw__switch-label {
  margin: 0 0 18px;
  text-align: center;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(196, 206, 220, 0.72);
}

.tdhw__tabs-shell {
  display: inline-flex;
  max-width: 100%;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 168, 0.45);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.tdhw__tabs {
  display: flex;
  align-items: stretch;
  gap: 3px;
  width: 100%;
}

.tdhw__tab {
  flex: 1 1 0;
  min-width: min(44vw, 280px);
  min-height: 48px;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(13px, 2.8vw, 15px);
  font-weight: 600;
  line-height: 1.25;
  padding: 15px clamp(16px, 4vw, 40px);
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(168, 182, 200, 0.88);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
}

.tdhw__tab[aria-selected="true"] {
  background: #fff;
  color: var(--tdhw-navy, #0f1a2e);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.tdhw__tab:focus-visible {
  outline: 2px solid var(--tdhw-accent, #4a90e2);
  outline-offset: 3px;
}

.tdhw-panel {
  display: none;
}

.tdhw-panel--active {
  display: block;
  animation: tdhw-panel-in 0.45s ease;
}

@keyframes tdhw-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tdhw__card {
  background: var(--tdhw-card, #fff);
  border-radius: var(--tdhw-card-radius) var(--tdhw-card-radius) 20px 20px;
  padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 56px) clamp(28px, 5vw, 56px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.tdhw__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.tdhw__lead {
  margin: 0 0 8px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 42px;
  line-height: 1.05;
  color: var(--tdhw-accent, #4a90e2);
}

.tdhw__sub {
  margin: 0 0 clamp(18px, 3vw, 28px);
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.45;
  color: #3d4a5c;
}

.tdhw__section-q {
  margin: 0 0 18px;
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 42px;
  color: var(--tdhw-navy, #0f1a2e);
}

.tdhw__accordion {
  border-top: 1px solid #e4e9ef;
}

.tdhw-acc__item {
  border-bottom: 1px solid #e4e9ef;
}

.tdhw-acc__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(14px, 2.5vw, 20px) 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(15px, 2.2vw, 17px);
  font-weight: 600;
  color: #6b7789;
  transition: color 0.25s ease;
}

.tdhw-acc__item--open .tdhw-acc__trigger {
  color: var(--tdhw-navy, #0f1a2e);
}

.tdhw-acc__trigger:focus-visible {
  outline: 2px solid var(--tdhw-accent, #4a90e2);
  outline-offset: 4px;
  border-radius: 4px;
}

.tdhw-acc__icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  background: #eef1f6;
  color: #9aa5b5;
  transition: background 0.3s ease, color 0.3s ease;
}

.tdhw-acc__item--open .tdhw-acc__icon {
  background: var(--tdhw-navy, #0f1a2e);
  color: #fff;
}

.tdhw-acc__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease;
}

.tdhw-acc__item--open .tdhw-acc__panel {
  max-height: 640px;
}

.tdhw-acc__body {
  margin: 0 0 clamp(14px, 2vw, 20px);
  padding-right: clamp(12px, 8vw, 52px);
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  color: #5a6578;
}

.tdhw__links {
  margin-top: clamp(20px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
}

/* CTA row: pill buttons (primary + outline secondary) */
.tdhw__link.tdhw__link--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 1.25;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.tdhw__link-text {
  flex: 0 1 auto;
}

.tdhw__link-arrow {
  flex-shrink: 0;
  font-weight: 600;
}

.tdhw__link--btn-primary {
  font-weight: 700;
  background: #1b2e4b;
  color: #fff;
  border-color: #1b2e4b;
  box-shadow: 0 10px 28px rgba(15, 26, 46, 0.2);
}

.tdhw__link--btn-primary:hover {
  background: #2a4570;
  border-color: #2a4570;
  color: #fff;
}

.tdhw__link--btn-secondary {
  font-weight: 600;
  background: #fff;
  color: #1b2e4b;
  border-color: #1b2e4b;
  box-shadow: none;
}

.tdhw__link--btn-secondary:visited {
  color: #1b2e4b;
}

.tdhw__link--btn-secondary:hover {
  background-color: #1b2e4b;
  border-color: #1b2e4b;
  color: #fff;
}

.tdhw__link--btn-secondary:hover .tdhw__link-text,
.tdhw__link--btn-secondary:hover .tdhw__link-arrow {
  color: #fff;
}

.tdhw__link--btn-secondary:visited:hover {
  color: #fff;
}

.tdhw__link--btn:focus-visible {
  outline: 2px solid var(--tdhw-accent, #4a90e2);
  outline-offset: 3px;
}

.tdhw-media__step {
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tdhw-accent, #4a90e2);
  margin-bottom: 14px;
  min-height: 1.2em;
  transition: opacity 0.35s ease;
  line-height: 1.35;
}

.tdhw-media__step--switching {
  opacity: 0.4;
}

.tdhw-carousel {
  position: relative;
}

.tdhw-carousel__viewport {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #e8ecf1;
}

.tdhw-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}

.tdhw-carousel__slide--active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 1;
}

.tdhw-carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tdhw-carousel__placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: linear-gradient(145deg, #e4e9ef, #d8dee8);
}

.tdhw-carousel__dots {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 2vw, 16px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100% - 24px);
}

.tdhw-carousel__dot {
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.35s ease, background 0.35s ease;
}

.tdhw-carousel__dot:not(.tdhw-carousel__dot--active) {
  width: 8px;
}

.tdhw-carousel__dot--active {
  width: 28px;
  background: #fff;
}

.tdhw-carousel__dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.tdhw-media__caption {
  margin: 18px 0 0;
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  color: #5a6578;
  transition: opacity 0.35s ease;
}

.tdhw-media__caption--switching {
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .tdhw-panel--active {
    animation: none;
  }
}

/* Responsive: stack columns */
@media (max-width: 960px) {
  .tdhw__grid {
    grid-template-columns: 1fr;
  }

  .tdhw__tab {
    min-width: 0;
    padding: 12px 14px;
  }

  .tdhw__tabs-shell {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .tdhw__tabs {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 6px;
  }

  .tdhw__tab {
    flex: 1 1 calc(50% - 3px);
    min-width: calc(50% - 3px);
    text-align: center;
    justify-content: center;
    white-space: normal;
    padding: 12px 10px;
  }
}

@media (max-width: 480px) {
  .tdhw-acc__trigger {
    padding-right: 4px;
  }

  .tdhw-carousel__viewport {
    border-radius: 16px;
  }
}
