/*!
Theme Name: mh
Theme URI: http://underscores.me/
Author: Underscores.me
Author URI: http://underscores.me/
Description: Description
Version: 1.0.0
Tested up to: 5.4
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: mh
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

*/

.header--sticky {
    top: var(--wp-admin--admin-bar--height, 0px) !important;
}

.partnership__form form {
    display: flex;
    flex-direction: column;
    row-gap: 24px;
}

.wpcf7 {
    position: relative;
}

.wpcf7-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
}

.wpcf7 input[type=submit] {
    border: none;
    cursor: pointer;
    line-height: 0;
}

.wpcf7-not-valid-tip {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    padding: 6px 10px;
    background-color: #B3261E;
    color: var(--white);
    font-size: 12px;
    line-height: 1.3;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.wpcf7-not-valid-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 12px;
    border: 5px solid transparent;
    border-top-color: #B3261E;
}

.wpcf7-response-output {
    margin: 16px 0 0;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid transparent;
    color: var(--color-text);
    background-color: var(--cream);
}

/* Успешная отправка */
.wpcf7-mail-sent-ok .wpcf7-response-output {
    background-color: var(--cream);
    border-color: var(--gold);
    color: var(--charcoal);
}

/* Ошибка валидации / отправки */
.wpcf7-validation-errors .wpcf7-response-output,
.wpcf7-mail-sent-ng .wpcf7-response-output,
.wpcf7-spam-blocked .wpcf7-response-output,
.wpcf7-aborted .wpcf7-response-output {
    background-color: #FBEAEA;
    border-color: #B3261E;
    color: #7A1E18;
}

.wpcf7 .wpcf7-not-valid {
    border-color: #D64545;
    background-color: #FDECEC;
}
.wpcf7 .wpcf7-not-valid:focus {
    border-color: #D64545;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}

.wpcf7 .wpcf7-not-valid {
    border-color: #B3261E;
    background-color: #FBEAEA;
}

.wpcf7 .wpcf7-not-valid:focus {
    border-color: #B3261E;
    box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
}

.header__action-counter[hidden] {
    display: none !important;
}

/* AJAX filtering (catalog + Our Works, #shopResults; see catalog.js setShopLoading).
   Only the cards are dimmed — the spinner stays fully visible, near the top of
   the results so it is on screen even when the grid is taller than the viewport. */
#shopResults {
    position: relative;
}

#shopResults.is-loading {
    pointer-events: none;
    min-height: 300px;
}

#shopResults.is-loading > * {
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

#shopResults.is-loading::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: min(50%, 160px);
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--gold);
    border-top-color: transparent;
    border-radius: 50%;
    animation: mh-spin 0.8s linear infinite;
}

/* Top-of-screen progress bar while a filter request is running */
html.is-filtering body::before {
    content: '';
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 40%;
    height: 3px;
    background-color: var(--gold);
    animation: mh-progress 1s ease-in-out infinite;
}

@keyframes mh-progress {
    from { transform: translateX(-100%); }
    to   { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
    html.is-filtering body::before {
        width: 100%;
        animation: none;
        opacity: 0.6;
    }

    #shopResults.is-loading::after {
        animation-duration: 2s;
    }
}


#shopResults {
    scroll-margin-top: 100px;
}

@keyframes mh-spin {
    to { transform: rotate(360deg); }
}
/* ==========================================================================
   WooCommerce: cart, checkout, notices, thank you page.
   Theme additions on top of the compiled layout (assets/css/style.css is
   generated from the layout sources and must not be edited). Loaded after it.
   ========================================================================== */

/* ─── Cart: theme additions (not in the static layout) ─── */
.cart-item.is-updating {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

.order-summary__row--coupon .order-summary__label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-summary__coupon-code {
  font-size: 0.8571428571rem;
  letter-spacing: 0.04em;
}

.order-summary__coupon-remove {
  display: inline-flex;
  stroke: currentColor;
  opacity: 0.7;
  transition: opacity 0.2s, stroke 0.2s;
}

.order-summary__coupon-remove svg {
  width: 14px;
  height: 14px;
}

.order-summary__coupon-remove:hover,
.order-summary__coupon-remove:focus-visible {
  opacity: 1;
  stroke: #9C0000;
}

.order-summary__checkout + * {
  margin-top: 8px;
}

/* Cart item removal: loading state + collapse before the page is re-rendered */
.cart-item {
  position: relative;
  transition: opacity 0.2s ease;
}

.cart-item.is-loading {
  pointer-events: none;
  opacity: 0.4;
}

.cart-item.is-loading::after {
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
  border-color: var(--charcoal);
  border-top-color: transparent;
}

.cart-item.is-removing {
  overflow: hidden;
  opacity: 0;
  transition: height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
}

.cart-item.is-removing::after {
  content: none;
}

@media (prefers-reduced-motion: reduce) {
  .cart-item,
  .cart-item.is-removing {
    transition: none;
  }
}

/* ─── Checkout (classic WooCommerce in theme markup) ─── */

/* Fields are a flat list (address-i18n.js re-sorts them), so the
   half / third columns of the layout are done with a 6-column grid. */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px 16px;
}

.woocommerce-billing-fields__field-wrapper > .form-row,
.woocommerce-shipping-fields__field-wrapper > .form-row {
  grid-column: span 6;
  min-width: 0;
}

.woocommerce-billing-fields__field-wrapper > .mh-col-half,
.woocommerce-shipping-fields__field-wrapper > .mh-col-half {
  grid-column: span 3;
}

.woocommerce-billing-fields__field-wrapper > .mh-col-third,
.woocommerce-shipping-fields__field-wrapper > .mh-col-third {
  grid-column: span 2;
}

.woocommerce-input-wrapper {
  display: block;
}

select.form-input {
  cursor: pointer;
}

.form-field__label .optional {
  color: #888386;
  font-family: inherit;
}

.form-field__label .required {
  text-decoration: none;
  border: 0;
}

.woocommerce-invalid .form-input {
  border-color: #9C0000;
}

.checkout-inline-error-message {
  margin-top: 4px;
  padding-left: 5px;
  color: #9C0000;
  font-size: 0.8571428571rem;
  font-family: "Inter", Arial, Helvetica, sans-serif;
}

.checkout-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1.0714285714rem;
  color: var(--charcoal);
}

.woocommerce-shipping-fields .shipping_address {
  margin-top: 24px;
}

.payment-method__label {
  cursor: pointer;
}

.payment-method__label .radio__label {
  margin-right: auto;
}

.payment-method__icons img {
  -o-object-fit: contain;
  object-fit: contain;
}

/* The details box is shown/hidden by WooCommerce's checkout.js (slideDown/Up) */
.payment-method__details p {
  margin: 0;
}

.order-summary__value--muted {
  color: #888386;
  font-size: 0.8571428571rem;
  text-align: right;
  max-width: 60%;
}

.order-summary__shipping-list {
  display: flex;
  flex-direction: column;
  row-gap: 8px;
}

.order-summary__terms {
  font-size: 0.8571428571rem;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  color: #707070;
}

.order-summary__terms a {
  color: inherit;
  text-decoration: underline;
}

.order-summary__terms-row {
  display: block;
  margin-top: 8px;
}

/* Terms page content, revealed by the "terms and conditions" link (WC checkout.js). */
.order-summary__terms .woocommerce-terms-and-conditions {
  margin: 12px 0;
  padding: 12px 16px;
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  background: #fff;
  line-height: 1.5;
}

.order-summary__terms .woocommerce-terms-and-conditions > :first-child {
  margin-top: 0;
}

.order-summary__terms .woocommerce-terms-and-conditions h2,
.order-summary__terms .woocommerce-terms-and-conditions h3 {
  margin: 12px 0 4px;
  font-size: 1rem;
  color: #1d1d1d;
}

.order-summary__terms .woocommerce-terms-and-conditions p,
.order-summary__terms .woocommerce-terms-and-conditions ul {
  margin: 0 0 8px;
}

.order-summary__terms .woocommerce-terms-and-conditions ul {
  padding-left: 18px;
  list-style: disc;
}

.order-summary__terms-row.woocommerce-invalid .checkbox__box {
  border-color: #9C0000;
}

.woocommerce-checkout .blockUI.blockOverlay {
  border-radius: 28px;
}

@media (max-width: 1210px) {
  .woocommerce-billing-fields__field-wrapper > .mh-col-third,
  .woocommerce-shipping-fields__field-wrapper > .mh-col-third {
    grid-column: span 3;
  }

  #billing_postcode_field,
  #shipping_postcode_field {
    grid-column: span 6;
  }
}

@media (max-width: 992px) {
  .woocommerce-billing-fields__field-wrapper > .form-row,
  .woocommerce-shipping-fields__field-wrapper > .form-row,
  #billing_postcode_field,
  #shipping_postcode_field {
    grid-column: 1 / -1;
  }
}

/* ─── WooCommerce notices (WC styles are not loaded by the theme) ─── */
.woocommerce-notices-wrapper:not(:empty),
.woocommerce-NoticeGroup {
  margin-bottom: 24px;
}

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
  list-style: none;
  margin: 0 0 16px;
  padding: 16px 24px;
  border-radius: 28px;
  background-color: var(--white);
  border-left: 4px solid var(--gold);
  color: var(--charcoal);
  font-size: 1.0714285714rem;
  display: flex;
  flex-direction: column;
  row-gap: 6px;
}

.woocommerce-error {
  border-left-color: #9C0000;
}

.woocommerce-message {
  border-left-color: #2C8D34;
}

.woocommerce-error a,
.woocommerce-message a,
.woocommerce-info a {
  color: inherit;
  text-decoration: underline;
}

.woocommerce-error .button,
.woocommerce-message .button,
.woocommerce-info .button {
  order: 1;
  align-self: flex-start;
}

/* Hidden checkout fields (store country) — WooCommerce still wraps them in .form-row */
.form-row.mh-hidden-field {
  display: none;
}

/* ─── Order thank you page ─── */
.state-page__order {
  margin-top: 8px;
  font-size: 1.0714285714rem;
  color: #888386;
}

.state-page__order strong {
  color: var(--charcoal);
  font-weight: 400;
}

/* Hook output (gateway instructions, e.g. bank transfer details) — centered like the rest of the block */
.state-page__extra {
  font-size: 1.0714285714rem;
  color: #888386;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 8px;
}

.state-page__extra:empty {
  display: none;
}

.state-page__extra h2 {
  font-size: 1.2857142857rem;
  font-weight: 400;
  color: var(--charcoal);
}

.state-page__extra ul {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
}

/* ─── Vacancy page: Contact Form 7 inside the layout's .vacancy-apply card ─── */
.vacancy-apply .wpcf7-form {
  display: flex;
  flex-direction: column;
  row-gap: 20px;
}

.vacancy-apply .wpcf7-form-control-wrap {
  display: block;
}

/* Inside the pill-shaped file field the wrap only holds the hidden native input */
.vacancy-apply .file-field .wpcf7-form-control-wrap {
  position: static;
  display: contents;
}

.vacancy-apply .file-field .wpcf7-not-valid-tip {
  left: 16px;
}

/* ─── "Request callback" modal: Contact Form 7 inside the layout's .callback-form ─── */
.modal--callback .wpcf7-form-control-wrap {
  display: block;
}

.modal--callback .wpcf7-response-output {
  margin: 4px 0 0;
}

/* While sending, the spinner sits on the Send button (the response box is hidden then) */
.modal--callback .wpcf7-spinner {
  top: auto;
  bottom: 26px;
  transform: translate(-50%, 50%);
}

.modal--callback form.submitting .callback-form__submit {
  color: transparent;
}

/* Salary text from the WP editor uses <b> */
.vacancy__salary b {
  font-weight: 600;
  color: var(--charcoal);
}
