/* Berghut: quiet cart controls and a focused checkout. */
/* Keep the order summary in view beside the form, including large carts. */
@media (min-width: 992px) {
  body#checkout .l-main { overflow: visible; }
  .berghut-checkout-summary {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}
body#checkout .berghut-account-login {
  border: 0; border-radius: 0; padding: 0; margin: 0 0 18px;
}
body#checkout .berghut-account-login .offer-login { gap: 4px 8px; }
body#checkout .berghut-account-login .berghut-checkout-note { flex-basis: 100%; margin: 0; }
body#checkout .berghut-account-login .already-account-label { flex-basis: auto; }
body#checkout .berghut-account-login .classic-login { margin: 0; }
body#checkout .checkout-block .inner-area .berghut-account-login .offer-login a.log-in {
  padding: 0; border-radius: 0; font-size: 14px;
}
/* Remove the field-entry flash and glow; keep a quiet visible focus cue. */
body#checkout .checkout-block .effects-helper::after {
  content: none; animation: none !important; box-shadow: none !important;
}
body#checkout .checkout-block .form-control:focus {
  box-shadow: none; background-color: #fff;
}
body#checkout .checkout-block .form-control:focus:not(.-error) {
  border-color: #5F9F5F;
}
body#checkout .checkout-block .form-control:focus-visible {
  outline: none;
}

.shoppingcart .berghut-cart-remove,
.shoppingcart .berghut-cart-remove:hover,
.shoppingcart .berghut-cart-remove:focus { color: #000; }
.berghut-promo-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 0;
  border: 0; background: transparent; color: #454b46;
  font: inherit; font-size: 14px; font-weight: 400; cursor: pointer; text-align: left;
}
.berghut-promo-toggle .material-icons { font-size: 18px; transition: transform .15s; }
.berghut-promo-toggle[aria-expanded="true"] .material-icons { transform: rotate(180deg); }
.berghut-promo-toggle:focus-visible { outline: 2px solid #477d47; outline-offset: 4px; }
.berghut-checkout-header { background: #fff; border-bottom: 1px solid #e3e8e1; }
.berghut-checkout-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 12px; padding-bottom: 12px; }
.berghut-checkout-logo img { display: block; width: 160px; height: 58px; object-fit: contain; }
.berghut-back-to-cart { color: #454b46; font-size: 14px; }
.berghut-checkout-intro { margin: 24px 0; }
.berghut-checkout-intro h1 { font-size: 40px; color: #416f41; margin-bottom: 24px; line-height: 1.2; }
.berghut-step-number { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: #edf3eb; color: #416f41; font: 600 22px/1 Montserrat, sans-serif; }
body#checkout .checkout-block { scroll-margin-top: 24px; }
body#checkout .checkout-block .block-header { display: flex; align-items: center; gap: 10px; font-family: Montserrat, sans-serif; font-size: 32px !important; font-weight: 600; color: #252b26; padding: 0; margin: 0 0 20px; line-height: 1.2; }
body#checkout .checkout-block .inner-area { padding: 24px; border: 1px solid #e3e8e1; border-radius: 8px; }
body#checkout .berghut-checkout-note { font-size: 14px; color: #000; line-height: 1.6; margin: 0 0 18px; }
body#checkout #thecheckout-login-form .inner-area { border: 0; padding: 12px 24px; }
body#checkout .offer-login { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: flex-start; gap: 4px 8px; font-size: 14px; text-align: left; }
body#checkout .offer-login .log-in { font-size: 14px; color: #416f41; text-decoration: underline; }
body#checkout .offer-login .social-login { flex-basis: 100%; }
body#checkout #create_account { margin-top: 12px; }
body#checkout #create_account label,
body#checkout #thecheckout-newsletter label { font-size: 14px; font-weight: 400; line-height: 1.6; }
body#checkout #thecheckout-newsletter .inner-area { border: 0; padding: 8px 24px; }
body#checkout #thecheckout-newsletter em { font-size: 12px; font-style: normal; color: #000; }
body#checkout .checkout-block .field-label,
body#checkout .checkout-block .orig-field { font-size: 16px !important; }
body#checkout .checkout-block .field-label { color: #000; opacity: 1; }
body#checkout #confirm_order.btn { clip-path: none !important; width: 100% !important; padding: 14px 18px !important; border-radius: 6px !important; font-size: 16px; white-space: normal; }
@media (max-width: 575px) {
  .berghut-checkout-logo img { width: 120px; height: 44px; }
  .berghut-back-to-cart { font-size: 12px; }
  .berghut-checkout-intro h1 { font-size: 32px; }
  body#checkout .checkout-block .inner-area { padding: 20px 16px; }
  body#checkout .checkout-block .block-header { font-size: 28px !important; }
  body#checkout .berghut-step-number { width: 32px; height: 32px; font-size: 20px; }
}

body#checkout .berghut-checkout-intro,
body#checkout #tc-container,
body#checkout #tc-container-mobile { max-width: 1320px; margin-left: auto; margin-right: auto; }
body#checkout .offer-login .classic-login { margin-top: 0; }
body#checkout .cart-voucher .promo-code-button { color: #000; font-size: 14px; font-weight: 400; }

/* Desktop: a single form column with an independent order summary. */
.berghut-checkout-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  align-items: start;
  gap: 28px;
}
.berghut-checkout-main,
.berghut-checkout-summary { min-width: 0; }
body#checkout .berghut-checkout-columns .checkout-block { padding-left: 0; padding-right: 0; }
@media (max-width: 991px) {
  .berghut-checkout-columns { display: block; }
  /* The module moves the existing blocks into its mobile container. */
  body#checkout #tc-container-mobile #thecheckout-cart-summary { order: 90; }
  body#checkout #tc-container-mobile #thecheckout-confirm { order: 100; }
}

body#checkout .berghut-checkout-intro h1,
body#checkout .checkout-block .block-header {
  font-family: MarkerFelt !important;
  color: #5F9F5F !important;
}
body#checkout .berghut-account-newsletter { margin-top: 8px; }
body#checkout #create_account { margin-bottom: 8px; }

@media (min-width: 992px) {
  body#checkout .berghut-checkout-intro h1 { font-size: 44px; }
  body#checkout .checkout-block .block-header { font-size: 36px !important; gap: 12px; }
  body#checkout .berghut-step-number { width: 40px; height: 40px; font-size: 24px; }
}
body#checkout .checkout-block,
body#checkout .checkout-block .form-control,
body#checkout .checkout-block .orig-field,
body#checkout .checkout-block .already-account-label,
body#checkout .checkout-block .custom-checkbox label { color: #000; }
body#checkout .checkout-block input[type="radio"] { accent-color: #5F9F5F; }
body#checkout .checkout-block .custom-radio input[type="radio"]:checked + span { background-color: #5F9F5F; }
body#checkout .checkout-block .custom-radio:has(input:checked) { border-color: #5F9F5F; }
/* Login and guest checkout share one place without duplicate email fields. */
#thecheckout-account:has(.berghut-account-login .offer-login.expanded) .berghut-guest-fields,
#thecheckout-account .offer-login.expanded .berghut-checkout-note { display: none; }
body#checkout .berghut-account-login #login-form { max-width: none; margin: 0; padding: 0; }
.berghut-guest-return { margin-top: 16px; text-align: center; }
.berghut-continue-guest {
  border: 0; padding: 4px 0; background: none; color: #416f41;
  font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}
.berghut-continue-guest:focus-visible { outline: 2px solid #416f41; outline-offset: 3px; }

/* Compact login actions aligned with the form fields. */
body#checkout .berghut-account-login:has(.offer-login.expanded) { margin-bottom: 0; }
body#checkout .berghut-account-login #login-form .form-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  margin: 20px 0 0; padding: 0; text-align: left !important;
}
body#checkout .berghut-account-login #login-form .form-footer::after { content: none; }
body#checkout .berghut-account-login #login-form .forgot-password {
  margin: 0; text-align: left; font-size: 14px;
}
body#checkout .berghut-account-login #login-form .forgot-password a {
  color: #416f41; text-decoration: underline;
}
body#checkout .berghut-account-login #login-form .berghut-guest-return { margin: 0; text-align: left; }
body#checkout .berghut-account-login #login-form .form-footer .btn { margin: 0; }
body#checkout .checkout-block input.form-control:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
}
/* A small, keyboard-accessible explanation beside the telephone field. */
body#checkout .checkout-block .form-group.phone,
body#checkout .checkout-block .form-group.phone_mobile { position: relative; }
body#checkout .checkout-block .form-group.phone input,
body#checkout .checkout-block .form-group.phone_mobile input { padding-right: 44px; }
.berghut-phone-info { position: absolute; right: 8px; top: 4px; z-index: 3; }
.berghut-phone-info-toggle {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  padding: 0; border: 0; border-radius: 4px; background: transparent; color: #000; cursor: pointer;
}
.berghut-phone-info-toggle:hover,
.berghut-phone-info-toggle[aria-expanded="true"] { background: #edf3eb; }
.berghut-phone-info-toggle:focus-visible { outline: 2px solid #416f41; outline-offset: 2px; }
.berghut-phone-info-text {
  position: absolute; right: 0; top: 44px; width: 250px; max-width: calc(100vw - 64px);
  padding: 12px 16px; border-radius: 6px; background: #111; color: #fff;
  font-size: 14px; line-height: 1.5; box-shadow: 0 4px 14px #0002;
}
.berghut-phone-info-text::before {
  content: ''; position: absolute; right: 12px; top: -6px;
  width: 12px; height: 12px; background: #111; transform: rotate(45deg);
}
.berghut-phone-info-text[hidden] { display: none; }

/* Fixed labels and a consistent field outline in every input state. */
body#checkout .checkout-block .berghut-fixed-label { margin: 0; }
body#checkout .checkout-block .berghut-fixed-label > .field-label {
  display: block; position: static; padding: 0; margin: 0 0 8px;
  font-size: 14px !important; font-weight: 500; line-height: 1.5;
  color: #000; opacity: 1; transform: none; transition: none;
}
body#checkout .checkout-block .berghut-fixed-label > .form-control {
  display: block; width: 100%; height: 48px; min-height: 48px;
  margin: 0; padding: 11px 12px; border: 1px solid #959d95; border-radius: 5px;
  color: #000; background-color: #fff; line-height: 24px;
  box-shadow: none; outline: none; transition: none;
}
body#checkout .checkout-block .berghut-fixed-label > select.form-control {
  padding-right: 36px; background-position: right 14px center; background-size: 9px 14px;
}
body#checkout .checkout-block .berghut-fixed-label > .form-control:focus {
  border-color: #416f41; box-shadow: inset 0 0 0 1px #416f41;
}
body#checkout .checkout-block .berghut-fixed-label > .form-control.-error {
  border-color: #b42318;
}
body#checkout .checkout-block .berghut-fixed-label > .form-control.-error:focus {
  box-shadow: inset 0 0 0 1px #b42318;
}
body#checkout .checkout-block .berghut-fixed-label > .field.error-msg,
body#checkout .checkout-block .berghut-fixed-label > .field.notice-msg {
  margin: 6px 0 0; padding: 0; background: transparent;
  font-size: 13px; font-weight: 400; font-style: normal; line-height: 1.5;
  color: #b42318;
}
body#checkout .checkout-block .berghut-fixed-label > .field.notice-msg { color: #416f41; }
body#checkout .checkout-block .berghut-fixed-label[data-missing-street-nr-notice]::after {
  margin-top: 6px; text-align: left; font-size: 13px; color: #b42318;
}
body#checkout .checkout-block .berghut-fixed-label:has(input:placeholder-shown)::after { display: none; }
body#checkout .checkout-block .berghut-fixed-label [data-link-action="toggle-password-visibility"] {
  top: 40px; right: 12px; margin: 0;
}
body#checkout .checkout-block .berghut-fixed-label input[type="password"],
body#checkout .checkout-block .berghut-fixed-label input:has(~ [data-link-action="toggle-password-visibility"]) { padding-right: 48px; }
body#checkout .checkout-block .berghut-fixed-label .country-call-prefix {
  display: flex; top: 30px; margin-top: 0; height: 46px; border-radius: 5px 0 0 5px;
}
body#checkout .checkout-block .has-call-prefix .berghut-fixed-label input { padding-left: 64px; }
body#checkout .berghut-phone-info { top: 35px; right: 12px; }
body#checkout .checkout-block .berghut-fixed-label input[name="phone"],
body#checkout .checkout-block .berghut-fixed-label input[name="phone_mobile"] { padding-right: 48px; }
body#checkout .checkout-block .form-group:has(> .berghut-fixed-label) { margin-bottom: 20px; padding-top: 0; }

/* Keep paired fields apart; postcode precedes municipality in the DOM. */
body#checkout .address-fields > .form-fields { column-gap: 16px; }
@media (min-width: 576px) {
  body#checkout .address-fields > .form-fields > .form-group.firstname,
  body#checkout .address-fields > .form-fields > .form-group.lastname { flex-basis: calc(50% - 8px) !important; }
  body#checkout .address-fields > .form-fields > .form-group.postcode { flex-basis: calc(32% - 8px) !important; }
  body#checkout .address-fields > .form-fields > .form-group.city { flex-basis: calc(68% - 8px) !important; }
}
body#checkout .berghut-checkout-reassurance {
  list-style: none; display: grid; gap: 12px; margin: 20px 0 0; padding: 18px 0 0;
  border-top: 1px solid #e3e8e1; font-size: 14px; line-height: 1.5; color: #000;
}
body#checkout .berghut-checkout-reassurance li { display: flex; align-items: center; gap: 10px; }
body#checkout .berghut-checkout-reassurance svg { flex: 0 0 20px; color: #416f41; }
body#checkout #tc-payment-confirmation > .error-msg {
  font-style: normal; font-size: 14px; line-height: 1.5; color: #b42318; border-radius: 5px; padding: 12px;
}

/* Tax information is secondary to the total amount. */
body#checkout #thecheckout-cart-summary .cart-total .tax-lbl {
  font-size: 13px; font-weight: 400; white-space: nowrap; margin-left: 4px; color: #000;
}

/* A clear total, without competing with the main action. */
body#checkout #thecheckout-cart-summary .cart-total,
body#checkout #thecheckout-cart-summary .cart-total > .label,
body#checkout #thecheckout-cart-summary .cart-total > .value {
  font-size: 18px; font-weight: 600; line-height: 1.5;
}
body#checkout .checkout-block input[type="checkbox"] { accent-color: #5F9F5F; }
body#checkout #conditions-to-approve li { display: flex; align-items: flex-start; gap: 10px; }
body#checkout #conditions-to-approve .condition-label { margin: 0; }
body#checkout #conditions-to-approve input[type="checkbox"] { position: static; opacity: 1; width: 18px; height: 18px; margin: 3px 0 0; }
body#checkout .berghut-order-note summary { cursor: pointer; font-size: 14px; color: #000; }
body#checkout .berghut-order-note summary:focus-visible { outline: 2px solid #416f41; outline-offset: 4px; }
body#checkout .berghut-order-note label { display: block; margin: 16px 0 8px; font-size: 14px; }
body#checkout .berghut-order-note textarea { width: 100%; min-height: 80px; border: 1px solid #959d95; border-radius: 5px; padding: 12px; font-size: 16px; }
body#checkout .berghut-order-note textarea:focus { outline: 2px solid #416f41; outline-offset: -2px; }

/* A compact, read-only order overview above the mobile form. */
.berghut-mobile-summary { display: none; }
@media (max-width: 991px) {
  body#checkout .berghut-mobile-summary:not([hidden]) { display: block; margin: 0 4px 20px; border: 1px solid #e3e8e1; border-radius: 8px; background: #f7faf5; color: #000; font-size: 14px; }
  .berghut-mobile-summary > summary { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 14px 16px; cursor: pointer; list-style: none; }
  .berghut-mobile-summary > summary::-webkit-details-marker { display: none; }
  .berghut-mobile-summary > summary:focus-visible { outline: 2px solid #416f41; outline-offset: 2px; border-radius: 8px; }
  .berghut-mobile-total { margin-left: auto; font-weight: 600; white-space: nowrap; }
  .berghut-mobile-summary summary svg { flex-shrink: 0; color: #416f41; }
  .berghut-mobile-summary[open] summary svg { transform: rotate(180deg); }
  .berghut-mobile-summary-content { padding: 0 16px 16px; }
  .berghut-mobile-summary-content ul { list-style: none; padding: 12px 0; margin: 0; border-top: 1px solid #e3e8e1; }
  .berghut-mobile-summary-content li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 5px 0; }
  .berghut-mobile-summary-content li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
  .berghut-mobile-summary-content li > span:last-child { flex-shrink: 0; white-space: nowrap; }
  .berghut-mobile-summary-content small { display: block; font-size: 12px; }
  .berghut-mobile-summary-content .berghut-compact-total { font-weight: 600; }
}

/* Explain a canceled/failed attempt without making customers re-enter their details. */
body#checkout .berghut-payment-return { color: #111; line-height: 1.5; }
body#checkout .berghut-payment-return p { margin: 6px 0 10px; }
body#checkout .berghut-payment-return a { color: #386c38; text-decoration: underline; font-weight: 600; }
body#checkout #thecheckout-payment { scroll-margin-top: 24px; }

/* Keep signed-in customer details readable, including inside the profile link. */
body#checkout #static-customer-info-container .customer-name,
body#checkout #static-customer-info-container .customer-email { color: #000; }
