/* ==========================================================================
   PHASE 5: CHOOSE YOUR PREPARATION — 3D BOX EDITION
   ========================================================================== */

.packages-section {
  position: relative;
  background-color: var(--surface);
  color: var(--ink);
  padding: 3rem 0 3rem;
  overflow: hidden;
}

.packages-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(20,17,15,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,17,15,0.028) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
}

#pack { 
  max-width: var(--container-max); 
  margin: 0 auto; 
  padding: 0 2rem; 
  display: flex; 
  flex-direction: row-reverse;
  gap: 3rem; 
  align-items: flex-start; 
  position: relative;
  z-index: 10;
}

#left { flex: 1; min-width: 0; }
#right { width: 480px; flex-shrink: 0; position: sticky; top: calc(var(--header-height, 64px) + 2rem); margin: 0 auto; }

/* The h1 styling is now handled by .res-headline classes injected in HTML */
#pack .sub { 
  font-family: var(--font-body);
  color: var(--gray); 
  font-size: 1.05rem; 
  margin: 0 0 24px; /* Reduced margin */
}
#pack .label { 
  font-family: 'Space Mono', monospace; 
  font-size: 0.68rem; 
  letter-spacing: 0.15em; 
  color: var(--gray); 
  margin-bottom: 1.2rem; 
  text-transform: uppercase;
}

/* course rows */
.course { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  background: #fff; 
  border: 1px solid rgba(20,17,15,0.1); 
  border-radius: 12px; 
  padding: 16px 20px; 
  margin-bottom: 14px; 
  cursor: pointer; 
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  user-select: none;
}
@media (prefers-reduced-motion: no-preference) {
  .course:hover {
    transform: translateY(-4px); /* Hover lift */
    border-color: rgba(197,160,40,0.5);
    box-shadow: 0 8px 24px rgba(20,17,15,0.07);
  }
  .course.on {
    transform: translateY(-2px);
  }
}
.course.on { 
  border-color: var(--gold); 
  box-shadow: 0 0 0 3px rgba(197,160,40,0.15), 0 8px 28px rgba(20,17,15,0.08); 
}
.course.locked { 
  cursor: default; 
  opacity: 0.7; 
}
.course.locked:hover {
  transform: none;
}
.check { 
  width: 22px; 
  height: 22px; 
  border: 2px solid rgba(20,17,15,0.2); 
  border-radius: 5px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #fff; 
  font-size: 14px; 
  flex-shrink: 0; 
  transition: background 0.2s, border-color 0.2s;
}
.on .check { 
  background: var(--gold); 
  border-color: var(--gold); 
}
.icon { 
  width: 44px; 
  height: 44px; 
  border-radius: 10px; 
  background: #f3ece0; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 22px; 
  flex-shrink: 0;
  color: var(--ink-soft);
}
.icon svg { display: block; }
.mid { flex: 1; }
.tag { 
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace; 
  font-size: 11px; 
  letter-spacing: 2px; 
  color: var(--gray); 
}
.popular-badge {
  background: var(--red);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}
.name { 
  font-weight: 800; 
  font-size: 16px; 
  margin: 2px 0 4px; 
}
.desc { 
  font-size: 12.5px; 
  color: var(--ink-soft); 
}
.cost { text-align: right; }
.cost b { font-size: 18px; }
.cost div { 
  font-family: 'Space Mono', monospace; 
  font-size: 10px; 
  letter-spacing: 2px; 
  color: var(--gray); 
  margin-top: 4px; 
}

/* Dashed Study Material Row */
.dashed-bonus-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  margin-bottom: 14px;
  border: 1px dashed rgba(20,17,15,0.2);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
}
.dashed-bonus-row .pill {
  margin-left: auto;
}

/* right column */
#stageWrap { position: relative; height: 420px; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; outline: none; }

#boxCaption {
  position: absolute;
  top: 0px; 
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(20,17,15,0.2);
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}
#boxCaption::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--ink);
}
#boxCaption.hidden { 
  opacity: 0; 
  transform: translate(-50%, -10px);
}

#badge { 
  position: absolute; 
  top: 18%;
  right: 12%;
  width: 44px; 
  height: 44px; 
  border-radius: 50%; 
  border: 2px dashed rgba(40, 20, 10, 0.55);
  color: rgba(40, 20, 10, 0.75); 
  font-size: 22px; 
  font-family: 'Courier New', monospace;
  font-weight: 900; 
  display: flex;
  align-items: center; 
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  transform: rotate(-12deg);
  mix-blend-mode: multiply;
  /* Hidden by default — JS adds .badge-visible when mode=open */
  opacity: 0;
  transition: opacity 0.5s ease;
}

#badge.badge-visible {
  opacity: 1;
}

#badge::before {
  content: 'QTY';
  position: absolute;
  top: 5px;
  font-size: 8px;
  letter-spacing: 1px;
}

@keyframes bump {
  0%   { transform: rotate(-12deg) scale(1); }
  50%  { transform: rotate(-12deg) scale(1.35); }
  100% { transform: rotate(-12deg) scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  #badge.bump { animation: bump 0.35s ease-out; }
}

#summary { 
  background: #fff; 
  border: 1px solid rgba(20,17,15,0.1); 
  border-radius: 12px; 
  padding: 10px 16px; 
  margin: -80px 0 16px; /* pulled up closer to box */
  position: relative;
  z-index: 10;
  font-size: 13px; 
  min-height: 50px; 
}
.row { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 2px; 
  color: var(--ink-soft); 
}
.row span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row span svg {
  width: 18px;
  height: 18px;
}
.row.free { 
  font-style: italic; 
  color: var(--green); 
}
.pill { 
  font-style: normal; 
  font-size: 11px; 
  font-weight: bold; 
  background: rgba(31,122,77,0.1); 
  color: var(--green); 
  border: 1px solid rgba(31,122,77,0.2); 
  border-radius: 12px; 
  padding: 2px 10px; 
}
.total { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-top: 1px solid rgba(20,17,15,0.1); 
  margin-top: 6px; 
  padding-top: 8px; 
  font-weight: 800; 
}
.total span:last-child { font-size: 18px; font-variant-numeric: tabular-nums; }

#continueBtn, .mobile-continue-btn { 
  width: 100%; 
  padding: 18px; 
  font-size: 15px; 
  font-weight: 800; 
  letter-spacing: 1px; 
  color: #fff; 
  background: var(--ink); 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  transition: opacity 0.3s;
}
#continueBtn:disabled, .mobile-continue-btn:disabled { 
  opacity: 0.4; 
  cursor: default; 
}

.trust-strip {
  font-size: 11px;
  color: var(--gray);
  text-align: center;
  margin-top: 12px;
  font-family: var(--font-body);
}

.mobile-bottom-bar {
  display: none;
}

@media (max-width: 900px) {
  #pack { 
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
      "right"
      "left";
    padding: 24px 2rem 100px; 
  }
  #left { grid-area: left; }
  #right { grid-area: right; width: 100%; position: static; margin-bottom: 24px; }
  
  #stageWrap { 
    position: sticky; 
    top: calc(var(--header-height, 60px) + 1rem); 
    z-index: 20; 
    height: 240px; 
    background: transparent;
  }
  
  #pack h1 { font-size: 2.2rem; margin-top: 1rem; }
  
  .desktop-btn { display: none !important; }
  
  .trust-strip { display: none; } /* Hide on mobile to save space, or keep it above edit order */
  
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem 1.5rem;
    box-shadow: 0 -10px 30px rgba(20,17,15,0.08);
    z-index: 50;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid rgba(20,17,15,0.05);
  }
  .mobile-bottom-info {
    flex: 1;
  }
  .mobile-bottom-count {
    font-size: 12px;
    color: var(--gray);
    font-family: 'Space Mono', monospace;
  }
  .mobile-bottom-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
  }
  .mobile-continue-btn {
    width: auto;
    padding: 14px 24px;
    min-width: 140px;
  }
}
