/* ============================================
   FlowStash — Single Product Page
   Editorial layout · Cinematic detail view
   ============================================ */

.product-page {
  padding-top: var(--space-8);
}

.product-page__layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-8);
  align-items: start;
}

.product-page__main {
  min-width: 0;
}

.product-page__sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-10));
}

/* Breadcrumb */
.product-page__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  letter-spacing: var(--tracking-wide);
}

.product-page__breadcrumb a {
  color: var(--text-muted);
}

.product-page__breadcrumb a:hover {
  color: var(--text-primary);
}

.product-page__breadcrumb-sep {
  color: var(--text-ghost);
}

/* Title Area */
.product-page__title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  letter-spacing: var(--tracking-tighter);
}

.product-page__author {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.product-page__author span {
  color: var(--accent);
}

.product-page__author-link {
  color: var(--accent);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: opacity var(--duration-fast);
  display: inline;
}
.product-page__author-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.product-page__stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.product-page__stars {
  color: var(--warning);
}

.product-page__sales {
  color: var(--text-muted);
}

.product-page__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
}

/* Video */
.product-page__video {
  margin-bottom: var(--space-10);
}

/* Description */
.product-page__description {
  margin-bottom: var(--space-12);
}

.product-page__description h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
  letter-spacing: var(--tracking-tight);
}

.product-page__description p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.product-page__description ul {
  list-style: disc;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.product-page__description li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

/* FAQ */
.product-page__faq {
  margin-bottom: var(--space-12);
}

.product-page__faq h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-5);
  letter-spacing: var(--tracking-tight);
}

/* Sidebar Card */
.product-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-glow-card);
}

.product-sidebar__price {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  letter-spacing: var(--tracking-tight);
}

.product-sidebar__price--free {
  color: var(--success);
}

.product-sidebar__buy {
  width: 100%;
  margin-bottom: var(--space-4);
}

.product-sidebar__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.product-sidebar__info-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.product-sidebar__info-label {
  color: var(--text-muted);
}

.product-sidebar__info-value {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

@media (max-width: 1024px) {
  .product-page__layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .product-page__sidebar {
    position: static;
  }
}

/* Contact Author Section Refinement */
.glass-panel.contact-author {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-tertiary);
  border-color: var(--border-default);
  transform: none;
}

.glass-panel.contact-author:hover {
  transform: none;
  border-color: var(--border-hover);
}

.contact-author__title {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.contact-author__desc {
  font-size: var(--text-xs);
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

#turnstile-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ── Textarea Wrapper & Expand Button ── */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

.btn-expand {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  min-width: 44px;
  min-height: 44px;
  margin: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
  z-index: 2;
  backdrop-filter: blur(4px);
}

.btn-expand:hover {
  background: var(--glass-border);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

#contact-message {
  resize: none;
  overflow-y: auto;
  min-height: 140px;
  margin-bottom: 0px; /* Managed by wrapper */
  width: 100%;
  display: block;
  padding-bottom: 40px; /* Space for expand button */
}

.textarea-wrapper {
  margin-bottom: var(--space-3);
}

#contact-email {
  width: 100%;
  margin-bottom: var(--space-2);
  display: block;
}

/* ── Modal Overlay ── */
.textarea-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.textarea-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.textarea-modal__content {
  position: relative;
  width: 100%;
  max-width: 800px;
  min-height: 460px;
  max-height: 85vh;
  background: var(--bg-overlay);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl), var(--shadow-glow-card);
  animation: fadeInScale 0.4s var(--ease-cinematic) both;
}

.textarea-modal__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.textarea-modal__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.textarea-modal__close {
  color: var(--text-muted);
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  display: flex;
}

.textarea-modal__close:hover {
  color: var(--text-primary);
}

.textarea-modal__body {
  flex: 1;
  padding: var(--space-4);
  background: var(--bg-primary);
}

.textarea-modal__body textarea {
  width: 100% !important;
  height: 100% !important;
  min-height: 300px;
  background: transparent;
  border: none;
  padding: var(--space-4);
  font-size: var(--text-base);
  resize: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: var(--leading-relaxed);
}

.textarea-modal__footer {
  padding: var(--space-4) var(--space-6);
  background: var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.textarea-modal__footer .btn {
  padding: 12px 28px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

/* ── Mobile Layout Refinements ── */
@media (max-width: 768px) {
  .textarea-modal {
    padding: 0;
  }
  
  .textarea-modal__content {
    max-width: none;
    max-height: none;
    height: 100dvh; /* Focus visible over mobile keyboard */
    border-radius: 0;
    border: none;
    animation: fadeInUp 0.4s var(--ease-cinematic) both;
  }

  .textarea-modal__header {
    padding: var(--space-4) var(--space-5);
  }

  .textarea-modal__body textarea {
    font-size: 16px; /* IOS zoom prevention */
    padding: var(--space-5);
  }

  .textarea-modal__footer {
    padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom));
  }

  .product-page__layout {
    grid-template-columns: 1fr;
  }

  .product-page__sidebar {
    position: static;
  }

  .product-page__stats {
    flex-wrap: wrap;
  }

  .product-page__breadcrumb {
    font-size: var(--text-xs);
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .product-page__stats {
    gap: var(--space-1);
    font-size: var(--text-xs);
  }

  .product-page__breadcrumb {
    margin-bottom: var(--space-4);
  }
}
