/**
 * Copyright since 2007 Pliciweb Solutions
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to contact@pliciweb.com so we can send you a copy immediately.
 *
 * @author    Pliciweb Solutions <contact@pliciweb.com>
 * @copyright Since 2007 Pliciweb Solutions
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */

/* =========================================================
   Bloc principal
   ========================================================= */

.recommendations .recommendations__mainblock {
    /* background-color: #f4f4f4; */
    padding: 50px 0;
}

@media screen and (max-width: 768px) {
    .recommendations .recommendations__mainblock {
        padding: 30px 15px 30px 15px;
    }
}

/* =========================================================
   Layout 2 colonnes (gauche résumé / droite produits)
   ========================================================= */

.recommendations__body {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.recommendations__left {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recommendations__right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (max-width: 991px) {
    .recommendations__body {
        flex-direction: column;
        gap: 32px;
    }

    .recommendations__left {
        flex: none;
        width: 100%;
    }
}

/* =========================================================
   Résumé gauche
   ========================================================= */

.recommendations__header-title {
    display: block;
}

.recommendations__header-title p {
    margin-bottom: 0;
}

.recommendations__description {
    font-size: 0.9rem;
    color: #555;
}

/* Bloc prix */
.recommendations__price-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding-bottom: 8px;
}

.recommendations__price-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #e3e3e3;
}

.recommendations__price-header-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #393E42;
}

.recommendations__price-header-value {
    font-size: 1.15rem;
    line-height: 1;
    color: #393E42;
}

.recommendations__price-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.recommendations__price-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: center;
}

.recommendations__price-column-label {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: #555;
}

.recommendations__price-value {
    font-weight: 700;
    white-space: nowrap;
    color: #393E42;
    min-height: 1.5em;
    display: inline-block;
}

.recommendations__price-separator {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: #393E42;
}

/* =========================================================
   Grille produits (droite)
   ========================================================= */

/* .recommendations__section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    color: #393E42;
} */

.recommendations__section + .recommendations__section {
    margin-top: 24px;
}

.recommendations__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    grid-auto-rows: 1fr;
}

.recommendations__grid > * {
    height: 100%;
}

.recommendations__grid > * > .recommendations__card {
    height: 100%;
}

@media (max-width: 575px) {
    .recommendations__grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Card accessoire
   ========================================================= */

.recommendations__card {
    position: relative;
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    /* padding: 12px; */
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: outline 120ms ease-in-out;
    height: 100%;
}

.recommendations__card.accessory--checked {
    outline: 2px solid #C2D244;
    border-color: transparent;
}

.recommendations__card-body {
    display: flex;
    flex: 1;
    gap: 10px;
    align-items: center;
}

body .recommendations__card-body .touchspin-rounded-container>.input-group {
    max-width: 120px;
}

.recommendations__card-img {
    display: block;
    width: auto;
    max-width: 130px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.recommendations__card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 35px;
    height: 100%;
    padding-block: 10px;
}

.recommendations__card-name {
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 0;
}

.recommendations__card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.recommendations__card-bottom .price,
.recommendations__card-bottom .js-price-ttc {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.recommendations__card-bottom .label-ht {
    font-size: 11px;
}

.recommendations__card-bottom .recommendations__card-price-ht {
    display: flex;
    align-items: baseline;
    gap: 3px;
    flex-wrap: nowrap;
}

.recommendations__card-bottom .recommendations__card-price-ht .price {
    font-size: 13px;
}

.recommendations__cta--mobile,
.recommendations__mobile-header,
.recommendations__mobile-footer {
    display: none;
}

/* Bouton panier unitaire : conservé dans le DOM pour la logique OOS JS, masqué visuellement */
.recommendations__card .recommendations__accessory-btn {
    display: none !important;
}

.btn-reco-kit-cta-composition {
    text-transform: uppercase;
}

/* Form interne : uniquement le touchspin */
.recommendations__card .recommendations__accessory-form {
    column-gap: 0;
    flex: 0 0 auto;
}

/* =========================================================
   "Voir plus / Réduire" alternatifs
   ========================================================= */

.js-reco-alt-hidden {
    display: none;
}

.recommendations__view-more {
    margin-top: 12px;
    padding: 0;
    font-size: 0.875rem;
    text-decoration: underline;
    color: #393E42;
}

/* =========================================================
   Accessoire : form quantité + bouton panier
   ========================================================= */

.recommendations .recommendations__accessory-form {
    display: flex;
    column-gap: 20px;
    cursor: auto;
}

.recommendations .recommendations__accessory-form * {
    cursor: auto;
}

.recommendations .recommendations__accessory-form .accessory-qty {
    cursor: text;
}

.recommendations .recommendations__accessory-form .btn-touchspin {
    cursor: pointer;
}

.recommendations .recommendations__accessory-form .recommendations__accessory-btn {
    flex: 0 0 50px;
    border-radius: 50rem;
    max-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   Checkbox custom (https://moderncss.dev/pure-css-custom-checkbox-style/)
   ========================================================= */

.recommendations__checkbox--checkbox {
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.55em;
    height: 1.55em;
    border: 1px solid #535353;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out;
}

.recommendations__checkbox--checkbox:checked {
    background-color: #C2D244;
    border-color: #C2D244;
}

.recommendations__checkbox--checkbox::before {
    content: "";
    bottom: 2px;
    position: relative;
    width: 0.55em;
    height: 0.9em;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) scale(0) translateY(-0.05em);
    transition: 120ms transform ease-in-out;
}

.recommendations__checkbox--checkbox:checked::before {
    transform: rotate(45deg) scale(1) translateY(-0.05em);
}

/* =========================================================
   OOS popper
   ========================================================= */

.recommendations__popper-container {
    position: relative;
}

.recommendations__popper-container .recommendations__popper {
    position: absolute;
    /* top: -30px;
    right: 12px; */
    cursor: help;
    display: none;
}

body.recommendations-mobile-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .recommendations__body {
        gap: 24px;
    }

    .recommendations__cta--desktop {
        display: none;
    }

    .recommendations__cta--mobile {
        display: block;
    }

    .recommendations__mobile-open {
        width: 100%;
    }

    .recommendations__right {
        position: fixed;
        inset: 0;
        z-index: 1040;
        display: flex;
        flex-direction: column;
        gap: 0;
        background-color: #fff;
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 180ms ease-out, opacity 180ms ease-out;
    }

    .recommendations.recommendations--mobile-open .recommendations__right {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .recommendations__mobile-header,
    .recommendations__mobile-footer {
        display: block;
        background-color: #fff;
    }

    .recommendations__mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
        border-bottom: 1px solid #e8e8e8;
        background-color: #f4f4f4;
    }

    .recommendations__mobile-main-product {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        flex: 1;
        min-width: 0;
    }

    .recommendations__mobile-main-image {
        width: 72px;
        height: 72px;
        object-fit: contain;
        border-radius: 8px;
        background-color: #fff;
        flex-shrink: 0;
    }

    .recommendations__mobile-main-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .recommendations__mobile-main-title {
        font-size: 0.95rem;
        line-height: 1.35;
        font-weight: 600;
        color: #393E42;
    }

    .recommendations__mobile-main-color-price-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
    }

    .js-reco-mobile-attrs-color {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .recommendations__mobile-attr-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .recommendations__mobile-attr-swatch {
        display: inline-block;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 1px solid rgba(0, 0, 0, 0.15);
        flex-shrink: 0;
    }

    .recommendations__mobile-attr-label {
        font-size: 0.8rem;
        font-weight: 700;
        color: #393E42;
    }

    .js-reco-mobile-attrs-text {
        font-size: 0.8rem;
        line-height: 1.4;
        color: #555;
    }

    .recommendations__mobile-main-price {
        font-size: 0.95rem;
        font-weight: 700;
        color: #393E42;
        min-height: 1.5em;
        display: inline-block;
    }

    .recommendations__mobile-close {
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #393E42;
    }

    .recommendations__mobile-scroll {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 20px 16px 24px;
    }

    .recommendations__mobile-footer {
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid #e8e8e8;
        box-shadow: 0 -10px 30px rgba(57, 62, 66, 0.08);
    }

    .recommendations__price-block--mobile {
        gap: 10px;
        margin-bottom: 12px;
    }

    .recommendations__price-header {
        padding: 10px 14px;
    }

    .recommendations__price-header-label {
        font-size: 0.85rem;
    }

    .recommendations__price-header-value {
        font-size: 1.5rem;
    }

    .recommendations__price-summary {
        gap: 10px;
    }

    .recommendations__price-column-label {
        font-size: 0.72rem;
    }

    .recommendations__price-value {
        font-size: 0.9rem;
    }

    .recommendations__price-separator {
        font-size: 1.1rem;
    }

    .recommendations__cta--mobile-submit .recommendations__addselectiontocart {
        width: 100%;
    }

    .recommendations__section-title {
        margin-bottom: 12px;
    }

    .recommendations__section + .recommendations__section {
        margin-top: 24px;
    }

    .recommendations__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .recommendations__section--alternatives .js-reco-alt-hidden {
        display: block;
    }

    .recommendations__view-more {
        display: none;
    }

    .recommendations__card {
        border-radius: 4px;
        padding: 14px;
    }

    .recommendations__card-body {
        gap: 12px;
    }


    .recommendations__card-info {
        gap: 10px;
        padding-right: 40px;
    }

    .recommendations__card-name {
        font-size: 0.9rem;
    }

    .recommendations__card-bottom {
        align-items: flex-end;
    }

    .recommendations .recommendations__accessory-form {
        column-gap: 12px;
    }

    .recommendations__checkbox--checkbox {
        top: 14px;
        right: 14px;
    }

    .recommendations__popper-container .recommendations__popper {
        /* top: 14px;
        right: 48px; */
    }

    body#product.recommendations-mobile-open .cta-fixed {
        display: none !important;
    }
}
