/* ─────────────────────────────────────────
   products.css — Oils & Soap card grids
   Fazenda dos Pinheiros
───────────────────────────────────────── */

/* ── Oils grid ── */
.oils-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
  background: rgba(200, 152, 42, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ── Base card ── */
.card {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  transition: background var(--duration) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(200, 152, 42, 0.08) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
  z-index: 1;
  pointer-events: none;
}

.card:hover {
  background: var(--surface-card-hover);
}
.card:hover::before {
  opacity: 1;
}

/* ── Card image ── */
.card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.65s var(--ease-out),
    filter 0.5s ease;
  filter: saturate(0.9);
}

.card:hover .card-img img {
  transform: scale(1.07);
  filter: saturate(1.05);
}

/* ── Card body ── */
.card-body {
  padding: 28px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Reserve two title lines when cards sit side by side, so the
   usage boxes below all start at the same height */
@media (min-width: 601px) {
  .oils-grid .card-name {
    min-height: 2.2em;
  }
}

.card-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
}

.card:hover .card-line {
  width: 56px;
}

.card-desc {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 24px;
}

/* ── Soap section separator ── */
.sep {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  opacity: 0.45;
}

.sep-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.sep-glyph {
  font-size: 1.2rem;
  color: var(--gold);
}

/* ── Soap grid (horizontal card) ── */
.soap-grid {
  display: grid;
  /* auto-fit collapses unused tracks, so a lone card spans the full row */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 2px;
  background: rgba(200, 152, 42, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.soap-card {
  background: var(--surface-card);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  overflow: hidden;
  transition: background var(--duration) var(--ease-out);
}

.soap-card:hover {
  background: var(--surface-card-hover);
}

.soap-img {
  overflow: hidden;
}

.soap-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.65s var(--ease-out),
    filter 0.5s ease;
  filter: saturate(0.9);
}

.soap-card:hover .soap-img img {
  transform: scale(1.05);
  filter: saturate(1.05);
}

.soap-body {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.soap-body .card-name {
  margin-bottom: 16px;
}

.soap-body .btn-buy {
  margin-top: 8px;
  align-self: flex-start;
}

/* Inside the tall soap body the usage box keeps its natural height */
.soap-body .posologia {
  flex: 0 0 auto;
}

/* ── Posologia block ── */
.posologia {
  background: rgba(200, 152, 42, 0.09);
  border: 1px solid rgba(200, 152, 42, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.posologia-tip {
  margin-top: auto;
}

.posologia-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.posologia-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.posologia-steps li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 12px;
  border-left: 2px solid rgba(200, 152, 42, 0.45);
}

.posologia-steps li strong {
  color: var(--parchment);
  font-weight: 600;
}

.posologia-dose {
  font-size: 1rem;
  color: var(--parchment);
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.55;
}

.posologia-tip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--lavender);
  text-transform: uppercase;
}

/* ── Botão Saiba Mais ── */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-buy {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  background: var(--moss);
  color: var(--parchment);
  border: 1px solid rgba(125, 156, 107, 0.35);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out);
}

.btn-buy:hover {
  background: var(--moss-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.btn-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 20px;
  border: 1px solid var(--border-gold-mid);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out);
  white-space: nowrap;
}

.btn-info:hover {
  background: rgba(200, 152, 42, 0.14);
  border-color: var(--border-gold-strong);
}

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(13, 8, 24, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal box ── */
.modal {
  background: var(--ink-mid);
  border: 1px solid var(--border-gold-mid);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: var(--border-gold-mid) transparent;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

/* ── Modal header ── */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-gold);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--parchment);
}

.modal-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: 4px;
}

.modal-close {
  background: none;
  border: 1px solid var(--border-gold-mid);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color var(--duration) ease,
    border-color var(--duration) ease;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--parchment);
  border-color: var(--border-gold-strong);
}

/* ── Modal video ── */
.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  overflow: hidden;
}

.modal-video.vertical {
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  width: min(100%, 420px);
  margin: 0 auto;
  display: block;
  position: relative;
  overflow: hidden;
}

.modal-video.vertical iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 178%;
  height: 100%;
  transform: translate(-50%, -50%);
  border: none;
}

.modal-video.drive {
  aspect-ratio: 9 / 16;
  max-height: 60vh;
  width: min(100%, 340px);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.modal-video.drive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.modal-video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(50, 85, 35, 0.3);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  gap: 10px;
}

/* ── Modal body text ── */
.modal-body {
  padding: 28px;
}

/* Photo header inside species modals */
.modal-photo {
  margin: 0 0 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-gold);
}

.modal-photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.modal-photo figcaption {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 8px 12px;
  background: rgba(19, 14, 31, 0.6);
}

.modal-body p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  font-weight: 400;
}

.modal-body p + p {
  margin-top: 16px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .soap-grid {
    grid-template-columns: 1fr;
  }
  .soap-card {
    grid-template-columns: 1fr;
  }
  .soap-img {
    height: 240px;
  }
}

@media (max-width: 600px) {
  .section-header {
    grid-template-columns: 1fr;
  }
  .section-label {
    padding-top: 0;
  }
  .oils-grid {
    grid-template-columns: 1fr;
  }
  .btn-row {
    flex-direction: column;
  }
  .btn-info,
  .btn-buy {
    width: 100%;
    justify-content: center;
  }
  .modal-header {
    padding: 20px;
  }
  .modal-body {
    padding: 20px;
  }
}
