/**
 * Interactive Mini-Cart – Frontend Styles
 *
 * Apple-style slide-out drawer with smooth animations.
 * All visual properties use sensible defaults.
 * Elementor overrides them via dynamic CSS (selectors target global classes).
 *
 * Prefix: wooready-mc-
 *
 * @package WooReadyDEB2B\Modules\MiniCart
 */

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.wooready-mc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wooready-mc-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ── Drawer ───────────────────────────────────────────────────────────────── */
.wooready-mc-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--mc-width, 420px);
    max-width: 100vw;
    z-index: 99999;
    background: #fff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

.wooready-mc-drawer--right {
    right: 0;
    transform: translateX(100%);
}

.wooready-mc-drawer--left {
    left: 0;
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
}

.wooready-mc-drawer.is-open {
    transform: translateX(0);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.wooready-mc-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #F2F2F7;
    flex-shrink: 0;
}

.wooready-mc-drawer__title {
    font-size: 17px;
    font-weight: 600;
    color: #1D1D1F;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wooready-mc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #FF2D55;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.wooready-mc-count:empty,
.wooready-mc-count[data-mc-count="0"] {
    display: none;
}

.wooready-mc-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #F2F2F7;
    color: #86868B;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wooready-mc-drawer__close:hover {
    background: #E5E5EA;
    color: #1D1D1F;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */
.wooready-mc-drawer__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.wooready-mc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #86868B;
}

.wooready-mc-empty__icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.wooready-mc-empty p {
    font-size: 15px;
    margin: 0;
}

/* ── Items List ───────────────────────────────────────────────────────────── */
.wooready-mc-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wooready-mc-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #F2F2F7;
    transition: background 0.15s ease, opacity 0.3s ease, transform 0.25s ease;
    position: relative;
}

.wooready-mc-item.is-removing {
    opacity: 0;
    transform: translateX(40px);
}

.wooready-mc-item.is-updating {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Thumbnail ────────────────────────────────────────────────────────────── */
.wooready-mc-item__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #F5F5F7;
}

.wooready-mc-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Details ──────────────────────────────────────────────────────────────── */
.wooready-mc-item__details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wooready-mc-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.wooready-mc-item__name {
    font-size: 14px;
    font-weight: 500;
    color: #1D1D1F;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wooready-mc-item__name:hover {
    color: #FF2D55;
}

.wooready-mc-item__remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #C7C7CC;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}

.wooready-mc-item__remove:hover {
    background: #FFE5E9;
    color: #FF2D55;
}

.wooready-mc-item__variation {
    font-size: 12px;
    color: #86868B;
    line-height: 1.3;
}

/* ── Item Footer (qty + price) ────────────────────────────────────────────── */
.wooready-mc-item__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.wooready-mc-item__qty-text {
    font-size: 13px;
    color: #86868B;
}

.wooready-mc-item__price {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
    white-space: nowrap;
}

/* ── Quantity Controls ────────────────────────────────────────────────────── */
.wooready-mc-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #E5E5EA;
    border-radius: 8px;
    overflow: hidden;
    height: 32px;
}

.wooready-mc-qty__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #1D1D1F;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
    padding: 0;
    line-height: 1;
}

.wooready-mc-qty__btn:hover {
    background: #F2F2F7;
}

.wooready-mc-qty__btn:active {
    background: #E5E5EA;
}

.wooready-mc-qty__value {
    min-width: 28px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
    border-left: 1.5px solid #E5E5EA;
    border-right: 1.5px solid #E5E5EA;
    line-height: 32px;
    padding: 0 2px;
}

/* ── Stock Hint ───────────────────────────────────────────────────────────── */
.wooready-mc-item__stock {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #FF9500;
    margin-top: 2px;
}

/* ── Cross-Sells ──────────────────────────────────────────────────────────── */
.wooready-mc-cross-sells {
    padding: 16px 20px 20px;
    border-top: 1px solid #F2F2F7;
}

.wooready-mc-cross-sells__title {
    font-size: 13px;
    font-weight: 600;
    color: #86868B;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 12px;
}

.wooready-mc-cross-sells__grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wooready-mc-cross-sell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: #F5F5F7;
    text-decoration: none;
    transition: background 0.15s ease;
}

.wooready-mc-cross-sell:hover {
    background: #E8E8ED;
}

.wooready-mc-cross-sell__img {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wooready-mc-cross-sell__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wooready-mc-cross-sell__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wooready-mc-cross-sell__name {
    font-size: 13px;
    font-weight: 500;
    color: #1D1D1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wooready-mc-cross-sell__price {
    font-size: 12px;
    color: #86868B;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.wooready-mc-drawer__footer {
    flex-shrink: 0;
    border-top: 1px solid #F2F2F7;
    padding: 16px 20px;
    background: #fff;
}

.wooready-mc-drawer__footer:empty {
    display: none;
}

.wooready-mc-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 15px;
    color: #1D1D1F;
}

.wooready-mc-subtotal__amount {
    font-weight: 700;
    font-size: 17px;
}

.wooready-mc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wooready-mc-btn {
    display: block;
    text-align: center;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.1s ease;
    cursor: pointer;
    border: none;
}

.wooready-mc-btn:active {
    transform: scale(0.98);
}

.wooready-mc-btn--primary {
    background: #FF2D55;
    color: #fff;
}

.wooready-mc-btn--primary:hover {
    opacity: 0.88;
    color: #fff;
}

.wooready-mc-btn--secondary {
    background: #F2F2F7;
    color: #1D1D1F;
}

.wooready-mc-btn--secondary:hover {
    background: #E5E5EA;
    color: #1D1D1F;
}

/* ── Cart Toggle Button (Elementor Widget / standalone) ───────────────────── */
.wooready-mc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    font-size: inherit;
    color: inherit;
    padding: 0;
}

.wooready-mc-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wooready-mc-toggle__badge {
    position: absolute;
    top: -6px;
    right: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #FF2D55;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.wooready-mc-toggle__badge:empty,
.wooready-mc-toggle__badge[data-mc-badge="0"] {
    display: none;
}

.wooready-mc-toggle__label {
    font-weight: 500;
}

/* ── Hybrid Price (Modul 1) Integration ───────────────────────────────────── */
.wooready-mc-item__price .wooready-dual-price,
.wooready-mc-subtotal__amount .wooready-dual-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    line-height: 1.3;
}

.wooready-mc-item__price .wooready-price-primary .wooready-price-amount {
    font-size: inherit;
    font-weight: inherit;
}

.wooready-mc-item__price .wooready-price-secondary {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
}

.wooready-mc-item__price .wooready-price-vat {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.6;
}

.wooready-mc-subtotal__amount .wooready-price-primary .wooready-price-amount {
    font-size: inherit;
    font-weight: inherit;
}

.wooready-mc-subtotal__amount .wooready-price-secondary {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.7;
}

.wooready-mc-subtotal__amount .wooready-price-vat {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
}

.wooready-mc-cross-sell__price .wooready-dual-price {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.3;
}

.wooready-mc-cross-sell__price .wooready-price-secondary {
    font-size: 10px;
    opacity: 0.7;
}

.wooready-mc-cross-sell__price .wooready-price-vat {
    display: none;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
    .wooready-mc-drawer {
        width: 100vw !important;
        max-width: 100vw;
    }

    .wooready-mc-item__thumb {
        width: 56px;
        height: 56px;
    }
}
