/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  /* Override font-size from in-content/common.css which is too large */
  font-size: inherit;
}

[hidden] {
  display: none !important;
}

#debugging-console {
  /* include the default borders in the max-height */
  box-sizing: border-box;
  float: right;
  height: 100vh;
  /* Float above the other overlays */
  position: relative;
  z-index: 99;
}

payment-dialog {
  box-sizing: border-box;
  display: grid;
  grid-template: "header" auto
                 "main"   1fr
                 "disabled-overlay" auto;
  height: 100%;
}

payment-dialog > header,
.page > .page-body,
.page > footer {
  padding: 0 10%;
}

payment-dialog > header {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  display: flex;
  /* from visual spec: */
  padding-bottom: 19px;
  padding-top: 19px;
}

#main-container {
  display: flex;
  grid-area: main;
  position: relative;
  max-height: 100%;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  width: 100%;
}

.page > .page-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* The area above the footer should scroll, if necessary. */
  overflow: auto;
}

.page > .page-body > h2:empty {
  display: none;
}

.page > footer {
  align-items: center;
  background-color: #eaeaee;
  display: flex;
  /* from visual spec: */
  padding-top: 20px;
  padding-bottom: 18px;
}

#error-text {
  text-align: center;
}

#order-details-overlay {
  background-color: var(--in-content-page-background);
  overflow: auto;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
}

#total {
  flex: 1 1 auto;
  margin: 5px;
}

#total > currency-amount {
  color: var(--in-content-link-color);
  font-size: 1.5em;
}

#total > currency-amount > .currency-code {
  color: GrayText;
  font-size: 1rem;
}

#total > div {
  color: GrayText;
}

#view-all {
  flex: 0 1 auto;
}

payment-dialog #pay::before {
  -moz-context-properties: fill;
  content: url(chrome://browser/skin/connection-secure.svg);
  fill: currentColor;
  height: 16px;
  margin-right: 0.5em;
  vertical-align: text-bottom;
  width: 16px;
}

payment-dialog[changes-prevented][completion-state="fail"] #pay,
payment-dialog[changes-prevented][completion-state="unknown"] #pay,
payment-dialog[changes-prevented][completion-state="processing"] #pay,
payment-dialog[changes-prevented][completion-state="success"] #pay {
  /* Show the pay button above #disabled-overlay */
  position: relative;
  z-index: 1;
}

#cancel {
  margin-left: auto;
}

#disabled-overlay {
  background: white;
  grid-area: disabled-overlay;
  opacity: 0.6;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
