/* ==========================================================================
   Wallstreeteasy Global Floating Cart (FAB + modal) — site-wide
   Design system aligned with checkout-prueba.css
   ========================================================================== */

:root {
    --wse-font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --wse-primary: #1E56E7;
    --wse-primary-hover: #1844B5;
    --wse-card-bg: #FFFFFF;
    --wse-text-main: #0F172A;
    --wse-text-muted: #64748B;
    --wse-border: #E2E8F0;
    --wse-border-input: #CBD5E1;
    --wse-radius-card: 24px;
    --wse-radius-box: 16px;
}

/* --------------------------------------------------------------------------
   Floating cart button (bottom-right)
   -------------------------------------------------------------------------- */
.wse-cart-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--wse-primary);
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(30, 86, 231, 0.4);
    transition: background 0.2s ease, transform 0.1s ease;
}

.wse-cart-fab:hover {
    background: var(--wse-primary-hover);
    transform: scale(1.05);
}

.wse-cart-fab:active {
    transform: scale(0.97);
}

.wse-cart-fab-icon {
    width: 24px;
    height: 24px;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-1px);
    transition: transform 0.25s ease;
}

.wse-cart-fab:hover .wse-cart-fab-icon {
    transform: translateX(-1px) scale(1.08);
}

.wse-cart-fab-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 12px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.wse-cart-fab-count.wse-hidden {
    display: none;
}

/* --------------------------------------------------------------------------
   Buttons (shared with checkout design)
   -------------------------------------------------------------------------- */
.wse-btn-primary {
    width: 100%;
    height: 54px;
    background-color: var(--wse-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.wse-btn-primary:hover {
    background-color: var(--wse-primary-hover);
}

.wse-btn-primary:active {
    transform: translateY(1px);
}

.wse-btn-secondary-outline {
    width: 100%;
    height: 52px;
    padding: 0 24px;
    border: 1.5px solid var(--wse-border-input);
    background: #FFFFFF;
    color: var(--wse-text-main);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wse-btn-secondary-outline:hover {
    border-color: var(--wse-text-main);
    background: #FAFAFA;
}

/* --------------------------------------------------------------------------
   Cart items list (sidebar + modal)
   -------------------------------------------------------------------------- */
.wse-cart-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--wse-text-muted);
}

.wse-cart-list {
    margin-bottom: 8px;
}

.wse-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--wse-border);
}

.wse-cart-item:last-child {
    border-bottom: none;
}

.wse-cart-item-img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #F4F4F6;
}

.wse-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wse-cart-item-info {
    flex: 1;
    min-width: 0;
}

.wse-cart-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--wse-text-main);
    line-height: 1.3;
}

.wse-cart-item-attr {
    font-size: 12px;
    color: var(--wse-text-muted);
    margin-top: 2px;
}

.wse-cart-item-price {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--wse-text-main);
}

.wse-cart-item-price .woocommerce-Price-amount,
.wse-cart-item-price del .woocommerce-Price-amount {
    font-weight: 700;
    color: var(--wse-text-main);
}

.wse-cart-item-price del {
    opacity: 0.55;
    margin-right: 6px;
    text-decoration: line-through;
}

.wse-cart-item-price del .woocommerce-Price-amount {
    font-weight: 500;
    font-size: 13px;
}

.wse-cart-item-price ins {
    text-decoration: none;
}

.wse-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wse-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--wse-border-input);
    border-radius: 10px;
    overflow: hidden;
}

.wse-qty-btn {
    width: 28px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--wse-text-main);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.wse-qty-btn:hover {
    background: #F4F4F6;
}

.wse-qty-val {
    min-width: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--wse-text-main);
}

.wse-item-remove {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--wse-text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wse-item-remove:hover {
    background: #FDECEC;
    color: #D64545;
}

.wse-cart-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--wse-text-muted);
    font-size: 14px;
}

.wse-btn-view-cart {
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Cart modal
   -------------------------------------------------------------------------- */
.wse-cart-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wse-cart-modal-overlay.open {
    display: flex;
}

.wse-cart-modal {
    background: var(--wse-card-bg);
    border-radius: var(--wse-radius-card);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
}

.wse-cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--wse-border);
}

.wse-cart-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--wse-text-main);
}

.wse-cart-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #F4F4F6;
    color: var(--wse-text-main);
    font-size: 14px;
    cursor: pointer;
}

.wse-cart-modal-close:hover {
    background: #E8E8EC;
}

.wse-cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 26px;
}

.wse-cart-modal-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--wse-border);
}

.wse-cart-modal-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: var(--wse-text-main);
    margin-bottom: 14px;
}

.wse-btn-checkout-now {
    width: 100%;
}

.wse-btn-keep-shopping {
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Cart item loading state (qty / remove AJAX feedback)
   -------------------------------------------------------------------------- */
.wse-cart-item.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.wse-cart-item.is-loading .wse-cart-item-actions {
    position: relative;
}

.wse-cart-item.is-loading .wse-cart-item-actions::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    border: 2px solid var(--wse-border-input);
    border-top-color: var(--wse-primary);
    border-radius: 50%;
    animation: wse-spin 0.7s linear infinite;
}

@keyframes wse-spin {
    to {
        transform: rotate(360deg);
    }
}
