/* ============================================================================
 * SHEETS.CSS — BOTTOM SHEETS KEYBOARD-SAFE (iOS visualViewport + Android)
 * Header fisso + Corpo scrollabile + Footer sticky sempre sopra la tastiera
 * ============================================================================ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(3, 6, 12, 0.76);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: calc(var(--vvh, 100dvh) - max(14px, var(--safe-top)) - 10px);
  transform: translateY(calc(-1 * var(--kb-offset, 0px)));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-accent);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.65);
}

.sheet-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
  color: var(--text-main);
  white-space: normal;
  overflow-wrap: anywhere;
}

.sheet-close-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 1.45rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px calc(max(14px, var(--safe-bottom)));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.sheet-footer .btn {
  flex: 1 1 130px;
}

/* ---- COMPONENTI RIUSABILI DENTRO GLI SHEET ---- */
.two-col-fluid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr));
  gap: 10px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font: 700 0.84rem/1.2 inherit;
  white-space: normal;
  cursor: pointer;
}

.chip-btn.is-selected {
  border-color: var(--accent-gold);
  background: rgba(229, 169, 60, 0.2);
  color: var(--accent-gold-light);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.toggle-switch {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.18);
  color: #6EE7B7;
  font: 700 0.84rem/1.2 inherit;
  cursor: pointer;
}

.toggle-switch.is-off {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

/* ---- SLOT FOTO & PREVIEW ---- */
.photo-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.photo-preview-img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: 10px;
  background: #0B1319;
  display: block;
}

.media-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr));
  gap: 10px;
}

.media-slot-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.media-slot-card img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.media-slot-label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---- ORARI 7 GIORNI ---- */
.hours-day-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.hours-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hours-day-name {
  font-weight: 700;
  font-size: 0.94rem;
}

.hours-slots-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr));
  gap: 8px;
}

/* ---- RELEASE / ROLLBACK ---- */
.release-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.release-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 160px;
}

.release-title {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.release-date {
  font-size: 0.78rem;
  color: var(--text-subtle);
}
