/* ============================================
   NUTRAGILE - Mini-panier latéral
   ============================================ */

/* Container */
.nt-minicart {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
}

.nt-minicart.is-open {
    pointer-events: auto;
    visibility: visible;
}

/* Overlay sombre */
.nt-minicart__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.nt-minicart.is-open .nt-minicart__overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Panel latéral */
.nt-minicart__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 371.2px;
    max-width: 90vw;
    height: 100%;
    background: var(--nutragile-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.nt-minicart.is-open .nt-minicart__panel {
    transform: translateX(0);
}

/* ---- Header ---- */
.nt-minicart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 19.2px;
    border-bottom: 1px solid var(--nutragile-cream);
    flex-shrink: 0;
}

.nt-minicart__title {
    font-family: var(--nutragile-font);
    font-weight: 400;
    font-size: 26px;
    color: var(--nutragile-text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nt-minicart__count {
    font-family: var(--nutragile-font-link);
    background: var(--nutragile-green-bright);
    color: var(--nutragile-white);
    font-size: 16px;
    font-weight: 500;
    min-width: 19.2px;
    height: 19.2px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11.2px;
    margin-top: 3.2px;
}

.nt-minicart__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28.8px;
    height: 28.8px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--nutragile-text-light);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.nt-minicart__close:hover {
    background: var(--nutragile-white);
    color: var(--nutragile-text-dark);
}

/* ---- Body : liste produits ---- */
.nt-minicart__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.nt-minicart__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    font-family: 'Fredoka', sans-serif;
    font-size: 12px;
    color: var(--nutragile-text-light);
}

.nt-minicart__products {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ---- Produit individuel ---- */
.nt-minicart__product {
    display: flex;
    gap: 11.2px;
    padding: 12.8px 19.2px;
    border-bottom: 1px solid var(--nutragile-cream);
    position: relative;
}

.nt-minicart__product-img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--nutragile-white);
}

.nt-minicart__product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nt-minicart__product-info {
    flex: 1;
    min-width: 0;
}

.nt-minicart__product-name {
    font-family: var(--nutragile-font-link);
    font-weight: 500;
    font-size: 13px;
    color: var(--nutragile-text-dark);
    margin: 0 0 1.6px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nt-minicart__product-name:hover {
    color: var(--nutragile-green-bright);
}

.nt-minicart__product-variant {
    font-family: var(--nutragile-font-link);
    font-weight: 300;
    font-size: 13px;
    color: var(--nutragile-text-light);
    margin: 0 0 4.8px;
}

.nt-minicart__product-price {
    font-family: var(--nutragile-font-link);
    font-weight: 500;
    font-size: 13px;
    color: var(--nutragile-text-dark);
    margin: 0 0 6.4px;
}

/* Quantité +/- dans le mini-cart */
.nt-minicart__product-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--nutragile-cream);
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
}

.nt-minicart__qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22.4px;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #333;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.15s ease;
    padding: 0;
}

.nt-minicart__qty-btn:hover {
    background: var(--nutragile-white);
}

.nt-minicart__qty-value {
    font-family: var(--nutragile-font);
    font-weight: 400;
    font-size: 11px;
    color: var(--nutragile-text-dark);
    min-width: 22.4px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bouton supprimer */
.nt-minicart__product-remove {
    position: absolute;
    top: 11.2px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22.4px;
    height: 22.4px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s ease;
    padding: 0;
}

.nt-minicart__product-remove:hover {
    color: var(--nutragile-red);
}

/* ---- Footer : totaux + CTA ---- */
.nt-minicart__footer {
    flex-shrink: 0;
    padding: 16px 19.2px;
    border-top: 1px solid var(--nutragile-cream);
    background: var(--nutragile-white);
}

.nt-minicart__totals {
    margin: 0 0 12.8px;
}

.nt-minicart__total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--nutragile-font-link);
    font-weight: 300;
    font-size: 13px;
    color: var(--nutragile-text-light);
    padding: 3.2px 0;
}

.nt-minicart__total-line--grand {
    font-family: var(--nutragile-font-link);
    font-weight: 500;
    font-size: 14px;
    color: var(--nutragile-text-dark);
    border-top: 1px solid var(--nutragile-cream);
    padding-top: 8px;
    margin-top: 4.8px;
}

.nt-minicart__checkout-btn {
    display: block;
    width: 100%;
    padding: 11.2px 16px;
    background: var(--nutragile-green-bright);
    color: var(--nutragile-white);
    font-family: var(--nutragile-font);
    font-weight: 400;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    border: 2px solid var(--nutragile-green-bright) !important;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nt-minicart__checkout-btn:hover {
    color: var(--nutragile-green-bright);
    background: transparent;
    text-decoration: none;
}

.nt-minicart__continue {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: transparent;
    border: none;
    font-family: var(--nutragile-font);
    font-weight: 400;
    font-size: 13px;
    color: var(--nutragile-text-dark);
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
}

.nt-minicart__continue:hover {
    color: var(--nutragile-green-bright);
}

/* ---- États ---- */
.nt-minicart__body[data-empty="true"] .nt-minicart__products,
.nt-minicart__body[data-empty="false"] .nt-minicart__empty {
    display: none;
}

.nt-minicart__body[data-empty="true"] ~ .nt-minicart__footer {
    display: none;
}

.nt-minicart {
    transition: visibility 0.3s ease;
}

.nt-minicart.is-open {
    transition: visibility 0s;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .nt-minicart__panel {
        width: 100vw;
        max-width: 100vw;
    }

    .nt-minicart__product {
        padding: 11.2px 12.8px;
    }

    .nt-minicart__header,
    .nt-minicart__footer {
        padding: 12.8px;
    }
}

/* ---- Empêcher le scroll body quand ouvert ---- */
body.minicart-open {
    overflow: hidden;
}
