/**
 * Safari Matrouh — add-to-cart confirmation popup
 */

.tewb-confirm {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
}

.tewb-confirm[hidden] {
  display: none !important;
}

.tewb-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.tewb-confirm__dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  padding: 24px;
}

.tewb-confirm__close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.tewb-confirm__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tewb-confirm__body {
  padding-top: 8px;
}

.tewb-confirm__loading,
.tewb-confirm__error {
  text-align: center;
  padding: 32px 12px;
  color: #64748b;
  font-size: 0.95rem;
}

.tewb-confirm__error {
  color: #b91c1c;
}

.tewb-confirm__hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.tewb-confirm__thumb {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
}

.tewb-confirm__meta h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
}

.tewb-confirm__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 110, 138, 0.1);
  color: #0a6e8a;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tewb-confirm__price {
  margin: 0;
  color: #0a6e8a;
  font-weight: 700;
  font-size: 0.95rem;
}

.tewb-confirm__note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(244, 162, 97, 0.12);
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1.6;
}

.tewb-confirm__details {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tewb-confirm__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.tewb-confirm__row:last-child {
  border-bottom: 0;
}

.tewb-confirm__row strong {
  color: #64748b;
  font-weight: 600;
}

.tewb-confirm__row span {
  color: #0f172a;
  font-weight: 700;
  text-align: end;
}

.tewb-confirm__totals {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
}

.tewb-confirm__totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.tewb-confirm__totals .is-total {
  font-size: 1rem;
  font-weight: 800;
  color: #0a6e8a;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.tewb-confirm__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.tewb-confirm__btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.tewb-confirm__btn--ghost {
  background: #f1f5f9;
  color: #475569;
}

.tewb-confirm__btn--ghost:hover {
  background: #e2e8f0;
}

.tewb-confirm__btn--primary {
  background: #0a6e8a;
  color: #fff;
}

.tewb-confirm__btn--primary:hover:not(:disabled) {
  background: #054a5e;
}

.tewb-confirm__btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tewb-confirm__btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

body.tewb-confirm-open {
  overflow: hidden;
}

.tewb-confirm__avail-hint {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(179, 135, 86, 0.08);
  border: 1px solid rgba(179, 135, 86, 0.22);
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #334155;
}

.tewb-confirm__acc-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.tewb-confirm__unit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.tewb-confirm__unit-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #475569;
}

.tewb-confirm__unit-meta-item strong {
  color: #0f172a;
  font-weight: 800;
}

.tewb-confirm__totals[hidden] {
  display: none !important;
}

.tewb-confirm__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.tewb-confirm__field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
}

.tewb-confirm__field input:focus {
  outline: none;
  border-color: #b38756;
  box-shadow: 0 0 0 3px rgba(179, 135, 86, 0.15);
}

.tewb-confirm__acc-status {
  min-height: 24px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.tewb-confirm__error-inline {
  color: #b91c1c;
  font-weight: 700;
}

.tewb-confirm__ok-inline {
  color: #065f46;
  font-weight: 700;
}

.tewb-confirm__row--seats .tewb-confirm__seats-wrap {
  display: inline-flex;
  align-items: center;
}

.tewb-confirm__seats-input {
  width: 88px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  background: #fff;
}

.tewb-confirm__seats-input:focus {
  outline: none;
  border-color: #b38756;
  box-shadow: 0 0 0 3px rgba(179, 135, 86, 0.15);
}

.tewb-confirm__totals .is-muted {
  color: #64748b;
  font-size: 0.9rem;
}

/* Booked dates popup (shared with product page) */
.tbw-acc-booked-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 15, 26, 0.55);
  backdrop-filter: blur(4px);
}

.tbw-acc-booked-modal[hidden] {
  display: none !important;
}

.tbw-acc-booked-modal__dialog {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  box-shadow: 0 20px 60px rgba(11, 15, 26, 0.2);
}

.tbw-acc-booked-modal__dialog h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: #0B0F1A;
}

.tbw-acc-booked-modal__dialog p {
  margin: 0 0 16px;
  color: #64748B;
  line-height: 1.7;
}

.tbw-acc-booked-modal__available {
  background: #F8FAFB;
  border: 1px dashed #E2E8F0;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #0B0F1A;
  line-height: 1.7;
}

.tbw-acc-booked-modal__btn {
  display: inline-flex;
  padding: 12px 32px;
  border: none;
  border-radius: 50px;
  background: #B38756;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 560px) {
  .tewb-confirm__acc-form {
    grid-template-columns: 1fr;
  }
}
