/**
 * Shopify-like one-page checkout for KindleStore
 */

body:has(.ks-sf),
body.ks-sf-page {
  background: #fff !important;
}

body:has(.ks-sf) .ks-header,
body:has(.ks-sf) .ks-trustbar,
body:has(.ks-sf) .ks-footer,
body:has(.ks-sf) footer.ks-footer,
body:has(.ks-sf) #menu,
body:has(.ks-sf) nav.navbar,
body:has(.ks-sf) nav.ks-catalog,
body:has(.ks-sf) #column-left,
body:has(.ks-sf) #column-right,
body.ks-sf-page .ks-header,
body.ks-sf-page .ks-trustbar,
body.ks-sf-page .ks-footer,
body.ks-sf-page footer.ks-footer,
body.ks-sf-page nav.ks-catalog,
body.ks-sf-page #column-left,
body.ks-sf-page #column-right {
  display: none !important;
}

body:has(.ks-sf) #container,
body.ks-sf-page #container {
  min-height: 100vh;
  background: #fff;
}

body:has(.ks-sf) #alert,
body.ks-sf-page #alert {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(520px, calc(100% - 24px));
}

.ks-sf {
  font-family: var(--ks-font, "Manrope", system-ui, sans-serif);
  color: #1a1a1a;
}

.ks-sf__frame {
  display: grid;
  min-height: 100vh;
}

@media (min-width: 1000px) {
  .ks-sf__frame {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 42%);
  }
}

.ks-sf__main {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

@media (min-width: 1000px) {
  .ks-sf__main {
    padding: 40px 56px 64px;
    margin-right: 0;
    margin-left: auto;
  }
}

.ks-sf__brand {
  margin-bottom: 28px;
}

.ks-sf__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #16181c;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.ks-sf__logo span span {
  color: #0f5f52;
  font-weight: 600;
}

.ks-sf__crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #707070;
}

.ks-sf__crumb a {
  color: #0f5f52;
  text-decoration: none;
}

.ks-sf__crumb a:hover {
  text-decoration: underline;
}

.ks-sf__crumb .is-current {
  color: #1a1a1a;
  font-weight: 600;
}

.ks-sf__summary-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-block: 1px solid #e6e6e6;
  background: #f5f5f5;
  padding: 14px 16px;
  margin: 0 -20px 20px;
  width: calc(100% + 40px);
  font-family: inherit;
  font-size: 14px;
  color: #0f5f52;
  cursor: pointer;
}

.ks-sf__summary-toggle strong {
  color: #1a1a1a;
  font-size: 16px;
}

@media (min-width: 1000px) {
  .ks-sf__summary-toggle,
  .ks-sf__mobile-summary {
    display: none !important;
  }
}

.ks-sf__mobile-summary {
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ebebeb;
}

.ks-sf__section {
  margin-bottom: 28px;
}

.ks-sf__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ks-sf__section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1a1a1a;
}

/* OpenCart form restyle */
.ks-sf #form-register > fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.ks-sf #form-register legend {
  float: none;
  width: auto;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 0;
  color: #1a1a1a;
}

.ks-sf #form-register .row,
.ks-sf #form-register .row-cols-1,
.ks-sf #form-register .row-cols-md-2 {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

.ks-sf .form-label {
  font-size: 12px;
  font-weight: 500;
  color: #545454;
  margin-bottom: 6px;
}

.ks-sf .form-control,
.ks-sf .form-select,
.ks-sf #input-comment {
  min-height: 48px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  box-shadow: none !important;
  font-size: 14px;
  color: #1a1a1a;
  padding: 10px 12px;
}

.ks-sf .form-control:focus,
.ks-sf .form-select:focus,
.ks-sf #input-comment:focus {
  border-color: #0f5f52;
  outline: 0;
  box-shadow: 0 0 0 1px #0f5f52 !important;
}

.ks-sf #button-register,
.ks-sf #password,
.ks-sf #register-agree,
.ks-sf .form-check:has(#input-newsletter),
.ks-sf .form-check:has(#input-checkout-agree),
.ks-sf label[for="input-checkout-agree"] {
  display: none !important;
}

.ks-sf #input-payment-company,
.ks-sf #input-shipping-company,
.ks-sf #input-payment-address-2,
.ks-sf #input-shipping-address-2,
.ks-sf label[for="input-payment-company"],
.ks-sf label[for="input-shipping-company"],
.ks-sf label[for="input-payment-address-2"],
.ks-sf label[for="input-shipping-address-2"] {
  display: none !important;
}

.ks-sf .ks-method-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.ks-sf__methods {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ks-sf__method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin: 0;
  border-bottom: 1px solid #d9d9d9;
  cursor: pointer;
  background: #fff;
}

.ks-sf__method:last-child {
  border-bottom: 0;
}

.ks-sf__method.is-active {
  background: #f3faf7;
  box-shadow: inset 0 0 0 2px #0f5f52;
  position: relative;
  z-index: 1;
}

.ks-sf__method-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ks-sf__method input {
  margin-top: 3px;
  accent-color: #0f5f52;
}

.ks-sf__method-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ks-sf__method-text strong {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.ks-sf__method-text em {
  font-style: normal;
  font-size: 12px;
  color: #707070;
}

.ks-sf__method-price {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
}

.ks-sf #input-comment {
  min-height: 84px;
  resize: vertical;
}

.ks-sf .form-check-reverse {
  padding-left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px !important;
}

.ks-sf .form-switch .form-check-input {
  width: 2.4em;
  height: 1.3em;
  margin: 0;
}

.ks-sf__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
}

.ks-sf__back {
  color: #0f5f52;
  text-decoration: none;
  font-size: 14px;
}

.ks-sf__back:hover {
  text-decoration: underline;
  color: #0a4438;
}

.ks-sf__pay {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #0f5f52;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 52px;
  padding: 0 22px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease;
}

@media (min-width: 640px) {
  .ks-sf__pay {
    width: auto;
    min-width: 240px;
  }
}

.ks-sf__pay:hover,
.ks-sf__pay:focus {
  background: #0a4438;
  color: #fff;
}

.ks-sf__pay:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ks-sf__secure {
  margin: 18px 0 0;
  font-size: 12px;
  color: #8a8a8a;
  text-align: center;
}

@media (min-width: 640px) {
  .ks-sf__secure {
    text-align: right;
  }
}

/* Right summary — Shopify gray panel */
.ks-sf__summary {
  background: #f5f5f5;
  border-left: 1px solid #e6e6e6;
  display: none;
}

@media (min-width: 1000px) {
  .ks-sf__summary {
    display: block;
  }
}

.ks-sf__summary-inner {
  position: sticky;
  top: 0;
  padding: 40px 40px 48px 32px;
  max-width: 480px;
}

.ks-sf__line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.ks-sf__thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  overflow: hidden;
}

.ks-sf__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ks-sf__qty {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(114, 114, 114, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ks-sf__line-body {
  min-width: 0;
}

.ks-sf__line-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  line-height: 1.35;
}

.ks-sf__line-name:hover {
  color: #0f5f52;
}

.ks-sf__line-meta {
  font-size: 12px;
  color: #707070;
  margin-top: 2px;
}

.ks-sf__line-price {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
}

.ks-sf__line-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ks-sf__qty-form .ks-cart-item__qty {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.ks-sf__qty-form button {
  width: 28px;
  height: 30px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #545454;
  line-height: 1;
}

.ks-sf__qty-form input {
  width: 34px;
  border: 0;
  text-align: center;
  font-size: 13px;
  background: transparent;
  outline: none;
}

.ks-sf__line-remove {
  font-size: 12px;
  color: #707070;
  text-decoration: none;
}

.ks-sf__line-remove:hover {
  color: #b4552f;
}

.ks-sf__totals {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e6e6e6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ks-sf__total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: #545454;
}

.ks-sf__total-row span:last-child {
  color: #1a1a1a;
}

.ks-sf__total-row.is-pay {
  align-items: baseline;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #e6e6e6;
}

.ks-sf__total-row.is-pay span:first-child {
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 500;
}

.ks-sf__total-row.is-pay span:last-child {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ks-sf #checkout-confirm .table-responsive,
.ks-sf #checkout-confirm table,
.ks-sf #checkout-payment .btn,
.ks-sf #checkout-payment button {
  display: none !important;
}

.ks-sf-empty,
.ks-checkout-empty {
  max-width: 420px;
  margin: 80px auto;
  text-align: center;
  padding: 0 20px;
}

.ks-sf__empty-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 20px;
}

.ks-sf__empty-wrap .ks-sf__logo {
  margin-bottom: 32px;
}

.ks-checkout-empty h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ks-checkout-empty .btn {
  margin-top: 18px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  background: #0f5f52;
  border: 0;
  color: #fff;
  font-weight: 600;
}

.ks-checkout-empty .btn:hover {
  background: #0a4438;
  color: #fff;
}

.ks-sf .alert {
  border-radius: 8px;
  font-size: 14px;
}

/* Hide duplicate outer section title when register already has Contact legend */
.ks-sf #ks-section-contacts > .ks-sf__section-head {
  display: none;
}
