/*
 * Copyright Magmodules.eu. All rights reserved.
 * See COPYING.txt for license details.
 */

.apple-pay-button {
  display: inline-block;
  cursor: pointer;
  -webkit-appearance: -apple-pay-button;
  &:extend(.abs-button-l all);
  box-sizing: border-box;
  font-size: 0 !important;

  > * {
    visibility: hidden;
  }
}

.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
  .mollie-product-page-apple-pay-button {
      margin-bottom: 0;
      margin-right: 1%;
      width: 49%;
  }
}

& when (@media-common = true) {
  .apple-pay-button {
    &:extend(.abs-button-responsive all);
  }
}

@supports (-webkit-appearance: -apple-pay-button) {
    .apple-pay-button-with-text {
        display: inline-block;
        cursor: pointer;
        -webkit-appearance: -apple-pay-button;
        -apple-pay-button-type: buy;
    }
    .apple-pay-button-with-text > * {
        visibility: hidden;
    }
    .apple-pay-button-black-with-text {
        -apple-pay-button-style: black;
    }
    .apple-pay-button-white-with-text {
        -apple-pay-button-style: white;
        cursor: pointer;
    }
    .apple-pay-button-white-with-line-with-text {
        -apple-pay-button-style: white-outline;
    }

    .apple-pay-button-color-black { -apple-pay-button-style: black; }
    .apple-pay-button-color-white { -apple-pay-button-style: white; }
    .apple-pay-button-color-white-outline { -apple-pay-button-style: white-outline; }
    .apple-pay-button-text-buy { -apple-pay-button-type: buy; }
    .apple-pay-button-text-donate { -apple-pay-button-type: donate; }
    .apple-pay-button-text-plain { -apple-pay-button-type: plain; }
    .apple-pay-button-text-book { -apple-pay-button-type: book; }
    .apple-pay-button-text-check-out { -apple-pay-button-type: check-out; }
    .apple-pay-button-text-subscribe { -apple-pay-button-type: subscribe; }
    .apple-pay-button-text-add-money { -apple-pay-button-type: add-money; }
    .apple-pay-button-text-contribute { -apple-pay-button-type: contribute; }
    .apple-pay-button-text-order { -apple-pay-button-type: order; }
    .apple-pay-button-text-reload { -apple-pay-button-type: reload; }
    .apple-pay-button-text-rent { -apple-pay-button-type: rent; }
    .apple-pay-button-text-support { -apple-pay-button-type: support; }
    .apple-pay-button-text-tip { -apple-pay-button-type: tip; }
    .apple-pay-button-text-top-up { -apple-pay-button-type: top-up; }

    .mollie-applepay-minicart-button {
        width: 100%;
        height: 52px;
        margin-top: 5px;
    }
}

@supports not (-webkit-appearance: -apple-pay-button) {
    .apple-pay-button-with-text {
        display: inline-flex;
        justify-content: center;
        font-size: 12px;
        border-radius: 5px;
        padding: 0px;
        box-sizing: border-box;
        min-width: 200px;
        min-height: 32px;
        max-height: 64px;
    }
    .apple-pay-button-black-with-text {
        background-color: black;
        color: white;
    }
    .apple-pay-button-white-with-text {
        background-color: white;
        color: black;
    }
    .apple-pay-button-white-with-line-with-text {
        background-color: white;
        color: black;
        border: .5px solid black;
    }
    .apple-pay-button-with-text.apple-pay-button-black-with-text > .logo {
        background-image: -webkit-named-image(apple-pay-logo-white);
        background-color: black;
    }
    .apple-pay-button-with-text.apple-pay-button-white-with-text > .logo {
        background-image: -webkit-named-image(apple-pay-logo-black);
        background-color: white;
    }
    .apple-pay-button-with-text.apple-pay-button-white-with-line-with-text > .logo {
        background-image: -webkit-named-image(apple-pay-logo-black);
        background-color: white;
    }
    .apple-pay-button-with-text > .text {
        font-family: -apple-system;
        font-size: 1em;
        font-weight: 300;
        align-self: center;
        margin-right: 2px;
    }
    .apple-pay-button-with-text > .logo {
        width: 35px;
        height: 100%;
        background-size: 100% 60%;
        background-repeat: no-repeat;
        background-position: 0 50%;
        margin-left: 2px;
        border: none;
    }
}

.mollie-applepay-button-hidden {
    display: none;
}
