/* ============================================================
   VIVA WooCommerce Mini Cart – adapted from Divi version
   ============================================================ */

/* Cart icon wrapper in header .car div */
.car .viva-cart-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.car .viva-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d9534f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    line-height: 1;
    font-family: sans-serif;
    z-index: 10;
    pointer-events: none;
}

/* Price on Request label */
.viva-poa {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* ── Mini Cart Panel ───────────────────────────────────────── */
.cd-mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
    z-index: 9999;
    border-radius: 30px 0 0 30px;
    display: flex;
    flex-direction: column;
}

.cd-mini-cart.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

body.admin-bar .cd-mini-cart {
    top: 32px;
    height: calc(100vh - 32px);
}

/* ── Inner Layout ──────────────────────────────────────────── */
.cd-mini-cart-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 40px 40px 30px 50px;
    box-sizing: border-box;
}

.cd-mini-cart-header {
    display: flex;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(23, 23, 23, 0.2);
    margin-bottom: 20px;
    flex-shrink: 0;
}

.cd-cart-title {
    font-size: 32px;
    font-weight: 600;
    color: #1d1d1d;
    margin: 0;
    padding: 0;
}

.cd-close-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #000;
    background: transparent;
    color: #333;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    margin-left: auto;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.cd-close-cart span {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.cd-close-cart::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #000;
    border-radius: 50%;
    z-index: 0;
    transition: height 0.3s ease;
}

.cd-close-cart:hover::before { height: 100%; }
.cd-close-cart:hover { color: #fff; }

/* ── Cart Body (scrollable) ────────────────────────────────── */
.cd-mini-cart-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.widget_shopping_cart_content {
    height: 100%;
}

/* WooCommerce mini cart items */
.woocommerce-mini-cart {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-mini-cart-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    align-items: start;
}

.woocommerce-mini-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.woocommerce-mini-cart-item > a:first-child {
    grid-column: 1;
}

.woocommerce-mini-cart__empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

/* Remove link */
.woocommerce-mini-cart-item .remove_from_cart_button {
    color: #c0392b !important;
    font-size: 13px;
    text-decoration: none;
    display: block;
    margin-top: 6px;
}

.woocommerce-mini-cart-item .remove_from_cart_button:hover {
    text-decoration: underline;
}

/* Qty input */
.mini-cart-qty {
    border: 0;
    border-radius: 8px;
    background: #f0f0f0;
    padding: 8px 10px;
    width: 60px;
    font-size: 14px;
    text-align: center;
}

/* Total row */
.woocommerce-mini-cart__total {
    display: none; /* Price hidden for quote-only mode */
}

/* Buttons row (WooCommerce default) */
.woocommerce-mini-cart__buttons {
    display: none; /* We use our own CTA in footer */
}

/* ── Mini Cart Footer ──────────────────────────────────────── */
.cd-mini-cart-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(23, 23, 23, 0.15);
    flex-shrink: 0;
}

.cd-request-quote-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: #1d1d1d;
    color: #fff;
    text-align: center;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.3s ease;
    box-sizing: border-box;
}

.cd-request-quote-btn:hover {
    background: #444;
    color: #fff;
}

/* ── Overlay ───────────────────────────────────────────────── */
.cd-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    visibility: hidden;
    transition: background 0.3s ease, visibility 0s linear 0.3s;
    z-index: 9998;
    cursor: none;
}

.cd-cart-overlay.active {
    background: rgba(0, 0, 0, 0.35);
    visibility: visible;
    transition-delay: 0s;
}

/* ── Floating cursor X ─────────────────────────────────────── */
#cd-cursor-x {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 10001;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cd-mini-cart {
        width: 100vw;
        border-radius: 0;
    }
    .cd-mini-cart-inner {
        padding: 28px 24px;
    }
}
