/**
 * Cart side panel and /cart page (redesign step 4).
 * Markup: region--top-bar.html.twig (panel) and CartPanelForm
 * (museodelpaesaggio_editorial). Sizes from the design handoff (S05).
 */

/* ── Panel ──
 * Full height, attached to the right edge, above the header, sliding in from
 * the right (js/header.js toggles .is-open after removing [hidden]). */
.museo-cart-panel[hidden] {
  display: none;
}

.museo-cart-panel__veil {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(26, 24, 21, 0.42);
  opacity: 0;
  transition: opacity 300ms ease;
}

.museo-cart-panel__sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1041;
  display: flex;
  flex-direction: column;
  width: var(--museo-cart-sidebar-width, 420px);
  max-width: 100vw;
  background: var(--bg-raised);
  color: var(--fg-default);
  box-shadow: -24px 0 64px rgba(26, 24, 21, 0.18);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.museo-cart-panel.is-open .museo-cart-panel__veil {
  opacity: 1;
}

.museo-cart-panel.is-open .museo-cart-panel__sheet {
  transform: none;
}

/* Logged-in editors: below the admin toolbar. */
body.toolbar-fixed .museo-cart-panel__sheet {
  top: var(--drupal-displace-offset-top, 0px);
}

@media (prefers-reduced-motion: reduce) {
  .museo-cart-panel__veil,
  .museo-cart-panel__sheet {
    transition: none;
  }
}

html.museo-cart-open,
html.museo-cart-open body {
  overflow: hidden;
}

.museo-cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 88px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-rule);
}

.museo-cart-panel__title {
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.museo-cart-panel__close,
.museo-cart-form__continue {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-default);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.museo-cart-panel__close:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The form fills the sheet: body scrolls, foot stays at the bottom. */
.museo-cart-panel .museo-cart-form,
.museo-cart-panel .museo-cart-form > form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.museo-cart-panel .museo-cart-form__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 28px;
}

/* ── Sections and rows ── */
.museo-cart-section {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border-rule);
}

.museo-cart-section__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.museo-cart-section__date {
  margin: 2px 0 0;
  color: var(--fg-muted);
  font-size: 13.5px;
}

.museo-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 15px;
}

.museo-cart-row__stepper {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.museo-cart-form .museo-stepper__button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-control);
  border-radius: var(--museo-radius-sm);
  background: var(--bg-raised);
  color: var(--fg-default);
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  box-shadow: none;
}

.museo-cart-form .museo-stepper__button:hover {
  border-color: var(--museo-ink);
  background: var(--bg-raised);
  color: var(--fg-default);
}

.museo-cart-row__qty {
  width: 40px;
  font-size: 20px;
  text-align: center;
}

.museo-cart-section__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 16px;
}

/* "Rimuovi" is a submit button that looks like a text link. */
.museo-cart-form .museo-cart-section__remove {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-default);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: underline;
  text-transform: none;
  text-underline-offset: 3px;
  box-shadow: none;
  cursor: pointer;
}

.museo-cart-form .museo-cart-section__remove:hover {
  background: none;
  color: var(--action-bg-hover);
}

.museo-cart-section__subtotal {
  font-size: 17px;
}

/* ── Foot: total and actions ── */
.museo-cart-form__foot {
  display: grid;
  gap: 16px;
  padding: 24px 28px 28px;
  border-top: 1px solid var(--museo-ink);
}

.museo-cart-form__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 15px;
}

.museo-cart-form__vat {
  color: var(--fg-muted);
}

.museo-cart-form__total strong {
  font-size: 36px;
  font-weight: 400;
}

.museo-cart-form__checkout {
  width: 100%;
}

.museo-cart-form__continue {
  justify-self: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Rule refusals (complimentary ticket) inside the panel. */
.museo-cart-form [data-drupal-messages],
.museo-cart-form .messages {
  margin: 16px 28px 0;
}

/* ── Empty cart ── */
.museo-cart-empty-panel {
  padding: 48px 28px;
}

.museo-cart-empty-panel__title {
  margin: 0;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.museo-cart-empty-panel__title em {
  color: var(--accent-display);
}

.museo-cart-empty-panel__text {
  margin: 20px 0 40px;
  color: var(--fg-muted);
  font-size: 17px;
}

.museo-cart-empty-panel__paths {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--museo-ink);
  list-style: none;
}

.museo-cart-empty-panel__paths li {
  border-bottom: 1px solid var(--border-rule);
}

.museo-cart-empty-panel__paths a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  color: var(--fg-default);
  font-size: 24px;
  text-decoration: none;
}

.museo-cart-empty-panel__paths a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ── /cart page ── */
.museo-cart-page {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: var(--museo-space-8) var(--museo-space-5) var(--museo-space-11);
}

.museo-cart-page__title {
  margin: 0 0 var(--museo-space-5);
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.museo-cart-page .museo-cart-form {
  background: var(--bg-raised);
  border: 1px solid var(--border-rule);
}

.museo-cart-page .museo-cart-form__body {
  padding: 0 28px;
}

/* ── Mobile: full screen ── */
@media (max-width: 991.98px) {
  .museo-cart-panel__sheet {
    width: 100%;
    box-shadow: none;
  }

  .museo-cart-panel__head {
    min-height: 64px;
    padding: 12px 20px;
  }

  .museo-cart-panel__title {
    font-size: 24px;
  }

  .museo-cart-panel .museo-cart-form__body,
  .museo-cart-form__foot,
  .museo-cart-empty-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .museo-cart-empty-panel__title {
    font-size: 40px;
  }
}

/* Phone (review 28/10/2026): the page container already has its side
   margin; the cart's own margins on top of it left 222px for the rows. */
@media (max-width: 575.98px) {
  .museo-cart-page {
    padding-right: 0;
    padding-left: 0;
  }

  .museo-cart-page__title {
    font-size: 38px;
  }

  .museo-cart-page .museo-cart-form__body {
    padding: 0 16px;
  }

  .museo-cart-page .museo-cart-form__foot {
    padding-right: 16px;
    padding-left: 16px;
  }

  .museo-cart-form__foot .museo-btn {
    white-space: nowrap;
  }
}
