/**
 * Floating Cart Widget - Frontend Styles
 */

/* ========== Floating Cart Button ========== */
.wew-floating-cart-wrapper {
    position: relative;
}

.wew-floating-cart-button {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background-color: #ffffff !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wew-floating-cart-button:hover {
    transform: scale(1.1);
}

.wew-floating-cart-button:active {
    transform: scale(0.95);
}

.wew-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

/* ========== Cart Count Badge ========== */
.wew-cart-count {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    animation: wew-badge-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes wew-badge-pop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ========== Cart Overlay ========== */
.wew-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wew-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========== Cart Sidebar ========== */
.wew-cart-sidebar {
    position: fixed;
    top: 0;
    height: 100%;
    z-index: 9999;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wew-cart-sidebar.wew-sidebar-left {
    left: 0;
    right: auto;
    transform: translateX(-100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.wew-cart-sidebar.wew-sidebar-right {
    right: 0;
    left: auto;
}

.wew-cart-sidebar.active {
    transform: translateX(0);
}

.wew-cart-sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ========== Cart Header ========== */
.wew-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.wew-cart-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wew-header-cart-count {
    font-size: 16px;
    color: #888;
    font-weight: 400;
}

.wew-close-sidebar {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.wew-close-sidebar:hover {
    color: #000;
    transform: rotate(90deg);
}

/* ========== Cart Items Container ========== */
.wew-cart-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 20px;
}

.wew-cart-items::-webkit-scrollbar {
    width: 6px;
}

.wew-cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wew-cart-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.wew-cart-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== Empty Cart ========== */
.wew-empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* ========== Cart Item ========== */
.wew-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    position: relative;
    transition: background 0.2s ease;
}

.wew-cart-item:hover {
    background: #f0f0f0;
}

.wew-cart-item-image {
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

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

.wew-cart-item-details {
    flex: 1;
    min-width: 0;
}

.wew-cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.4;
}

.wew-cart-item-name a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.wew-cart-item-name a:hover {
    color: #0073aa;
}

.wew-cart-item-meta {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 8px;
}

.wew-quantity-control {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px;
}

.wew-qty-btn {
    background: transparent;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.wew-qty-btn:hover {
    background: #f0f0f0;
    color: #000;
}

.wew-cart-item-quantity {
    font-weight: 600;
    min-width: 25px;
    text-align: center;
    color: #333;
}

.wew-cart-item-price {
    font-weight: 600;
    color: #333;
}

.wew-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.wew-remove-item:hover {
    color: #e74c3c;
    transform: scale(1.2);
}

/* ========== Cart Footer ========== */
.wew-cart-footer {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.wew-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.wew-subtotal-amount {
    color: #0073aa;
}

.wew-cart-buttons {
    display: flex;
    /* flex-direction is controlled by Elementor */
}

.wew-cart-button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wew-cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wew-cart-button:active {
    transform: translateY(0);
}

.wew-view-cart-button:hover {
    opacity: 0.9;
}

.wew-checkout-button:hover {
    opacity: 0.9;
}

/* ========== Loading State ========== */
.wew-cart-items.loading {
    opacity: 0.5;
    pointer-events: none;
}

.wew-cart-items.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: wew-spin 1s linear infinite;
}

@keyframes wew-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .wew-cart-sidebar {
        width: 100% !important;
        max-width: 400px;
    }

    .wew-cart-item-image {
        width: 60px !important;
        height: 60px !important;
    }

    .wew-cart-item-name {
        font-size: 14px;
    }

    .wew-cart-item-meta {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wew-cart-sidebar {
        max-width: 100%;
    }

    .wew-floating-cart-button {
        width: 50px !important;
        height: 50px !important;
    }

    .wew-cart-icon i,
    .wew-cart-icon svg {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
    }
}

/* ========== Flying Product Animation ========== */
.wew-flying-product {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #4385d8;
    border-radius: 50%;
    font-size: 24px;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wew-flying-product i {
    animation: wew-product-spin 0.8s linear;
}

@keyframes wew-product-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes wew-product-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========== Cart Shake Animation ========== */
.wew-cart-shake {
    animation: wew-cart-shake-animation 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes wew-cart-shake-animation {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-3px) rotate(-5deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(3px) rotate(5deg);
    }
}

/* Badge pop animation when count updates */
.wew-cart-count.wew-count-update {
    animation: wew-badge-update 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes wew-badge-update {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
        background: #ff6b6b;
    }

    100% {
        transform: scale(1);
    }
}