/* ============================================================
   kagencycrossselling — Styles front-office
   Préfixe : ucsm-*  (aucun conflit avec le thème Hummingbird)
   ============================================================ */

/* ------------------------------------------------------------------ */
/* BLOCS CROSS-SELLING                                                 */
/* ------------------------------------------------------------------ */

.ucsm-block {
    margin: 2rem 0;
}

.ucsm-block--modal {
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bs-border-color, #e5e7eb);
}

.ucsm-block--modal .ucsm-block__title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}

.ucsm-block__carousel {
    position: relative;
}

/* Peu de produits : on évite que les cartes s'étirent en très grand.
   Le thème gère déjà [data-products-count="1"] ; on applique la même
   logique de largeur max pour 2 et 3 produits. Les cartes gardent leur
   taille normale et s'alignent à gauche. */
.ucsm-block .featured-products__carousel[data-products-count="2"] .featured-products__slide,
.ucsm-block .featured-products__carousel[data-products-count="3"] .featured-products__slide {
    max-width: var(--featured-product-single-max-width, 24rem);
}

.ucsm-block__grid > .js-product.product {
    min-width: 0;
}

.ucsm-block__item .product-miniature {
    height: 100%;
}

.ucsm-block__item .product-miniature__inner {
    height: 100%;
}

.ucsm-block__carousel .carousel-item > .row {
    margin-left: 0;
    margin-right: 0;
}

.ucsm-block__carousel .carousel-item [class*='col-'] {
    min-width: 0;
}

.ucsm-block__control {
    z-index: 3;
}

.ucsm-block--modal .ucsm-block__carousel,
.ucsm-block--modal .row {
    max-width: 48rem;
}

.ucsm-block--modal .product-miniature__title,
.ucsm-block--modal .product-miniature__title * {
    font-size: 0.95rem;
}

.ucsm-block--modal .product-miniature__price {
    font-size: 0.95rem;
}

@media (min-width: 992px) {
    .ucsm-block--modal {
        padding-top: 1rem;
    }

    .ucsm-block--modal .ucsm-block__title {
        margin-bottom: 1.25rem;
        font-size: 1.5rem;
    }
}

/* ------------------------------------------------------------------ */
/* MODALE UPSELL                                                        */
/* ------------------------------------------------------------------ */

.ucsm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ucsm-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 0;
}

body.ucsm-modal-open {
    overflow: hidden;
}

.ucsm-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: ucsmSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ucsmSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Header */
.ucsm-modal__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.ucsm-modal__headline {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.ucsm-modal__timer {
    text-align: right;
    flex-shrink: 0;
}

.ucsm-modal__timer-label {
    font-size: 0.7rem;
    opacity: 0.85;
    display: block;
    margin-bottom: 2px;
}

.ucsm-modal__countdown {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    display: block;
    transition: color 0.3s ease;
}

.ucsm-modal__countdown.ucsm-countdown--urgent {
    color: #fed7d7;
    animation: ucsmPulse 1s ease-in-out infinite;
}

@keyframes ucsmPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* Badge remise */
.ucsm-modal__offer-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e53e3e;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.4);
}

/* Corps */
.ucsm-modal__body {
    padding: 1.5rem;
    position: relative;
}

.ucsm-modal__product {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.ucsm-modal__product-image {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.ucsm-modal__product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ucsm-modal__product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ucsm-modal__product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.35;
}

.ucsm-modal__product-name:hover {
    color: #667eea;
}

.ucsm-modal__prices {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ucsm-modal__price-original {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
}

.ucsm-modal__price-discounted {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e53e3e;
}

/* Footer boutons */
.ucsm-modal__footer {
    padding: 1rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.ucsm-modal__btn-accept {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.ucsm-modal__btn-accept:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ucsm-modal__btn-accept:active {
    transform: translateY(0);
}

.ucsm-modal__btn-refuse {
    width: 100%;
    padding: 0.4rem;
    font-size: 0.85rem;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color 0.2s ease;
}

.ucsm-modal__btn-refuse:hover {
    color: #666;
    text-decoration-color: #666;
}

/* Indicateur offre courante */
.ucsm-modal__offer-indicator {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding-bottom: 0.75rem;
    background: #fafafa;
}

.ucsm-modal__offer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s ease, transform 0.3s ease;
}

.ucsm-modal__offer-dot--active {
    background: #667eea;
    transform: scale(1.3);
}

/* Mobile */
@media (max-width: 480px) {
    .ucsm-modal__header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ucsm-modal__timer {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .ucsm-modal__countdown {
        font-size: 1.25rem;
    }

    .ucsm-modal__product {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ucsm-modal__product-image {
        width: 130px;
        height: 130px;
    }

    .ucsm-modal__prices {
        justify-content: center;
    }
}

/* ------------------------------------------------------------------ */
/* STYLES ADMIN DASHBOARD                                              */
/* ------------------------------------------------------------------ */

.ucsm-dashboard__card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    margin-bottom: 1.5rem;
    border-radius: 10px;
}

.ucsm-dashboard__card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.ucsm-kpi-card .ucsm-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ucsm-kpi-card .ucsm-kpi-label {
    font-size: 0.85rem;
    color: #666;
}
