.xxx-best-offers-container {
    --grid-template-columns: repeat(2, 1fr);
    --grid-gap: 10px;

    display: grid;
    grid-template-columns: var(--grid-template-columns);
    gap: var(--grid-gap);
}

.xxx-best-offers-container--1,
.xxx-best-offers-container--3 {
    --grid-template-columns: 1fr;
}

.xxx-best-offers-container__item {
    width: 100%;
}

/* ==========================================
   OFFER
========================================== */

.xxx-best-offer {
    --grid-item-template-areas: "name name" "params params" "btn btn";
    --grid-item-template-columns: 1fr 1fr;
    --grid-item-template-gap: 0;

    --border-color: #55A3ED;
    --bg-color: rgba(85, 163, 237, 0.1);


    --label-fs: 12px;
    --value-fs: 14px;

    --description-display: block;
    --param-3-display: none;

    --name-border: none;
    --name-p: 0;

    --name-offer-label-space: 32px;
    --name-offer-label-inset-x: 15px;
    --name-offer-label-inset-bottom: -30px;

    --grid-item-p: 0;
    --params-p: 0;
    --params-gap: 5px;
    --params-align: normal;
    --params-direction: column;

    --param-grid-template: 1fr;
    --param-grid-g: 0;

    --btn-p: 0;

    --title-ff: inherit;
    --title-fs: inherit;

    --logo-size: 24px;

    --btn-display: inline-flex;
    --btn-arrow-display: none;

    --btn-shadow: 0 5px 10px rgba(85, 163, 237, 0.4);
    --btn-color: #55a3ed;

    --value-order: initial;

    border: 1px solid var(--border-color);
    border-radius: 5px;
    background:
        linear-gradient(0deg, var(--bg-color), var(--bg-color)),
        linear-gradient(0deg, #FFFFFF, #FFFFFF);

    display: grid;
    grid-template-areas: var(--grid-item-template-areas);
    grid-template-columns: var(--grid-item-template-columns);

    gap: var(--grid-item-template-gap);
    padding: var(--grid-item-p);

    align-items: center;
    position: relative;
}

/* ==========================================
   COLORS
========================================== */

.xxx-best-offer--violet {
    --border-color: #6455ED;
    --bg-color: rgba(100, 85, 237, 0.1);
    --btn-color: #6455ED;
    --btn-shadow: 0 5px 10px #6455ED66;
}

.xxx-best-offer--green-light {
    --border-color: #27CC06;
    --bg-color: rgba(39, 204, 6, 0.1);
    --btn-color: #27CC06;
    --btn-shadow: 0 5px 10px #83CA0066;
}

.xxx-best-offer--green-dark {
    --border-color: #0BA96A;
    --bg-color: rgba(11, 169, 106, 0.1);
    --btn-color: #0BA96A;
    --btn-shadow: 0 5px 10px #0BA96A66;
}

/* ==========================================
   ELEMENTS
========================================== */

.xxx-best-offer__absolute {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.xxx-best-offer__logo {
    width: var(--logo-size);
    height: var(--logo-size);
    flex: none;
}

.xxx-best-offer__name {
    grid-area: name;

    display: flex;
    align-items: center;
    gap: 5px;

    padding: var(--name-p);
    border-bottom: var(--name-border);
}

.xxx-best-offer--4 .xxx-best-offer__name:has(.xxx-best-offer__offer-label) {
    position: relative;
    margin-bottom: var(--name-offer-label-space);
}

.xxx-best-offer--4 .xxx-best-offer__offer-label {
    position: absolute;
    left: var(--name-offer-label-inset-x);
    right: var(--name-offer-label-inset-x);
    bottom: var(--name-offer-label-inset-bottom);
}

.xxx-best-offer--3 .xxx-best-offer__offer-label,
.xxx-best-offer:not(.xxx-best-offer--3, .xxx-best-offer--4) .xxx-best-offer__offer-label {
    display: none;
}

.xxx-best-offer__title {
    font-family: var(--title-ff);
    font-size: var(--title-fs);
}

.xxx-best-offer__params {
    grid-area: params;

    display: flex;
    flex-direction: var(--params-direction);
    align-items: var(--params-align);

    gap: var(--params-gap);
    padding: var(--params-p);
}

.xxx-best-offer__param {
    display: grid;
    grid-template-columns: var(--param-grid-template);
    gap: var(--param-grid-g);

    align-items: center;
    flex: 1 1 0;
}

.xxx-best-offer__param:nth-child(3) {
    display: var(--param-3-display);
}

.xxx-best-offer__btn {
    grid-area: btn;
    padding: var(--btn-p);
}

.xxx-best-offer__btn .xxx-g-btn {
    display: var(--btn-display);
    font-size: 14px !important;

    background-color: var(--btn-color) !important;
    border-color: var(--btn-color) !important;

    box-shadow: var(--btn-shadow) !important;

    position: relative;
    z-index: 2;
}

.xxx-best-offer__btn .xxx-g-btn:hover {
    box-shadow: none !important;
}

.xxx-best-offer__btn .xxx-g-btn.xxx-g-btn--double-arrow {
    display: var(--btn-arrow-display);
}

.xxx-best-offer__btn .xxx-g-btn.xxx-g-btn--double-arrow:before {
    font-size: 10px;
}

.xxx-best-offer__label {
    font-size: var(--label-fs);
    color: #9299A2;
}

.xxx-best-offer__value {
    font-size: var(--value-fs);
    order: var(--value-order);
}

.xxx-best-offer__value.accent {
    font-family: "lato black", sans-serif;
}

.xxx-best-offer__description {
    display: var(--description-display);
    font-size: 12px;
    color: #9299A2;
}

/* ==========================================
   MOBILE LAYOUTS
========================================== */

.xxx-best-offer--2,
.xxx-best-offer--4 {
    --label-fs: 10px;
    --value-fs: 12px;

    --description-display: none;

    --name-border: 1px solid #E9EDF0;
    --name-p: 10px;

    --params-p: 10px;
    --params-direction: column;

    --param-grid-template: 1fr 1.5fr;
    --param-grid-g: 10px;

    --btn-p: 0 10px 10px;

    --title-fs: 12px;
    height: 100%;
}

.xxx-best-offer--1,
.xxx-best-offer--3 {
    --grid-item-template-areas:
            "name name btn"
            "params params btn";

    --grid-item-p: 10px 15px;
    --grid-item-template-gap: 10px;

    --params-direction: row;
    --params-gap: 10px;

    --btn-display: none;
    --btn-arrow-display: inline-flex;

    --value-fs: 16px;
    --title-fs: 12px;

    --logo-size: 30px;

    --value-order: -1;
}

/* ==========================================
   PROBABILITY
========================================== */

.xxx-best-offer__param.probability-approval .xxx-best-offer__value {
    font-size: 14px;
}

.xxx-best-offer__param.probability-approval.green .xxx-best-offer__value {
    color: #95ce5a;
}

.xxx-best-offer__param.probability-approval.red .xxx-best-offer__value {
    color: #EBB80F;
}

.xxx-best-offer__param.probability-approval.yellow .xxx-best-offer__value {
    color: #ED2C35;
}

/* ==========================================
   DESKTOP
========================================== */

@media (min-width: 992px) {

    .xxx-best-offer__btn .xxx-g-btn {
        font-size: 16px !important;
    }

    .xxx-best-offers-container--4 {
        --grid-template-columns: repeat(4, 1fr);
        --grid-gap: 20px;
    }

    .xxx-best-offers-container--3 {
        --grid-template-columns: repeat(3, 1fr);
    }

    .xxx-best-offers-container--1,
    .xxx-best-offers-container--2 {
        --grid-template-columns: 1fr;
    }

    .xxx-best-offer--3,
    .xxx-best-offer--4 {
        --label-fs: 14px;
        --value-fs: 16px;

        --params-direction: column;

        --name-p: 15px 15px 10px;
        --params-p: 15px;

        --btn-p: 0 15px 15px;

        --title-fs: 16px;
        --title-ff: "lato black", sans-serif;

        --description-display: none;

        --grid-item-template-areas:
                "name name"
                "params params"
                "btn btn";

        --param-grid-template: 1fr 1.5fr;
        --param-grid-g: 10px;

        --btn-display: inline-flex;
        --btn-arrow-display: none;

        --grid-item-p: 0;
        --grid-item-template-gap: 0;

        --value-order: initial;

        --name-border: 1px solid #E9EDF0;
        height: 100%;
    }

    .xxx-best-offer--1,
    .xxx-best-offer--2 {
        --grid-item-template-areas: "name params btn";
        --grid-item-template-columns: 1fr 2fr 165px;

        --logo-size: 40px;

        --description-display: block;

        --title-fs: 16px;
        --label-fs: 14px;
        --value-fs: 20px;

        --param-grid-template: 1fr;
        --param-grid-g: 0;

        --name-border: none;

        --btn-p: 0;
        --name-p: 0;
        --params-p: 0;

        --params-direction: row;
        --params-align: center;
        --params-gap: 20px;

        --grid-item-p: 15px 20px;
        --grid-item-template-gap: 20px;

        --param-3-display: grid;

        --btn-display: inline-flex;
        --btn-arrow-display: none;

        --value-order: -1;
    }
}

/* ==========================================
   SKELETON
========================================== */

.xxx-best-offer--skeleton {
    --border-color: #E8ECEF;
    --bg-color: #FFFFFF;
    pointer-events: none;
}

.xxx-best-offers-skeleton__title {
    min-height: 28px;
    max-width: 320px;
    margin-bottom: 20px;
}

.xxx-best-offers-skeleton__logo {
    width: var(--logo-size);
    height: var(--logo-size);
    min-width: var(--logo-size);
    border-radius: 50%;
    flex-shrink: 0;
}

.xxx-best-offers-skeleton__name-text {
    flex: 1;
    min-width: 0;
}

.xxx-best-offers-skeleton__title-line {
    min-height: var(--title-fs);
    width: 70%;
    margin-bottom: 6px;
}

.xxx-best-offers-skeleton__description-line {
    min-height: 12px;
    width: 55%;
}

.xxx-best-offers-skeleton__label {
    min-height: var(--label-fs);
    width: 60%;
}

.xxx-best-offers-skeleton__value {
    min-height: var(--value-fs);
    width: 80%;
}

.xxx-best-offers-skeleton__button {
    min-height: 40px;
    width: 100%;
}

@media (min-width: 992px) {
    .xxx-best-offers-skeleton__button {
        min-height: 44px;
    }

    .xxx-best-offer--1.xxx-best-offer--skeleton .xxx-best-offers-skeleton__button,
    .xxx-best-offer--2.xxx-best-offer--skeleton .xxx-best-offers-skeleton__button {
        min-height: 48px;
    }

    .xxx-best-offer--3 .xxx-best-offer__offer-label {
        display: block;
    }

    .xxx-best-offer--3 .xxx-best-offer__name:has(.xxx-best-offer__offer-label) {
        position: relative;
        margin-bottom: var(--name-offer-label-space);
    }

    .xxx-best-offer--3 .xxx-best-offer__offer-label {
        position: absolute;
        left: var(--name-offer-label-inset-x);
        right: var(--name-offer-label-inset-x);
        bottom: var(--name-offer-label-inset-bottom);
    }
}
