/**
 * Модалка заказа товара — компактный UI в духе catalog-tile.
 */

/* Полноэкранное затемнение (клик = закрыть) */
.product-order-modal .product-order-modal__dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(6, 7, 11, 0.55);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.2s ease;
}

.product-order-modal .product-order-modal__dim:hover,
.product-order-modal .product-order-modal__dim:focus-visible {
  background: rgba(6, 7, 11, 0.72);
  outline: none;
}

/* Видимая «Закрыть» — тот же паттерн, что blog «Читать» (.bsingle__content .blog__btn .btn) */
.product-order-modal .btn.product-order-modal__backdrop {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  font-size: 16px;
  line-height: 1;
  background: #fffef8;
  color: #06070b;
  border: 1px solid #f8dc95;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.product-order-modal .btn.product-order-modal__backdrop::before {
  background: #f8dc95;
}

.product-order-modal .btn.product-order-modal__backdrop:hover,
.product-order-modal .btn.product-order-modal__backdrop:focus-visible {
  background: #f8dc95;
  border: 1px solid #f8dc95;
  color: #06070b;
  outline: none;
}

.product-order-modal .btn.product-order-modal__backdrop:hover::before,
.product-order-modal .btn.product-order-modal__backdrop:focus-visible::before {
  background: #f8dc95;
}

.product-order-modal .modal-dialog {
  position: relative;
  z-index: 2;
  max-width: 440px;
  pointer-events: none;
}

.product-order-modal .modal-dialog .modal-content {
  pointer-events: auto;
}

.product-order-modal .modal-content {
  border: 1px solid rgba(0, 76, 63, 0.14);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 76, 63, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 247, 214, 0.35) 0%, rgba(255, 255, 255, 0.98) 38%, #ffffff 100%);
}

.product-order-modal .modal-header {
  position: relative;
  padding: 18px 20px 16px;
  border-bottom: none;
  background: linear-gradient(120deg, #00352c 0%, #004c3f 55%, #0a6b58 100%);
  color: #ffffff;
}

.product-order-modal .modal-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #c4a35a, rgba(196, 163, 90, 0.2));
}

.product-order-modal .modal-title {
  color: #ffffff !important;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  padding-right: 12px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.product-order-modal .btn-close {
  margin: 0;
  opacity: 0.9;
}

.product-order-modal .modal-body {
  padding: 18px 20px 20px;
}

.product-order-fields {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.product-order-field {
  margin: 0;
}

.product-order-label {
  display: block;
  margin: 0 0 5px;
  color: #004c3f;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.product-order-required {
  color: #c4a35a;
  font-weight: 700;
  margin-left: 0.15em;
}

.product-order-input.form-control {
  height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 76, 63, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #2a2a2a;
  font-size: 0.92rem;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-order-input.form-control::placeholder {
  color: #8a9491;
  font-size: 0.86rem;
}

.product-order-input.form-control:focus {
  border-color: rgba(0, 76, 63, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 76, 63, 0.12);
  background: #fff;
}

.product-order-consent {
  margin-bottom: 12px;
}

.product-order-consent .contact-field {
  margin-bottom: 0 !important;
}

.product-order-consent .newsletter-consent-label,
.product-order-consent .newsletter-consent-label.contact-consent-label-light {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(0, 76, 63, 0.12);
  border-radius: 12px;
  background: rgba(0, 76, 63, 0.04);
  font-size: 0.72rem;
  line-height: 1.4;
  font-weight: 400;
  color: #3d4a47;
  cursor: pointer;
}

.product-order-consent .newsletter-consent-label input[type="checkbox"] {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 1px 0 0 !important;
  accent-color: #004c3f;
  border: 1px solid rgba(0, 76, 63, 0.35) !important;
  border-radius: 4px;
  -webkit-appearance: auto;
  appearance: auto;
}

.product-order-consent .consent-label-text {
  display: block;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.product-order-consent .newsletter-consent-link,
.product-order-consent .newsletter-consent-link-on-light {
  color: #004c3f !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.product-order-consent .newsletter-consent-link:hover,
.product-order-consent .newsletter-consent-link-on-light:hover,
.product-order-consent .newsletter-consent-link:focus,
.product-order-consent .newsletter-consent-link-on-light:focus {
  color: #0a6b58 !important;
}

.product-order-consent .text-warning {
  color: #c4a35a !important;
}

.product-order-modal .form-captcha-label,
.product-order-modal .contact-field.c-message label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #004c3f;
}

.product-order-modal .contact-field.mb-20,
.product-order-modal .contact-field.p-relative.mb-20 {
  margin-bottom: 12px !important;
}

.product-order-modal .form-captcha-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.product-order-modal .form-captcha-notice {
  font-size: 0.7rem !important;
}

.product-order-hint {
  margin: 0 0 14px;
  color: #6a7572;
  font-size: 0.75rem;
  line-height: 1.35;
}

.product-order-hint--under-field {
  margin: 6px 0 0;
}

.product-order-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(120deg, #004c3f 0%, #0a6b58 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 76, 63, 0.18);
}

a.product-order-submit {
  color: #fff;
  text-decoration: none;
}

.product-order-submit:hover,
.product-order-submit:focus-visible {
  background: linear-gradient(120deg, #0a6b58 0%, #004c3f 100%);
  box-shadow: 0 12px 26px rgba(0, 76, 63, 0.24);
  transform: translateY(-1px);
  outline: none;
  color: #fff;
}

.product-order-submit-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.product-order-submit:hover .product-order-submit-arrow,
.product-order-submit:focus-visible .product-order-submit-arrow {
  transform: translateX(4px);
}

@media (max-width: 575px) {
  .product-order-modal .modal-dialog {
    margin: 0.75rem;
    max-width: calc(100% - 1.5rem);
  }

  .product-order-modal .modal-body {
    padding: 16px;
  }

  .product-order-modal .modal-title {
    font-size: 0.98rem;
  }
}
