/* ==========================================================================
   BEATSHOUSE — Mobile Failsafe CSS v5.0
   OLED-ready mobile layer. Tap targets, safe areas, iOS quirks.
   ========================================================================== */

/* ── Global font reset ── */
body,
.profile-section,
.profile-section * {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}

h1, h2, h3,
.profile-section h2,
.username {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.92);
}

/* ── Profile section card ── */
.profile-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
              0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: 0;
  padding: 20px;
  margin: 24px auto;
  max-width: 1000px;
}

.profile-section h2 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
}

/* ── Beats grid ── */
.beats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.beat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: 0;
  padding: 14px;
  color: rgba(255, 255, 255, 0.92);
  transition: transform 0.22s cubic-bezier(0.19,1,0.22,1),
              border-color 0.22s cubic-bezier(0.19,1,0.22,1),
              box-shadow 0.22s cubic-bezier(0.19,1,0.22,1);
}

.beat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
              0 12px 32px rgba(0, 0, 0, 0.4);
}

.beat-card h3 {
  margin: 0 0 6px;
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
}

/* ── Global touch baseline ── */
/* All interactive elements: prevent 300ms tap delay */
button,
a,
[role="button"],
input,
select,
textarea,
label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Minimum 44×44px tap target for all interactive elements */
button,
a.button,
[role="button"],
.beat-card,
.bh-home-master-play,
.bh-dock-item {
  min-height: 44px;
  min-width: 44px;
}

/* ── @media (hover: none) — reveal hidden hover-only elements ── */
@media (hover: none) {
  /* Elements hidden via opacity:0 hover tricks must be visible on touch */
  .bh-home-trackrow .bh-home-master-play,
  .bh-home-trackrow [class*="fav"],
  .bh-home-trackrow [class*="play"],
  .beat-card [class*="fav"],
  .beat-card [class*="play"],
  [class*="trackrow"] [class*="btn"],
  [class*="track-actions"] {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Disable hover transforms — only active states on touch */
  .beat-card:hover,
  .bh-home-trackrow:hover {
    transform: none;
  }
}

/* ── Mobile breakpoint ── */
@media screen and (max-width: 768px) {
  .wp-block-columns {
    flex-direction: column !important;
    gap: 24px !important;
  }

  .wp-block-column {
    max-width: 100% !important;
  }

  /* Select / variations on mobile — readable font-size (prevents iOS zoom) */
  select,
  .variations_form select,
  input[type="text"],
  input[type="email"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  textarea {
    font-size: 16px !important; /* prevents iOS auto-zoom */
    touch-action: manipulation;
  }

  select,
  .variations_form select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    color: rgba(255, 255, 255, 0.92) !important;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px !important;
  }

  /* Add to cart — full width on mobile */
  .woocommerce div.product .single_add_to_cart_button.button {
    width: 100% !important;
    font-size: 16px !important;
    padding: 14px !important;
    border-radius: 0 !important;
    min-height: 50px !important;
    touch-action: manipulation;
  }

  /* Add to cart active state — touch press feedback */
  .woocommerce div.product .single_add_to_cart_button.button:active {
    transform: scale(0.96);
  }

  /* Player & download list */
  .player-container,
  .download-list {
    max-width: 100% !important;
    padding: 16px !important;
    border-radius: 0;
  }

  /* Layout compact sections */
  .home    { padding: 0 8px; }
  .sec     { padding: 14px 12px; margin-bottom: 14px; border-radius: 0; }

  /* Hero */
  .hero           { height: 60vh; min-height: 340px; border-radius: 0; margin: 10px 0; }
  .hero-content h1 { font-size: 1.5rem; line-height: 1.2; }

  /* Profile box */
  .profile-box             { flex-direction: column; text-align: center; gap: 10px; }
  .profile-box img         { width: 80px; height: 80px; }

  /* License description hide on small screens */
  #license-description-box { display: none !important; }

  /* Bottom nav / dock safe area — avoid notch/home indicator on iOS */
  .bh-dock-container,
  [class*="bottom-nav"],
  [class*="dock"] {
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
}

/* ── Buttons: touch active state ── */
/* Scale-down press feedback on touch devices */
@media (hover: none) {
  button:active,
  a.button:active,
  [role="button"]:active,
  .bh-home-master-play:active,
  .bh-dock-item:active {
    transform: scale(0.96);
    transition: transform 0.14s cubic-bezier(0.19,1,0.22,1);
  }
}

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