
:root {
  --action-sheet-mask-color: rgba(0, 0, 0, 0.1);

  --material-action-sheet-mask-color: rgba(0, 0, 0, 0.2);
}

/*~
  name: Action Sheet
  category: Action Sheet
  markup: |
    <div class="action-sheet-mask"></div>
    <div class="action-sheet">
      <div class="action-sheet-title">Title</div>
      <button class="action-sheet-button">Label</button>
      <button class="action-sheet-button">Cancel</button>
    </div>
*/

/*~
  name: Action Sheet with Delete Label
  category: Action Sheet
  markup: |
    <div class="action-sheet-mask"></div>
    <div class="action-sheet">
      <button class="action-sheet-button">Label</button>
      <button class="action-sheet-button action-sheet-button--destructive">Delete Label</button>
      <button class="action-sheet-button">Cancel</button>
    </div>
*/

.action-sheet {
  @apply(--reset-font);
  cursor: default;
  position: absolute;
  left: 10px; /* iOS 9, 10, 11 */
  right: 10px; /* iOS 9, 10, 11 */
  bottom: 10px; /* iOS 9, 10, 11 */
  z-index: 2;
}

.action-sheet-button {
  box-sizing: border-box;
  height: 56px;
  font-size: 20px;
  text-align: center;
  color: var(--action-sheet-button-color);
  background-color: var(--action-sheet-button-background-color);
  border-radius: 0;
  line-height: 56px;
  border: none;
  appearance: none;
  display: block;
  width: 100%;
  @apply(--ellipsis);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: bottom;
  background-image: linear-gradient(0deg, var(--action-sheet-button-separator-color), var(--action-sheet-button-separator-color) 100%);
  @media (--retina-query) {
    background-image: linear-gradient(0deg, var(--action-sheet-button-separator-color), var(--action-sheet-button-separator-color) 50%, transparent 50%);
  }
}

.action-sheet-button:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.action-sheet-button:active {
  background-color: var(--action-sheet-button-active-background-color);
  background-image: none;
}

.action-sheet-button:focus {
  outline: none;
}

.action-sheet-button:nth-last-of-type(2) {
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 12px;
  background-image: none;
}

.action-sheet-button:last-of-type {
  border-radius: 12px;
  margin: 8px 0 0 0; /* iOS 9, 10, 11 */
  background-color: var(--action-sheet-cancel-button-background-color);
  background-image: none;
  font-weight: 600;
}

.action-sheet-button:last-of-type:active {
  background-color: var(--action-sheet-button-active-background-color);
}

.action-sheet-button--destructive {
  color: var(--action-sheet-button-destructive-color);
}

.action-sheet-title {
  box-sizing: border-box;
  height: 56px;
  font-size: 13px;
  color: var(--action-sheet-title-color);
  text-align: center;
  background-color: var(--action-sheet-button-background-color);
  line-height: 56px;
  @apply(--ellipsis);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: bottom;
  background-image: linear-gradient(0deg, var(--action-sheet-button-separator-color), var(--action-sheet-button-separator-color) 100%);
  @media (--retina-query) {
    background-image: linear-gradient(0deg, var(--action-sheet-button-separator-color), var(--action-sheet-button-separator-color) 50%, transparent 50%);
  }
}

.action-sheet-title:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.action-sheet-icon {
  display: none;
}

.action-sheet-mask {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: var(--action-sheet-mask-color);
  z-index: 1;
}

/*~
  name: Material Action Sheet
  category: Action Sheet
  markup: |
    <div class="action-sheet-mask action-sheet-mask--material"></div>
    <div class="action-sheet action-sheet--material">
      <button class="action-sheet-button action-sheet-button--material"><i class="ion-android-checkbox-blank action-sheet-icon--material"></i>Label</button>
      <button class="action-sheet-button action-sheet-button--material"><i class="ion-android-checkbox-blank action-sheet-icon--material"></i>Label</button>
      <button class="action-sheet-button action-sheet-button--material"><i class="ion-android-close action-sheet-icon--material"></i>Cancel</button>
    </div>
*/

/*~
  name: Material Action Sheet with Title
  category: Action Sheet
  markup: |
    <div class="action-sheet-mask action-sheet-mask--material"></div>
    <div class="action-sheet action-sheet--material">
      <div class="action-sheet-title action-sheet-title--material">Title</div>
      <button class="action-sheet-button action-sheet-button--material"><i class="ion-android-checkbox-blank action-sheet-icon--material"></i>Label</button>
      <button class="action-sheet-button action-sheet-button--material"><i class="ion-android-close action-sheet-icon--material"></i>Cancel</button>
    </div>
*/

.action-sheet--material {
  left: 0;
  right: 0;
  bottom: 0;
  @apply(--material-shadow-5);
}

.action-sheet-title--material {
  @apply(--material-font);
  border-radius: 0;
  background-image: none;
  text-align: left;
  height: 56px;
  line-height: 56px;
  font-size: 16px;
  padding: 0 0 0 16px;
  color: var(--material-action-sheet-text-color);
  background-color: white;
  font-weight: 400;
}

.action-sheet-title--material:first-child {
  border-radius: 0;
}

.action-sheet-button--material {
  @apply(--material-font);
  border-radius: 0;
  background-image: none;
  height: 52px;
  line-height: 52px;
  text-align: left;
  font-size: 16px;
  padding: 0 0 0 16px;
  color: var(--material-action-sheet-text-color);
  font-weight: 400;
  background-color: white;
}

.action-sheet-button--material:first-child {
  border-radius: 0;
}

.action-sheet-button--material:nth-last-of-type(2) {
  border-radius: 0;
}

.action-sheet-button--material:last-of-type {
  margin: 0;
  border-radius: 0;
  font-weight: 400;
  background-color: white;
}

.action-sheet-icon--material {
  display: inline-block;
  float: left;
  height: 52px;
  line-height: 52px;
  margin-right: 32px;
  font-size: 26px;
  width: 0.8em;
  text-align: center;
}

.action-sheet-mask--material {
  background-color: var(--material-action-sheet-mask-color);
}
