/* ── Toy Detail Modal ─────────────────────────────── */

.tdm-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tdm-modal[hidden] { display: none; }

.tdm-modal:not([hidden]) {
  animation: tdmBackdropIn 0.22s ease;
}
.tdm-modal:not([hidden]) .tdm-sheet {
  animation: tdmSheetUp 0.25s ease;
}

@keyframes tdmBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes tdmSheetUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tdm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 18, 8, 0.55);
}

.tdm-sheet {
  position: relative;
  background: #fff;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -8px 48px rgba(26, 18, 8, 0.16);
  overscroll-behavior: contain;
}

.tdm-close-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 8px 8px 0;
  height: 60px;
  margin-bottom: -60px;
  pointer-events: none;
}

.tdm-drag-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.tdm-drag-handle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 10px;
  width: 38px;
  height: 4px;
  transform: translateX(-50%);
  background: #8C7E76;
  border-radius: 999px;
}

.tdm-drag-handle:active {
  cursor: grabbing;
}

.tdm-drag-handle:focus-visible {
  outline: 2px solid #D85A30;
  outline-offset: 2px;
  border-radius: 999px;
}

.tdm-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.94);
  color: #6B5D54;
  box-shadow: 0 2px 12px rgba(26, 18, 8, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  pointer-events: all;
}
.tdm-close:hover { background: #EAE0D8; color: #1A1208; }
.tdm-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 3;
  background: #F5F0EB;
  overflow: hidden;
  border-radius: 0;
  margin: 0;
}

.tdm-photo-frame {
  position: absolute;
  inset: 28px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  clip-path: inset(0 round 14px);
}

.tdm-photo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 14px;
}

.tdm-gift-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: #FFFFFF;
  color: #D85A30;
  border: 1.5px solid #D85A30;
  font-size: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
}
.tdm-gift-badge[hidden] { display: none; }

.tdm-content {
  padding: 14px 20px 32px;
}

.tdm-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #1A1208;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
}

.tdm-details {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  row-gap: 12px;
  align-items: start;
}

.tdm-detail-key {
  font-size: 13px;
  line-height: 1.5;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  color: #1A1208;
  white-space: nowrap;
}

.tdm-detail-val {
  font-size: 13px;
  color: #6B5D54;
  line-height: 1.5;
}

.tdm-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  font-size: 12px;
  color: #C4B5AC;
  text-decoration: none;
  transition: color 0.15s;
}
.tdm-brand-link:hover { color: #6B5D54; }
.tdm-brand-link:focus-visible { outline: 2px solid #D85A30; outline-offset: 2px; border-radius: 2px; }
.tdm-brand-link[hidden] { display: none; }
.tdm-brand-link .external-link-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}


.tdm-section {
  padding-top: 0;
  margin-top: 0;
}
.tdm-section + .tdm-section {
  margin-top: 20px;
}

.tdm-section-label {
  font-size: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #D85A30;
  margin-bottom: 8px;
}

.tdm-why {
  font-size: 14px;
  line-height: 1.65;
  color: #6B5D54;
  font-weight: 400;
}

.tdm-play {
  font-size: 14px;
  line-height: 1.65;
  color: #6B5D54;
  font-style: normal;
}

.tdm-play em {
  font-style: italic;
}

@media (min-width: 560px) {
  .tdm-modal {
    align-items: center;
  }

  .tdm-sheet {
    width: calc(100% - 48px);
    max-width: 660px;
    border-radius: 32px;
    max-height: 88vh;
    display: flex;
    flex-direction: row;
    overflow: hidden;
  }

  .tdm-drag-handle { display: none; }

  .tdm-modal:not([hidden]) .tdm-sheet {
    animation: tdmSheetIn 0.25s ease;
  }
  @keyframes tdmSheetIn {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  .tdm-close-bar {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    height: 44px;
    width: 44px;
    padding: 0;
    margin-bottom: 0;
    pointer-events: all;
  }

  .tdm-photo-wrap {
    flex: 0 0 260px;
    aspect-ratio: unset;
    align-self: stretch;
    margin: 0;
    border-radius: 0;
  }

  .tdm-photo-frame {
    inset: 16px;
  }

  .tdm-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 28px 32px;
    min-width: 0;
  }

  .tdm-name {
    font-size: 20px;
  }
}
