/*
 * The stock forms the theme keeps as they are, because packages insert their parts into them (pryalka_checkout,
 * pryalka_consent, pryalka_captcha, pryalka_notify, pryalka_pochta, pryalka_avito): the checkout, the contact page
 * and the review form of a product. Only their look follows the theme: fields of the account pages, cards with
 * rounded corners, the brand colour instead of the blue of Bootstrap. Loaded on every page (the review form is on
 * every product, the dialogs of the checkout are outside its container).
 */

/* Fields: as on the account pages */
#checkout-checkout .form-control,
#checkout-checkout .form-select,
#information-contact .form-control,
#information-contact .form-select,
#form-review .form-control,
#modal-shipping .form-control,
#modal-payment .form-control {
  min-height: 46px;
  border-radius: 10px;
  font-size: 16px;
}

#checkout-checkout textarea.form-control,
#information-contact textarea.form-control,
#form-review textarea.form-control {
  min-height: 110px;
}

#checkout-checkout .form-control:focus,
#checkout-checkout .form-select:focus,
#information-contact .form-control:focus,
#form-review .form-control:focus {
  border-color: rgba(var(--ph-accent-rgb, 217, 74, 18), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--ph-accent-rgb, 217, 74, 18), 0.12);
}

/* Labels over the fields, grey; the stock stylesheet aligns the labels beside a field to the right */
#checkout-checkout .form-label,
#checkout-checkout .col-form-label,
#information-contact .form-label,
#information-contact .col-form-label,
#form-review .form-label {
  margin-bottom: 4px;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--ph-muted, #6c6c6c);
  font-size: 14px;
  text-align: left;
}

/* Section headings: a heading of the card, not a framed stock legend */
#checkout-checkout legend,
#information-contact legend {
  float: none;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  color: var(--ph-text, #2b2b2b);
  font-size: 18px;
  font-weight: 700;
}

/* Radio buttons and checkboxes in the brand colour */
#checkout-checkout .form-check-input:checked,
#information-contact .form-check-input:checked,
#form-review .form-check-input:checked,
#modal-shipping .form-check-input:checked,
#modal-payment .form-check-input:checked {
  border-color: var(--ph-accent, #d94a12);
  background-color: var(--ph-accent, #d94a12);
}

#checkout-checkout .form-check-input:focus,
#information-contact .form-check-input:focus,
#form-review .form-check-input:focus,
#modal-shipping .form-check-input:focus,
#modal-payment .form-check-input:focus {
  border-color: rgba(var(--ph-accent-rgb, 217, 74, 18), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--ph-accent-rgb, 217, 74, 18), 0.12);
}

#checkout-checkout .form-check-label,
#information-contact .form-check-label {
  font-size: 14px;
}

/* The main buttons: as the buttons of the cart */
#checkout-checkout .btn-primary,
#information-contact form .btn-primary,
#form-review .btn-primary,
#modal-shipping .btn-primary,
#modal-payment .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding-right: 24px;
  padding-left: 24px;
  border-radius: 10px;
  font-weight: 600;
}

/*
 * Checkout: each part a card, as the cart
 */
#checkout-checkout #content > h1 {
  margin-bottom: 16px;
  font-size: 26px;
  font-weight: 700;
}

#checkout-register,
#checkout-payment-address,
#checkout-shipping-address,
#checkout-shipping-method,
#checkout-payment-method,
#checkout-confirm {
  margin-bottom: 16px !important;
  padding: 20px;
  border: 1px solid var(--ph-line, #ececec);
  border-radius: 14px;
  background: #fff;
}

#checkout-checkout .pryalka-avito-hint {
  color: var(--ph-muted, #6c6c6c);
  font-size: 13px;
}

/* "Existing address / new address": the two choices in a row */
#shipping-addresses,
#payment-addresses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 12px;
}

/* The way of delivery and of payment: one field that opens the choice, its button inside it */
#checkout-checkout .input-group {
  flex-wrap: nowrap;
  overflow: hidden;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
}

#checkout-checkout .input-group:has(.is-invalid) {
  border-color: var(--bs-form-invalid-border-color, #dc3545);
}

#checkout-checkout .input-group > .input-group-text {
  padding-left: 14px;
  border: 0;
  background: transparent;
  color: var(--ph-muted, #6c6c6c);
}

#checkout-checkout .input-group > .form-control {
  min-height: 46px;
  padding-left: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  text-overflow: ellipsis;
}

#checkout-checkout .input-group > .btn {
  min-height: 46px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid #dee2e6;
  border-radius: 0 !important;
  background: var(--ph-soft, #f5f5f5);
  color: var(--ph-accent, #d94a12);
  font-weight: 600;
}

#checkout-checkout .input-group > .btn:hover,
#checkout-checkout .input-group > .btn:focus-visible {
  background: var(--ph-tint, #fdece4);
  color: var(--ph-accent-dark, #bf3f0e);
}

#checkout-payment-method label strong {
  font-weight: 400;
}

/* The order: the lines of the products and the sums, no table frame */
#checkout-confirm .table-responsive {
  margin: 0;
}

/* The frame of the table, of its parts and of its rows (table-bordered): only the lines of the cells below */
#checkout-confirm .table,
#checkout-confirm .table > :not(:first-child),
#checkout-confirm .table > :not(caption) > * {
  border: 0;
}

#checkout-confirm .table {
  margin-bottom: 16px;
  --bs-table-hover-bg: transparent;
  --bs-table-striped-bg: transparent;
}

#checkout-confirm .table > :not(caption) > * > * {
  padding: 10px 0;
  border-width: 0 0 1px;
  border-color: var(--ph-line, #ececec);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

#checkout-confirm .table > thead > tr > * {
  padding-top: 0;
  color: var(--ph-muted, #6c6c6c);
  font-size: 13px;
  font-weight: 600;
}

#checkout-confirm .table td a {
  color: var(--ph-text, #2b2b2b);
  font-weight: 500;
  text-decoration: none;
}

#checkout-confirm .table td a:hover {
  color: var(--ph-accent, #d94a12);
}

#checkout-confirm .table td ul {
  color: var(--ph-muted, #6c6c6c);
  font-size: 13px;
}

#checkout-confirm .table > tfoot > tr > * {
  padding: 4px 0;
  border-bottom: 0;
}

#checkout-confirm .table > tfoot > tr:first-child > * {
  padding-top: 12px;
}

#checkout-confirm .table > tfoot strong {
  font-weight: 400;
}

#checkout-confirm .table > tfoot > tr:last-child > * {
  padding-top: 8px;
  font-size: 18px;
  font-weight: 700;
}

#checkout-confirm .table > tfoot > tr:last-child strong {
  font-weight: 700;
}

/* "Как оплатить" of a payment method (the SBP transfer, Avito): its text on a soft background, not a framed box
   inside the card; an empty description (pryalka_checkout leaves it out when the instruction is set) takes no room */
#checkout-payment fieldset > p:has(> b:empty) {
  display: none;
}

#checkout-payment fieldset > p > b {
  font-weight: 600;
}

#checkout-payment .border.rounded {
  padding: 14px 16px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--ph-soft, #f5f5f5);
  font-size: 14px;
  line-height: 1.5;
}

#checkout-payment .border.rounded p:last-child {
  margin-bottom: 0;
}

/* "Подтвердить заказ": the main button of the page, over the card */
#checkout-payment .text-end {
  text-align: center !important;
}

#checkout-payment .btn-primary {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
}

#checkout-payment .form-text {
  margin-top: 8px;
  color: var(--ph-muted, #6c6c6c);
  font-size: 13px;
}

/* The dialogs of the delivery and the payment: the ways as cards to choose */
#modal-shipping .modal-content,
#modal-payment .modal-content {
  border: 0;
  border-radius: 16px;
}

#modal-shipping .modal-header,
#modal-payment .modal-header {
  padding: 20px 20px 8px;
  border-bottom: 0;
}

#modal-shipping .modal-title,
#modal-payment .modal-title {
  font-size: 18px;
  font-weight: 700;
}

#modal-shipping .modal-title i,
#modal-payment .modal-title i {
  margin-right: 6px;
  color: var(--ph-accent, #d94a12);
}

#modal-shipping .modal-body,
#modal-payment .modal-body {
  padding: 8px 20px 20px;
}

#modal-shipping .alert-info,
#modal-payment .alert-info {
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--ph-soft, #f5f5f5);
  color: var(--ph-text, #2b2b2b);
  font-size: 14px;
}

/* The name of a group of ways ("Почта России"): a small heading */
#form-shipping-method p strong,
#form-payment-method p strong {
  font-size: 15px;
}

#form-shipping-method .form-check,
#form-payment-method .form-check {
  position: relative;
  margin-bottom: 8px;
  padding: 12px 14px 12px 44px;
  border: 1px solid var(--ph-line, #ececec);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

#form-shipping-method .form-check:hover,
#form-payment-method .form-check:hover {
  border-color: #d0d0d0;
}

#form-shipping-method .form-check:has(input:checked),
#form-payment-method .form-check:has(input:checked) {
  border-color: var(--ph-accent, #d94a12);
  background: var(--ph-tint, #fdece4);
}

/* The stock radio buttons of the dialogs have no class */
#form-shipping-method .form-check input[type="radio"],
#form-payment-method .form-check input[type="radio"] {
  position: absolute;
  top: 15px;
  left: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ph-accent, #d94a12);
}

#form-shipping-method .form-check label,
#form-payment-method .form-check label {
  display: block;
  cursor: pointer;
}

#form-shipping-method .text-end,
#form-payment-method .text-end {
  margin-top: 16px;
}

#form-shipping-method .text-end .btn,
#form-payment-method .text-end .btn {
  width: 100%;
}

/*
 * Contact page: the shop in a card, the form in one column of labels over the fields
 */
#information-contact #content > h1 {
  margin-bottom: 16px;
  font-size: 26px;
  font-weight: 700;
}

#information-contact #content > h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

#information-contact #content > .card {
  border-color: var(--ph-line, #ececec);
  border-radius: 14px;
}

#information-contact #content > .card .card-body {
  padding: 20px;
}

#information-contact #content > .card strong {
  font-size: 14px;
}

#information-contact #content > .card address {
  margin-bottom: 12px;
  color: var(--ph-muted, #6c6c6c);
  font-size: 14px;
}

#information-contact #content > .card .btn {
  border-radius: 10px;
}

#form-contact {
  max-width: 640px;
  margin-top: 28px;
}

/* The stock rows put the label beside the field (col-sm-2 / col-sm-10 and their offsets): one column */
#form-contact .row > [class*="col-sm-"] {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}

/* The captcha of pryalka_captcha lines up with the fields of a form with the labels beside them: here they are over
   the fields */
#form-contact .pryalka-captcha {
  width: 100% !important;
  margin-left: 0 !important;
}

/* The stock field has ten rows */
#form-contact textarea.form-control {
  height: 160px;
}

#form-contact .row.mb-3 {
  margin-bottom: 14px !important;
}

#form-contact .text-end {
  text-align: left !important;
}

/*
 * The review form of a product: the stars instead of the five round buttons between "Плохо" and "Хорошо"
 */
#form-review > h2 {
  margin: 24px 0 14px;
  font-size: 18px;
  font-weight: 700;
}

#form-review > #review > p {
  margin: 4px 0 8px;
  color: var(--ph-muted, #6c6c6c);
  font-size: 14px;
  text-align: left !important;
}

#form-review .row.required {
  margin-right: 0;
  margin-left: 0;
}

#form-review .row.required > * {
  padding-right: 0;
  padding-left: 0;
}

/* The words around the buttons are hidden by the size of the text; the buttons are stars */
#input-rating {
  display: flex;
  gap: 4px;
  font-size: 0;
}

#input-rating .form-check-input {
  width: 30px;
  height: 30px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #d9d9d9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
  box-shadow: none;
}

/* The chosen star and the ones before it; while the pointer is over a star, up to that one */
#input-rating:has(.form-check-input:nth-of-type(1):checked) .form-check-input:nth-of-type(-n + 1),
#input-rating:has(.form-check-input:nth-of-type(2):checked) .form-check-input:nth-of-type(-n + 2),
#input-rating:has(.form-check-input:nth-of-type(3):checked) .form-check-input:nth-of-type(-n + 3),
#input-rating:has(.form-check-input:nth-of-type(4):checked) .form-check-input:nth-of-type(-n + 4),
#input-rating:has(.form-check-input:nth-of-type(5):checked) .form-check-input:nth-of-type(-n + 5) {
  background: #f5a623;
}

#input-rating:has(.form-check-input:hover) .form-check-input {
  background: #d9d9d9;
}

#input-rating:has(.form-check-input:nth-of-type(1):hover) .form-check-input:nth-of-type(-n + 1),
#input-rating:has(.form-check-input:nth-of-type(2):hover) .form-check-input:nth-of-type(-n + 2),
#input-rating:has(.form-check-input:nth-of-type(3):hover) .form-check-input:nth-of-type(-n + 3),
#input-rating:has(.form-check-input:nth-of-type(4):hover) .form-check-input:nth-of-type(-n + 4),
#input-rating:has(.form-check-input:nth-of-type(5):hover) .form-check-input:nth-of-type(-n + 5) {
  background: #f5a623;
}

#input-rating .form-check-input:focus-visible {
  outline: 2px solid rgba(var(--ph-accent-rgb, 217, 74, 18), 0.5);
  outline-offset: 2px;
}

#form-review > .text-end {
  text-align: left !important;
}

/* The number of the reviews on their tab ("Отзывы 9") */
.pp-tab-count {
  display: inline-block;
  min-width: 20px;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--ph-soft, #f5f5f5);
  color: var(--ph-muted, #6c6c6c);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* The reviews (the list of the theme, product/review_list) */
.pr-reviews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pr-review {
  padding: 16px;
  border: 1px solid var(--ph-line, #ececec);
  border-radius: 14px;
  background: #fff;
}

.pr-review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 6px;
}

.pr-review-author {
  font-size: 15px;
  font-weight: 700;
}

.pr-review-date {
  color: #9a9a9a;
  font-size: 13px;
}

.pr-review-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  color: #d9d9d9;
  font-size: 14px;
}

.pr-review-stars .on {
  color: #f5a623;
}

.pr-review-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.pr-reviews + .pr-pagination {
  margin-top: 12px;
}

@media (max-width: 575.98px) {
  #checkout-register,
  #checkout-payment-address,
  #checkout-shipping-address,
  #checkout-shipping-method,
  #checkout-payment-method,
  #checkout-confirm {
    padding: 16px;
  }

  #checkout-checkout #content > h1,
  #information-contact #content > h1 {
    font-size: 22px;
  }

  #form-contact .text-end .btn,
  #form-review > .text-end .btn {
    width: 100%;
  }
}

/*
 * A missing page (error/not_found) and the comparison (product/compare) of the theme
 */
.pe-empty {
  max-width: 560px;
  margin: 24px auto 32px;
  text-align: center;
}

.pe-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--ph-tint, #fdece4);
  color: var(--ph-accent, #d94a12);
  font-size: 28px;
}

.pe-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 700;
}

.pe-text {
  margin: 0 0 20px;
  color: var(--ph-muted, #6c6c6c);
  font-size: 15px;
  line-height: 1.5;
}

.pe-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 28px;
  border-radius: 10px;
  font-weight: 600;
}

.pe-subtitle {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

/* The sections of the catalog: tiles with the picture of the catalog menu */
.pe-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.pe-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--ph-line, #ececec);
  border-radius: 14px;
  background: #fff;
  color: var(--ph-text, #2b2b2b);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s;
}

.pe-section:hover {
  border-color: #d0d0d0;
  color: var(--ph-accent, #d94a12);
}

.pe-section .ph-cat-img {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--ph-soft, #f5f5f5);
  color: #555;
  font-size: 20px;
}

.pe-section .ph-cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pe-section small {
  margin-left: 2px;
  color: #9a9a9a;
  font-weight: 400;
}

/* The comparison: a card per product over its column, the rows of the values; wide tables scroll sideways */
.pe-page-title {
  margin-bottom: 16px;
  font-size: 26px;
  font-weight: 700;
}

.pe-compare-wrap {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 32px;
  overflow-x: auto;
  border: 1px solid var(--ph-line, #ececec);
  border-radius: 14px;
  background: #fff;
}

.pe-compare {
  border-collapse: collapse;
  font-size: 14px;
}

/* A product column as wide as a card of the catalog, whatever the number of the products */
.pe-compare th,
.pe-compare td {
  width: 240px;
  min-width: 200px;
  max-width: 260px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ph-line, #ececec);
  vertical-align: top;
}

.pe-compare th[scope="row"] {
  width: 180px;
  color: var(--ph-muted, #6c6c6c);
  font-weight: 400;
}

.pe-compare tbody:last-child tr:last-child > * {
  border-bottom: 0;
}

.pe-compare-group th {
  padding-top: 18px;
  background: var(--ph-soft, #f5f5f5);
  color: var(--ph-text, #2b2b2b);
  font-size: 15px;
  font-weight: 700;
}

.pe-compare-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pe-compare-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ph-soft, #f5f5f5);
}

.pe-compare-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pe-compare-name {
  color: var(--ph-text, #2b2b2b);
  font-weight: 600;
  text-decoration: none;
}

.pe-compare-name:hover {
  color: var(--ph-accent, #d94a12);
}

.pe-compare-price {
  font-size: 17px;
  font-weight: 700;
}

.pe-compare-price .price-old {
  color: #9a9a9a;
  font-size: 13px;
  font-weight: 400;
  text-decoration: line-through;
}

.pe-compare-cart {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
}

.pe-compare-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #9a9a9a;
}

.pe-compare-remove:hover {
  color: var(--ph-text, #2b2b2b);
}

.pe-compare-stars {
  color: #d9d9d9;
}

.pe-compare-stars .on {
  color: #f5a623;
}

@media (max-width: 575.98px) {
  .pe-title,
  .pe-page-title {
    font-size: 22px;
  }

  .pe-sections {
    grid-template-columns: minmax(0, 1fr);
  }

  .pe-compare th,
  .pe-compare td {
    min-width: 150px;
  }

  .pe-compare th[scope="row"] {
    width: 120px;
    min-width: 120px;
  }
}
