* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
}

body {
  overflow: hidden;
  background: #f4f4f4;
  color: #000;
  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
a {
  font: inherit;
  color: inherit;
  border: 0;
  outline: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  background: #f4f4f4;
}

.main-area {
  width: 100%;
  height: calc(100dvh - 190px);
  min-height: 0;
  padding: 24px;
  overflow: auto;
}

.payment-card {
  width: 620px;
  height: 408px;
  margin: 0 auto;
  padding: 52px 32px;
  border-radius: 24px;
  background: #f4f4f4;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .10);
}

.content {
  width: 428px;
  margin: 0 auto;
}

.merchant-row {
  height: 48px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.merchant-name {
  max-width: 235px;
  color: #000;
  font-family: "Lato", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  text-align: left;
}

.merchant-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.merchant-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selector {
  position: relative;
  width: 100%;
  height: 32px;
  margin-top: 16px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 12px;
  background: transparent;
}

.selector-item {
  flex: 1;
  height: 100%;
  padding: 4px 32px;
  background: transparent;
  color: #000;
  text-align: center;
  font-family: "Lato", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  cursor: default;
}

.selector-item.active {
  border-radius: 12px;
  background: #000;
  color: #fff;
}

.amount-wrapper {
  margin-top: 24px;
  text-align: center;
}

.amount-details {
  height: 24px;
  color: #626263;
  font-family: "Lato", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
}

.amount {
  height: 48px;
  margin-top: 8px;
  color: #000;
  font-family: "Lato", system-ui, sans-serif;
  font-size: 40px;
  font-weight: 900;
  line-height: 48px;
  text-align: center;
  letter-spacing: -1px;
}

.calculator {
  width: 100%;
  height: 56px;
  margin-top: 40px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 100px;
  background: #f5f5f5;
  touch-action: manipulation;
}

.calculator-btn {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  transition: transform .15s ease;
}

.calculator-btn:disabled {
  background: #ccc;
  cursor: default;
}

.calculator-btn::before,
.calculator-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.calculator-btn.plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.calculator-btn.minus::after {
  display: none;
}

.calculator-btn:not(:disabled):active {
  transform: scale(.9);
}

.calculator-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.calculator-quantity {
  color: #000;
  font-family: "Lato", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

.calculator-description {
  color: #626263;
  font-family: "Lato", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -.021px;
  text-transform: lowercase;
}


/* Fixed lower panel, matching the original desktop geometry. */
.payment-panel {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 0;
  height: 190px;
  padding: 16px 24px;
  background: #fff;
}

.payment-block {
  width: 428px;
  max-width: 100%;
  margin: 0 auto;
}

.pay-button {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.pay-button + .pay-button {
  margin-top: 8px;
}

.mono-button {
  gap: 9px;
}

.mono-word {
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.3px;
}

.mono-chip {
  min-width: 54px;
  height: 30px;
  padding: 1px 8px 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #fff;
  color: #000;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.gpay-button {
  gap: 12px;
}

.gpay-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.google-g {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  background: conic-gradient(
    from -28deg,
    #4285f4 0 24%,
    #34a853 24% 45%,
    #fbbc05 45% 66%,
    #ea4335 66% 84%,
    #4285f4 84% 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gpay-text {
  color: #fff;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.payment-divider {
  width: 1px;
  height: 29px;
  background: rgba(255, 255, 255, .45);
}

.mastercard-box {
  position: relative;
  width: 46px;
  height: 29px;
  flex: 0 0 46px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 3px;
}

.mc-red,
.mc-orange {
  position: absolute;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.mc-red {
  left: 10px;
  background: #eb001b;
}

.mc-orange {
  left: 20px;
  background: #f79e1b;
}

.card-tail {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}

.manual-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 20px auto 0;
  color: #6638dd;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  cursor: pointer;
}

.pay-button:hover {
  filter: contrast(.8) brightness(1.1);
}

.manual-link:hover {
  text-decoration: underline;
}


/* Original mobile behaviour: card shadow and white card disappear. */
@media (max-width: 799px) {
  body {
    overflow: auto;
  }

  .page {
    min-height: 100dvh;
  }

  .main-area {
    height: auto;
    min-height: calc(100dvh - 190px);
    padding: 24px;
    padding-bottom: 80px;
    overflow: visible;
  }

  .payment-card {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .content {
    width: 100%;
  }

  .payment-panel {
    height: 190px;
    padding: 16px 24px;
  }

  .payment-block {
    width: 100%;
    max-width: 428px;
  }
}

@media (max-width: 390px) {
  .gpay-button {
    gap: 8px;
  }

  .google-g {
    font-size: 20px;
  }

  .gpay-text,
  .card-tail {
    font-size: 18px;
  }

  .mastercard-box {
    width: 42px;
    flex-basis: 42px;
  }
}
