/* ═══════════════════════════════════════════════════════
   efan's CART DRAWER — slide-in cart panel
════════════════════════════════════════════════════════ */

body.efans-cart-open {
    overflow: hidden;
}

/* ── Overlay ── */
.efans-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 26, 14, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99990;
}
.efans-cart-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Panel ── */
.efans-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(420px, 100vw);
    background: #fff;
    box-shadow: -12px 0 40px rgba(45, 26, 14, 0.18);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s 0.35s;
    z-index: 99991;
    display: flex;
    flex-direction: column;
    outline: none;
}
.efans-cart-drawer.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── Head ── */
.efans-cart-drawer__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #eee9df;
    flex: 0 0 auto;
}
.efans-cart-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    background: none;
    color: #000;
    border: none;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    transition: color 0.2s;
}
.efans-cart-drawer__close:hover {
    background: none;
    color: #555;
}
.efans-cart-drawer__title {
    font-family: 'Figtree', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #2D1A0E;
    margin: 0;
    line-height: 1;
}
.efans-cart-drawer__head-count {
    font-family: 'Figtree', sans-serif;
    font-size: 13px;
    color: #8a8478;
}

/* ── Contents (fragment target) ── */
.efans-cart-drawer__contents {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ── Items ── */
.efans-cart-drawer__items {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.efans-cd-item {
    display: flex;
    gap: 12px;
    border: 1px solid #ece7dc;
    padding: 12px;
    background: #fff;
    transition: opacity 0.2s;
}
.efans-cd-item.is-removing {
    opacity: 0.45;
    pointer-events: none;
}
.efans-cd-item__thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    display: block;
    border: 1px solid #f1ede4;
    overflow: hidden;
}
.efans-cd-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.efans-cd-item__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.efans-cd-item__toprow {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.efans-cd-item__name {
    flex: 1 1 auto;
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #2D1A0E;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.efans-cd-item__name:hover {
    color: #9f8a54;
}
.efans-cd-item__remove {
    flex: 0 0 auto;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
    transition: color 0.2s;
}
.efans-cd-item .efans-cd-item__remove,
.efans-cd-item .efans-cd-item__remove:hover,
.efans-cd-item .efans-cd-item__remove:focus,
.efans-cd-item .efans-cd-item__remove:active {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    color: #b3ac9e;
}
.efans-cd-item .efans-cd-item__remove:hover {
    color: #b0413e;
}

/* Item meta (variation attributes, delivery date) */
.efans-cd-item__meta,
.efans-cd-item__meta dl.variation {
    font-family: 'Figtree', sans-serif;
    font-size: 12px;
    color: #8a8478;
    margin: 0;
}
.efans-cd-item__meta dl.variation {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
}
.efans-cd-item__meta dl.variation dt,
.efans-cd-item__meta dl.variation dd {
    margin: 0;
    display: inline;
    font-weight: 400;
}
.efans-cd-item__meta dl.variation dd p {
    display: inline;
    margin: 0;
    font-size: 12px;
}

/* Qty + price row */
.efans-cd-item__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}
.efans-cd-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d9d2c3;
    font-family: 'Figtree', sans-serif;
}
.efans-cd-qty--single {
    border: none;
    font-size: 13px;
    color: #8a8478;
}
.efans-cd-qty__btn {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
    font-size: 16px;
    line-height: 1;
    color: #2D1A0E;
    transition: background 0.2s;
}
.efans-cd-qty .efans-cd-qty__btn,
.efans-cd-qty .efans-cd-qty__btn:hover,
.efans-cd-qty .efans-cd-qty__btn:focus,
.efans-cd-qty .efans-cd-qty__btn:active,
.efans-cd-qty .efans-cd-qty__btn:disabled,
.efans-cd-qty .efans-cd-qty__btn:disabled:hover {
    background: none;
    color: #2D1A0E;
    outline: none;
    box-shadow: none;
}
.efans-cd-qty .efans-cd-qty__btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.efans-cd-qty.is-busy {
    opacity: 0.5;
    pointer-events: none;
}
.efans-cd-qty__val {
    min-width: 26px;
    text-align: center;
    font-size: 14px;
    color: #2D1A0E;
}

/* Price */
.efans-cd-item__price {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-family: 'Figtree', sans-serif;
}
.efans-cd-item__price-now {
    font-size: 15px;
    font-weight: 600;
    color: #2D1A0E;
}
.efans-cd-item__price-was {
    font-size: 12.5px;
    color: #a29b8d;
}
.efans-cd-item__price-off {
    font-size: 12.5px;
    font-weight: 600;
    color: #2e7d4f;
}

/* ── Footer ── */
.efans-cart-drawer__footer {
    flex: 0 0 auto;
    border-top: 1px solid #eee9df;
}
.efans-cart-drawer__savings {
    background: #eaf6ee;
    color: #2e7d4f;
    font-family: 'Figtree', sans-serif;
    font-size: 13px;
    text-align: center;
    padding: 9px 16px;
}
.efans-cart-drawer__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px 10px;
}
.efans-cart-drawer__total {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.efans-cart-drawer__total-amount {
    font-family: 'Figtree', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: #2D1A0E;
}
.efans-cart-drawer__total-amount .woocommerce-Price-amount {
    font-weight: 700;
}
.efans-cart-drawer__total-label {
    font-family: 'Figtree', sans-serif;
    font-size: 11.5px;
    color: #8a8478;
}

/* Buttons */
.efans-cart-drawer__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #A18A57;
    color: #fff !important;
    font-family: 'Figtree', sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.2px;
    height: 46px;
    padding: 0 28px;
    border: none;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.efans-cart-drawer__btn:hover {
    background: #8e794b;
    color: #fff;
}
.efans-cart-drawer__note {
    font-family: 'Figtree', sans-serif;
    font-size: 11.5px;
    color: #a29b8d;
    text-align: center;
    margin: 0;
    padding: 0 20px 14px;
}

/* ── Empty state ── */
.efans-cart-drawer__empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 40px 28px;
    color: #d8cdb4;
}
.efans-cart-drawer__empty-title {
    font-family: 'Figtree', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #2D1A0E;
    margin: 12px 0 0;
}
.efans-cart-drawer__empty-text {
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    color: #8a8478;
    margin: 0 0 14px;
}

/* ── Error toast ── */
.efans-cart-toast {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translate(-50%, -8px);
    max-width: min(480px, calc(100vw - 32px));
    background: #fff;
    border-left: 3px solid #b0413e;
    box-shadow: 0 8px 30px rgba(45, 26, 14, 0.18);
    padding: 12px 18px;
    font-family: 'Figtree', sans-serif;
    font-size: 14px;
    color: #2D1A0E;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100001;
}
.efans-cart-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.efans-cart-toast ul,
.efans-cart-toast .woocommerce-error {
    list-style: none;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}
.efans-cart-toast a {
    color: #9f8a54;
}

/* ── Small screens ── */
@media (max-width: 520px) {
    .efans-cart-drawer {
        width: 100vw;
    }
    .efans-cart-drawer__foot {
        flex-direction: column;
        align-items: stretch;
    }
    .efans-cart-drawer__total {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        justify-content: space-between;
    }
    .efans-cart-drawer__btn.efans-cart-drawer__proceed {
        width: 100%;
    }
}
