/* =====================================================================
   Algaita — Movie page (simple, clean)
   Trailer on top → title → price + buttons → about → more movies
   Builds on home.css (colours, buttons, cards, rails)
===================================================================== */

.mp-main {
  padding-bottom: 48px;
}

.mp-wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px var(--hp-gutter, 16px) 0;
}

/* ---------- Trailer ---------- */
.mp-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.mp-player iframe,
.mp-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* No trailer: show the poster instead, a bit smaller */
.mp-player.is-poster {
  width: min(260px, 70%);
  aspect-ratio: 3 / 4;
  margin: 8px auto 0;
}

.mp-player.is-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Title card ---------- */
.mp-card {
  margin-top: 18px;
  background: transparent;
}

.mp-head {
  position: static;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.mp-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--hp-surface-2);
}

.mp-head-text {
  min-width: 0;
}

.mp-cat {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--hp-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.mp-cat:hover {
  text-decoration: underline;
}

.mp-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.mp-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--hp-muted);
  font-size: 13px;
}

.mp-facts li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mp-facts .hp-icon {
  width: 14px;
  height: 14px;
}

/* ---------- Buy box ---------- */
.mp-buy {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--hp-line);
  border-radius: 18px;
  background: var(--hp-surface);
}

.mp-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 14px;
}

.mp-price {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.mp-price.is-free {
  color: #22c55e;
}

.mp-price-note {
  color: var(--hp-muted);
  font-size: 13px;
}

.mp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.mp-actions > :only-child,
.mp-actions > form:only-child {
  grid-column: 1 / -1;
}

.mp-cart-form {
  display: contents;
}

.mp-btn-lg {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
}

.mp-btn-lg .hp-icon {
  width: 18px;
  height: 18px;
}

.mp-cart-btn,
.mp-btn-soft {
  border: 1px solid var(--hp-line);
  background: var(--hp-surface-2);
  color: #fff;
}

.mp-cart-btn:hover,
.mp-btn-soft:hover {
  border-color: rgba(245, 179, 1, 0.45);
}

.mp-cart-btn > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mp-cart-btn .mp-when-in,
.mp-cart-btn.is-in-cart .mp-when-out {
  display: none;
}

.mp-cart-btn.is-in-cart .mp-when-in {
  display: inline-flex;
}

.mp-cart-btn.is-in-cart {
  border-color: rgba(245, 179, 1, 0.5);
  color: var(--hp-accent);
}

.mp-cart-btn[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.mp-owned {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: #22c55e;
  font-weight: 800;
}

.mp-owned .hp-icon {
  width: 20px;
  height: 20px;
}

.mp-note,
.mp-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  color: var(--hp-muted);
  font-size: 13px;
  text-align: center;
}

.mp-note a {
  color: var(--hp-accent);
  font-weight: 700;
}

.mp-note .hp-icon,
.mp-secure .hp-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

/* ---------- About ---------- */
.mp-desc {
  margin-top: 22px;
}

.mp-desc h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.mp-desc p {
  margin: 0;
  color: #c9cfdb;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ---------- More movies ---------- */
.mp-more {
  margin-top: 34px;
}

.mp-more .hp-section-head {
  align-items: center;
}

.mp-see-all {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--hp-accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.mp-see-all .hp-icon {
  width: 16px;
  height: 16px;
}

/* =====================================================================
   PURCHASE DIALOG
===================================================================== */
.mp-dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--hp-line);
  border-radius: 20px;
  background: var(--hp-surface);
  color: var(--hp-text);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.mp-dialog::backdrop {
  background: rgba(5, 6, 10, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mp-dialog[open] {
  animation: mp-pop 0.2s ease;
}

@keyframes mp-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.mp-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mp-dialog-head h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.mp-dialog-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  background: var(--hp-surface-2);
  color: var(--hp-text);
  cursor: pointer;
}

.mp-dialog-close:hover {
  color: #fff;
}

.mp-dialog-movie {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--hp-radius);
  background: var(--hp-surface-2);
}

.mp-dialog-movie img {
  width: 48px;
  height: 64px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
}

.mp-dialog-movie strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.3;
}

.mp-dialog-movie span {
  color: var(--hp-accent);
  font-size: 15px;
  font-weight: 800;
}

.mp-dialog-details {
  margin: 14px 0 16px;
  padding: 0;
  list-style: none;
}

.mp-dialog-details li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--hp-line);
  color: var(--hp-text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.mp-dialog-details li:last-child {
  border-bottom: 0;
}

.mp-dialog-details .hp-icon {
  width: 17px;
  height: 17px;
  color: var(--hp-muted);
}

.mp-dialog form {
  margin: 0;
}

/* =====================================================================
   TOASTS + PAYMENT VERIFICATION SCREEN
===================================================================== */
.mp-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  pointer-events: none;
}

.mp-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--hp-line);
  border-left: 4px solid #22c55e;
  border-radius: 12px;
  background: var(--hp-surface-2);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  animation: mp-toast 3.2s ease forwards;
}

.mp-toast.warning { border-left-color: var(--hp-accent); }
.mp-toast.error   { border-left-color: #ef4444; }

@keyframes mp-toast {
  0%   { opacity: 0; transform: translateY(12px); }
  10%  { opacity: 1; transform: none; }
  88%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(12px); }
}

.mp-verify {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 13, 18, 0.97);
  color: var(--hp-text);
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.mp-verify-box {
  max-width: 360px;
}

.mp-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--hp-accent, #f5b301);
  border-radius: 50%;
  animation: mp-spin 0.9s linear infinite;
}

@keyframes mp-spin {
  to { transform: rotate(360deg); }
}

.mp-verify h2 {
  margin: 22px 0 8px;
  color: #fff;
  font-size: 20px;
}

.mp-verify p {
  margin: 0;
  color: var(--hp-muted, #9aa3b5);
  font-size: 14.5px;
  line-height: 1.6;
}

.mp-verify a {
  color: var(--hp-accent, #f5b301);
  font-weight: 700;
}


/* =====================================================================
   LARGER SCREENS
===================================================================== */
@media (min-width: 640px) {
  .mp-wrap {
    padding-top: 24px;
  }

  .mp-thumb {
    width: 88px;
    height: 117px;
  }

  .mp-buy {
    padding: 20px;
  }

  .mp-actions {
    grid-template-columns: repeat(2, minmax(0, 220px));
  }

  .mp-note,
  .mp-secure {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-dialog[open],
  .mp-toast {
    animation: none;
  }

  .mp-spinner {
    animation-duration: 2s;
  }
}