/* ============================================
   GoCheckin Rewards – Appointment Detail Page
   ============================================ */

/* ---- Slide-in overlay ---- */
.appt-detail-page {
  position: absolute;
  inset: 0;
  z-index: 55; /* above appointment page (25) */
  background: var(--gradient-header);
  transform: translateX(100%);
  transition: var(--transition-slide);
  will-change: transform;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.appt-detail-page.open {
  transform: translateX(0);
}

/* ---- Header ---- */
.appt-detail-header {
  padding: var(--space-10) var(--space-5) 0;
  display: flex;
  align-items: center;
  padding-right: var(--space-8); /* offset for missing right btn */
  flex-shrink: 0;
}

.appt-detail-glass-btn {
  width: var(--space-8);
  height: var(--space-8);
  border-radius: var(--radius-2xl);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  flex-shrink: 0;
  background: var(--color-button-glass);
  box-shadow: var(--shadow-glass-btn);
  color: var(--color-content-main);
  transition: var(--transition-fade);
  backdrop-filter: var(--backdrop-blur-xs);
  -webkit-backdrop-filter: var(--backdrop-blur-xs);
}

.appt-detail-glass-btn:hover { opacity: 0.8; }

.appt-detail-header-title {
  flex: 1;
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-xl);
}

/* ---- Scrollable content ---- */
.appt-detail-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: var(--space-5) 0 160px; /* 160px bottom for action bar */
  -webkit-overflow-scrolling: touch;
}

.appt-detail-scroll::-webkit-scrollbar { display: none; }

/* ---- Section group (4px gap between cards) ---- */
.appt-detail-sections {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Base section card */
.appt-detail-section {
  background: var(--color-on-primary);
  padding: var(--space-5);
}

/* Top section — rounded top corners */
.appt-detail-section--top {
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  padding-top: 20px;
  padding-bottom: var(--space-5);
}

/* Bottom section — rounded bottom corners */
.appt-detail-section--bottom {
  border-radius: 0 0 var(--radius-3xl) var(--radius-3xl);
}

/* ---- Section 1: datetime + badge ---- */
.appt-detail-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appt-detail-datetime {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-l);
}

/* Confirmed badge */
.appt-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-3);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(40, 161, 70, 0.2);
  background: #e9f6ec;
}

.appt-detail-badge-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: #28a146;
}

.appt-detail-badge-label {
  font-size: var(--font-size-3xs);
  font-weight: var(--font-weight-semibold);
  color: #28a146;
  line-height: 14px;
  white-space: nowrap;
}

/* ---- Section 2: store info ---- */
.appt-detail-store-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-l);
  margin-bottom: var(--space-2);
}

.appt-detail-store-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-1);
}

.appt-detail-store-row svg,
.appt-detail-store-row .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-content-main);
}

.appt-detail-store-text {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-m);
}

.appt-detail-directions {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  line-height: var(--line-height-m);
  margin-top: var(--space-3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-family);
  display: block;
}

/* ---- Section 3: services ---- */
.appt-detail-services {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.appt-detail-service-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.appt-detail-service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-l);
}

.appt-detail-service-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-content-main);
  line-height: var(--line-height-m);
}

.appt-detail-service-by {
  font-weight: var(--font-weight-regular);
}

.appt-detail-service-tech {
  font-weight: var(--font-weight-semibold);
  flex: 1;
}

.appt-detail-service-dur {
  font-weight: var(--font-weight-regular);
}

/* ---- Section 4: summary ---- */
.appt-detail-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.appt-detail-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-m);
}

.appt-detail-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-weak);
}

.appt-detail-total-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-m);
}

.appt-detail-total-price {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-xl);
}

/* ---- Bottom action bar ---- */
.appt-detail-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: var(--backdrop-blur-l);
  -webkit-backdrop-filter: var(--backdrop-blur-l);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  padding: var(--space-5) var(--space-5) 0;
  display: flex;
  flex-direction: column;
}

.appt-detail-btn-row {
  display: flex;
  gap: var(--space-3);
}

.btn-appt-cancel,
.btn-appt-reschedule {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 12px var(--space-5);
  border: none;
  border-radius: var(--radius-3xl);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-l);
  cursor: pointer;
  transition: var(--transition-fade);
  white-space: nowrap;
}

.btn-appt-cancel {
  background: #ffd9d9;
  color: #d51818;
}

.btn-appt-reschedule {
  background: var(--color-content-main);
  color: var(--color-on-primary);
}

.btn-appt-cancel:hover,
.btn-appt-reschedule:hover { opacity: 0.85; }

.btn-appt-cancel svg,
.btn-appt-reschedule svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ---- Cancel Appointment Modal ---- */

/* Backdrop */
.cancel-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(34, 34, 38, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cancel-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom sheet */
.cancel-modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 11;
  background: var(--color-surface);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  padding: var(--space-6) var(--space-5) var(--space-7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-5);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.cancel-modal-sheet.open {
  transform: translateY(0);
}

/* Title + subtitle */
.cancel-modal-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
}

.cancel-modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-content-main);
  line-height: var(--line-height-xl);
}

.cancel-modal-subtitle {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: #64646c;
  line-height: var(--line-height-m);
}

/* Radio options list */
.cancel-modal-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.cancel-modal-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
}

/* Radio circle */
.cancel-radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(100, 100, 108, 0.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
  background: transparent;
}

.cancel-radio.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.cancel-radio.active::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-on-primary);
}

.cancel-modal-option-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-m);
}

/* "Other" textarea */
.cancel-modal-textarea-wrap {
  display: none;
  margin-top: 6px;
}

.cancel-modal-textarea-wrap.visible {
  display: block;
}

.cancel-modal-textarea {
  width: 100%;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-2xl);
  padding: 10px var(--space-4);
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-content-main);
  line-height: var(--line-height-m);
  resize: none;
  min-height: 80px;
  background: transparent;
  outline: none;
  transition: border-color 0.15s;
}

.cancel-modal-textarea::placeholder {
  color: #64646c;
}

.cancel-modal-textarea:focus {
  border-color: var(--color-primary);
}

/* Action buttons */
.cancel-modal-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.btn-cancel-confirm {
  width: 100%;
  padding: 12px var(--space-5);
  border: none;
  border-radius: var(--radius-3xl);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-l);
  cursor: default;
  background: #dadadd;
  color: #bdbdc2;
  transition: background 0.2s, color 0.2s, opacity 0.15s;
  white-space: nowrap;
}

.btn-cancel-confirm.enabled {
  background: #dc2d2d;
  color: var(--color-on-primary);
  cursor: pointer;
}

.btn-cancel-confirm.enabled:hover { opacity: 0.88; }

.btn-cancel-goback {
  width: 100%;
  padding: 12px var(--space-5);
  border: none;
  border-radius: var(--radius-3xl);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-l);
  cursor: pointer;
  background: var(--color-on-primary);
  color: var(--color-content-main);
  box-shadow: var(--shadow-card);
  transition: var(--transition-fade);
  white-space: nowrap;
}

.btn-cancel-goback:hover { opacity: 0.85; }

/* Home indicator */
.appt-detail-home-indicator {
  display: flex;
  justify-content: center;
  padding: var(--space-3) 0;
}

.appt-detail-home-bar {
  width: 135px;
  height: 5px;
  background: var(--color-content-main);
  border-radius: 100px;
  opacity: 0.3;
}
