/* ==========================================================================
   TabLam Virtual Product Showroom — Production Interactive Layer
   Modular styling for progressive enhancement: Dialog, ScrollSpy, Sound,
   Share, Toast, Object Returns & Material Hero.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Active Navigation States (Progressive Enhancement Sync)
   -------------------------------------------------------------------------- */
.nav-link.is-active {
  border-color: var(--accent) !important;
  color: var(--green) !important;
}

.rail-link.is-active {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
}

/* --------------------------------------------------------------------------
   2. Header Utility Controls (Sound, Share)
   -------------------------------------------------------------------------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: #555047;
  font: 9px/1 var(--mono);
  letter-spacing: 0.12em;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.action-btn:hover,
.action-btn:focus-visible {
  border-color: var(--ink);
  color: var(--ink);
  background: #ede8df;
}

.action-btn.is-active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.action-btn__icon {
  font-size: 11px;
}

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

/* --------------------------------------------------------------------------
   3. Room 05 Material Hero Scene
   -------------------------------------------------------------------------- */
.material-scene-banner {
  margin-bottom: 40px;
  border-radius: 2px;
  overflow: hidden;
  max-height: 480px;
  position: relative;
  background: #3a362f;
}

.material-scene-banner img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.85);
  transition: transform 1.2s var(--ease);
}

.material-scene-banner:hover img {
  transform: scale(1.025);
}

.material-scene-caption {
  position: absolute;
  bottom: 18px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font: 10px var(--mono);
  letter-spacing: 0.12em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

/* --------------------------------------------------------------------------
   4. Object Actions & Return Navigation
   -------------------------------------------------------------------------- */
.object-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 28px;
}

.object-return {
  font: 10px var(--mono);
  letter-spacing: 0.1em;
  color: #796e62;
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  transition: color 0.25s, border-color 0.25s;
}

.object-return:hover,
.object-return:focus-visible {
  color: var(--green);
  border-color: var(--green);
}

/* Highlight flash when arriving via hotspot */
.object.is-targeted {
  animation: object-pulse 1.8s var(--ease) forwards;
}

@keyframes object-pulse {
  0% {
    background-color: #e5ded2;
    box-shadow: 0 0 0 8px #e5ded2;
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

/* --------------------------------------------------------------------------
   5. Production Inquiry Dialog (Modal)
   -------------------------------------------------------------------------- */
.inquiry-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 680px;
  width: calc(100% - 32px);
  margin: auto;
  box-shadow: 0 35px 80px rgba(15, 14, 12, 0.45);
  border-radius: 8px;
  overflow: visible;
}

.inquiry-dialog::backdrop {
  background: rgba(21, 20, 18, 0.75);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.dialog-card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(28px, 4vw, 44px);
  position: relative;
  overflow: hidden;
  animation: dialogUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialogUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.dialog-header h2 {
  font-size: clamp(34px, 4.5vw, 48px);
  margin-top: 8px;
  letter-spacing: -0.04em;
}

.dialog-close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--ink);
  transition: all 0.25s var(--ease);
}

.dialog-close:hover,
.dialog-close:focus-visible {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  transform: rotate(90deg);
}

.dialog-desc {
  font-size: 14px;
  color: #696256;
  line-height: 1.6;
  margin-bottom: 24px;
}

.inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

.form-group label {
  font: 9px var(--mono);
  letter-spacing: 0.12em;
  color: #6f6456;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #cfc7ba;
  border-radius: 4px;
  font: 14px var(--sans);
  color: var(--ink);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 59, 37, 0.15);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.dialog-actions .button {
  flex: 1;
  min-width: 150px;
  justify-content: center;
  padding: 14px 18px;
  font-size: 11px;
}

.button--secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.button--secondary:hover {
  background: #eae4d7;
}

.dialog-note {
  font-size: 11px;
  color: #797165;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.dialog-note code {
  font-family: var(--mono);
  background: #e6e0d3;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   6. Floating Back to Top Button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 10px 16px;
  font: 10px var(--mono);
  letter-spacing: 0.14em;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #3a362f;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   7. Toast Notification System
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #181715;
  color: #f3f0e9;
  border-left: 3px solid var(--bronze);
  padding: 14px 20px;
  border-radius: 4px;
  font: 12px/1.5 var(--sans);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.35s var(--ease);
  max-width: 360px;
}

.toast strong {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--sand);
  display: block;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(14px);
  }
}

.toast.is-leaving {
  animation: toastOut 0.3s forwards ease;
}
