/*
 * Escale Nature — Header actions (search, account, cart drawer)
 * Variables UiCore natives
 */

/* ─── Header actions (Mon compte + Panier) ───────────────────────── */
.en-header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.en-account-btn,
.en-cart-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--uicore-headline-color);
    text-decoration: none;
    font-family: var(--uicore-text-font-family);
    padding: 0;
    transition: opacity .15s;
}
.en-account-btn:hover,
.en-cart-btn:hover {
    opacity: .7;
}
.en-account-btn:hover svg,
.en-cart-btn:hover svg {
    opacity: 1;
    color: var(--uicore-secondary-color);
}
.en-action-label {
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--uicore-headline-color);
    white-space: nowrap;
    font-weight: 400;
}

/* Icône panier + badge count */
.en-cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.en-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    background: var(--uicore-primary-color);
    color: var(--uicore-white-color);
    font-size: 10px;
    font-family: var(--uicore-text-font-family);
    font-weight: 500;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.en-cart-count[hidden] { display: none; }

/* ─── Side Cart Drawer ───────────────────────────────────────────── */
.en-side-cart {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
}
.en-side-cart.is-open {
    pointer-events: all;
    visibility: visible;
}

/* Backdrop */
.en-side-cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 34, 49, .45);
    opacity: 0;
    transition: opacity .3s ease;
    cursor: pointer;
}
.en-side-cart.is-open .en-side-cart-backdrop {
    opacity: 1;
}

/* Panel */
.en-side-cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 95vw;
    background: var(--uicore-white-color);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -4px 0 24px rgba(18, 34, 49, .08);
}
.en-side-cart.is-open .en-side-cart-panel {
    transform: translateX(0);
}

/* Header */
.en-side-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ui-border-color);
    flex-shrink: 0;
}
.en-side-cart-title {
    font-family: var(--uicore-primary-font-family);
    font-size: 26px;
    font-weight: 400;
    color: var(--uicore-headline-color);
    margin: 0;
}
.en-side-cart-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--uicore-body-color);
    border-radius: var(--ui-radius);
    transition: background .15s, color .15s;
}
.en-side-cart-close:hover {
    background: var(--uicore-light-color);
    color: var(--uicore-headline-color);
}

/* Body — scroll */
.en-side-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.en-side-cart-body::-webkit-scrollbar { width: 4px; }
.en-side-cart-body::-webkit-scrollbar-track { background: transparent; }
.en-side-cart-body::-webkit-scrollbar-thumb { background: var(--ui-border-color); border-radius: 2px; }

/* Panier vide */
.en-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    color: var(--uicore-body-color);
    text-align: center;
}
.en-cart-empty svg { opacity: .3; }
.en-cart-empty p {
    font-size: 14px;
    font-family: var(--uicore-text-font-family);
    margin: 0;
}
.en-cart-shop-link {
    font-size: 12px;
    font-family: var(--uicore-text-font-family);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--uicore-headline-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Item panier */
.en-cart-item {
    display: grid;
    grid-template-columns: 72px 1fr 24px;
    gap: .75rem;
    align-items: start;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--ui-border-color);
}
.en-cart-item:last-child { border-bottom: none; }

.en-cart-item-thumb img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--ui-radius-sm);
    display: block;
}
.en-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.en-cart-item-name {
    font-family: var(--uicore-text-font-family);
    font-size: 14px;
    color: var(--uicore-headline-color);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.en-cart-item-name:hover { text-decoration: underline; }
.en-cart-item-meta {
    font-size: 11px;
    color: var(--uicore-body-color);
    font-family: var(--uicore-text-font-family);
    margin: 0;
}
.en-cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: 4px;
}
.en-cart-item-price {
    font-size: 13px;
    font-weight: 500;
    color: var(--uicore-headline-color);
    font-family: var(--uicore-text-font-family);
}
.en-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--ui-border-color);
    border-radius: var(--ui-radius-sm);
    overflow: hidden;
    height: 28px;
}
.en-cart-qty-btn {
    width: 26px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    color: var(--uicore-headline-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
    flex-shrink: 0;
}
.en-cart-qty-btn:hover { background: var(--uicore-light-color); }
.en-cart-item-qty span {
    font-size: 12px;
    font-family: var(--uicore-text-font-family);
    color: var(--uicore-headline-color);
    padding: 0 6px;
    min-width: 24px;
    text-align: center;
}
.en-cart-item-remove {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--uicore-body-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--ui-radius-sm);
    transition: background .15s, color .15s;
    margin-top: 2px;
}
.en-cart-item-remove:hover {
    background: var(--uicore-light-color);
    color: var(--uicore-headline-color);
}

/* Footer */
.en-side-cart-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--ui-border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.en-cart-totals {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-family: var(--uicore-text-font-family);
    color: var(--uicore-headline-color);
}
.en-cart-subtotal { font-weight: 500; }
.en-cart-shipping-note {
    font-size: 14px;
    color: var(--uicore-body-color);
    font-family: var(--uicore-text-font-family);
    margin: 0;
    text-align: center;
}
.en-cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    background: var(--uicore-primary-color);
    color: var(--uicore-white-color) !important;
    border-radius: var(--ui-radius);
    font-family: var(--uicore-text-font-family);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: background .15s;
}
.en-cart-checkout-btn:hover { background: var(--e-global-color-uicore_secondary); color: var(--uicore-primary-color) !important; }
.en-cart-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    background: none;
    color: var(--uicore-headline-color) !important;
    border: 1px solid var(--ui-border-color);
    border-radius: var(--ui-radius);
    font-family: var(--uicore-text-font-family);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: border-color .15s, background .15s;
}
.en-cart-view-btn:hover {
    border-color: var(--uicore-primary-color);
    background: var(--uicore-primary-color);
    color: white !important;
}

/* Loading state */
.en-side-cart-body.is-loading {
    opacity: .5;
    pointer-events: none;
}

/* Body scroll lock */
body.en-cart-open {
    overflow: hidden;
}
