/* Article table styles — override exported table classes */
.userinput table.t1,
.userinput table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border-radius: 6px;
    overflow: hidden;
}

.userinput table.t1 tr,
.userinput table tr {
    background: #F5F7F8;
}

.userinput table.t1 tr:nth-child(even),
.userinput table tr:nth-child(even) {
    background: #eef1f3;
}

.userinput table.t1 tr td,
.userinput table.t1 tr th,
.userinput table tr td,
.userinput table tr th {
    padding: 12px 15px !important;
    font-size: 14px !important;
    border-bottom: 2px solid #fff !important;
    border-right: 2px solid #fff;
    vertical-align: middle !important;
    text-align: left;
}

.userinput table.t1 tr:first-child td,
.userinput table.t1 tr:first-child th,
.userinput table tr:first-child td,
.userinput table tr:first-child th {
    background: #008B8B;
    color: #fff;
    font-weight: bold;
    padding-top: 14px !important;
}

/* Strip extra <p> tags inside cells */
.userinput table td p,
.userinput table th p {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* Responsive table wrapper */
.userinput table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Nested tables — simplify */
.userinput table table {
    margin: 0 !important;
    border: none !important;
    overflow: visible;
}

.userinput table table td,
.userinput table table th {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    font-weight: normal !important;
    color: inherit !important;
}

/* Paragraph classes from article export */
.userinput .p1,
.userinput .p2,
.userinput .p3,
.userinput .p4,
.userinput .p5 {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 4px 0;
}

.userinput .s1 {
    font-style: italic;
}

/* Back-to-top button: inline up-arrow (original arr_up.svg path is root-absolute and unbundled) */
#btn-goback{
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E') !important;
  background-repeat:no-repeat !important;
  background-position:center center !important;
  background-color:#20B2AA !important;
  background-size:26px 26px !important;
}

/* ── Mobile overflow safeguards (structure-optimization skill) ────────────── */
@media (max-width: 480px) {
  /* never let wide values force horizontal scroll */
  html, body { overflow-x: hidden; }
  .quick-main-values .col-sm-3 { margin-bottom: .75rem; word-break: break-word; }
  .product-parameters table td, .product-parameters table th { word-break: break-word; white-space: normal; }
  .contact .numbers a, .contact p { word-break: break-word; }
  .offer-val { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; }
  .offer-logo img { max-width: 120px; height: auto; }
  .sign-box .sign-links span { word-break: break-word; }
  /* article/category prose: keep long tables & images inside the viewport */
  .userinput table { display: block; overflow-x: auto; max-width: 100%; }
  .userinput img { max-width: 100%; height: auto; }
}

/* Category aggregate-rating widget: render real stars (style.min.css only
   scopes ul.stars to offer-wrap/product-summary/etc., not .category-rating). */
.category-rating-section { padding: 20px 0; }
.category-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.category-rating ul.stars { list-style: none; padding: 0; margin: 0; display: inline-flex; }
.category-rating ul.stars li {
  display: inline-block; height: 20px; width: 19px; margin: 0;
  background: url(https://cdn.finaton.com/assets/front/images/icons/star_grey.svg) no-repeat center center;
  background-size: contain;
}
.category-rating ul.stars li.on { background-image: url(https://cdn.finaton.com/assets/front/images/icons/star.svg); }
.category-rating ul.stars li::after { display: none; }
.category-rating .score, .category-rating .count { font-weight: 600; }

/* Product detail header: keep the apply button pinned to the right regardless of
   label length (long labels like bg "Кандидатствай за заем" otherwise wrapped
   below the floated logo/title). Desktop only; mobile keeps the stacked layout. */
@media (min-width: 768px) {
  section.product-summary > .container > .row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 20px;
  }
  /* Bootstrap's .row clearfix pseudo-elements become stray flex items and
     break alignment — neutralise them inside this flex row. */
  section.product-summary > .container > .row::before,
  section.product-summary > .container > .row::after {
    display: none;
  }
  section.product-summary > .container > .row > .col-sm-8 {
    float: none;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }
  section.product-summary > .container > .row > .request-a-loan {
    flex: 0 0 auto;
    text-align: right;
    margin-left: auto;
  }
  section.product-summary > .container > .row > .request-a-loan .request-button {
    white-space: nowrap;
    margin: 0;
  }
}
