/* Cart Sidebar Popup Styles */
.cpaprx-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

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

.cpaprx-cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cpaprx-cart-sidebar.active {
    right: 0;
}

.cpaprx-cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 70px;
}

.cpaprx-cart-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F0300;
    margin: 0;
    letter-spacing: -0.02em;
}

.cpaprx-cart-sidebar-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
}

.cpaprx-cart-sidebar-close:hover,
.cpaprx-cart-sidebar-close:active {
    color: #1F0300;
    background: #f3f4f6;
    transform: rotate(90deg);
}

.cpaprx-cart-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.cpaprx-cart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 24px;
}

.cpaprx-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.cpaprx-cart-empty-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.cpaprx-cart-empty-text {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

.cpaprx-cart-items {
    padding: 0;
}

.cpaprx-cart-item {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    padding-right: 50px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
    position: relative;
}

.cpaprx-cart-item:hover {
    background: #fafafa;
}

.cpaprx-cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f9fafb;
}

.cpaprx-cart-item-details {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.cpaprx-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1F0300;
    margin-bottom: 8px;
    margin-right: 40px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.cpaprx-cart-item-name a {
    color: #1F0300;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cpaprx-cart-item-name a:hover {
    color: #E94132;
}

.cpaprx-cart-item-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #6b7280;
}

.cpaprx-cart-item-attribute {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cpaprx-cart-item-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    display: inline-block;
}

.cpaprx-cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.cpaprx-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px;
    background: #ffffff;
}

.cpaprx-cart-quantity-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cpaprx-cart-quantity-btn:hover,
.cpaprx-cart-quantity-btn:active {
    background: #f3f4f6;
    color: #1F0300;
}

.cpaprx-cart-quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #1F0300;
    padding: 0;
    -moz-appearance: textfield;
}

.cpaprx-cart-quantity-input::-webkit-outer-spin-button,
.cpaprx-cart-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cpaprx-cart-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.cpaprx-cart-item-price-main {
    font-size: 16px;
    font-weight: 700;
    color: #1F0300;
}

.cpaprx-cart-item-price-discount {
    font-size: 12px;
    color: #E94132;
    font-weight: 600;
}

.cpaprx-cart-item-remove {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.cpaprx-cart-item-remove:hover,
.cpaprx-cart-item-remove:active {
    color: #E94132;
    background: #fff;
    border-color: #E94132;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(233, 65, 50, 0.2);
}

.cpaprx-cart-item-remove svg {
    width: 16px;
    height: 16px;
}

.cpaprx-cart-sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.cpaprx-cart-summary {
    margin-bottom: 20px;
}

.cpaprx-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.cpaprx-cart-summary-label {
    color: #6b7280;
}

.cpaprx-cart-summary-value {
    font-weight: 600;
    color: #1F0300;
}

.cpaprx-cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 2px solid #e5e7eb;
    margin-top: 8px;
}

.cpaprx-cart-summary-total-label {
    font-size: 16px;
    font-weight: 700;
    color: #1F0300;
}

.cpaprx-cart-summary-total-value {
    font-size: 20px;
    font-weight: 800;
    color: #E94132;
}

.cpaprx-cart-checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #E94132 0%, #c73528 100%);
    color: #ffffff;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    box-shadow: 0 4px 12px rgba(233, 65, 50, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.cpaprx-cart-checkout-btn:hover,
.cpaprx-cart-checkout-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 65, 50, 0.4);
    background: linear-gradient(135deg, #c73528 0%, #E94132 100%);
}

.cpaprx-cart-view-cart-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.cpaprx-cart-view-cart-link:hover {
    color: #E94132;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cpaprx-cart-sidebar {
        max-width: 100%;
    }

    .cpaprx-cart-sidebar-header {
        padding: 16px 20px;
        min-height: 60px;
    }

    .cpaprx-cart-sidebar-title {
        font-size: 18px;
    }

    .cpaprx-cart-sidebar-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .cpaprx-cart-item {
        padding: 16px 20px;
        gap: 12px;
    }

    .cpaprx-cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cpaprx-cart-item-name {
        font-size: 13px;
    }

    .cpaprx-cart-item-remove {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        padding: 5px;
    }
    
    .cpaprx-cart-item-remove svg {
        width: 14px;
        height: 14px;
    }
    
    .cpaprx-cart-item {
        padding-right: 45px;
    }
    
    .cpaprx-cart-item-name {
        margin-right: 35px;
    }

    .cpaprx-cart-sidebar-footer {
        padding: 16px 20px;
    }

    .cpaprx-cart-checkout-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cpaprx-cart-sidebar-header {
        padding: 14px 16px;
        min-height: 56px;
    }

    .cpaprx-cart-sidebar-title {
        font-size: 16px;
    }

    .cpaprx-cart-item {
        padding: 14px 16px;
        gap: 10px;
    }

    .cpaprx-cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cpaprx-cart-item-name {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .cpaprx-cart-item-attributes {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .cpaprx-cart-item-footer {
        margin-top: 8px;
        gap: 8px;
    }

    .cpaprx-cart-quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .cpaprx-cart-quantity-input {
        width: 35px;
        font-size: 13px;
    }

    .cpaprx-cart-item-price-main {
        font-size: 14px;
    }

    .cpaprx-cart-item-remove {
        top: 10px;
        right: 10px;
        width: 26px;
        height: 26px;
        padding: 4px;
    }
    
    .cpaprx-cart-item-remove svg {
        width: 12px;
        height: 12px;
    }
    
    .cpaprx-cart-item {
        padding-right: 40px;
    }
    
    .cpaprx-cart-item-name {
        margin-right: 30px;
    }

    .cpaprx-cart-sidebar-footer {
        padding: 14px 16px;
    }

    .cpaprx-cart-summary-row {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .cpaprx-cart-summary-total-label {
        font-size: 14px;
    }

    .cpaprx-cart-summary-total-value {
        font-size: 18px;
    }

    .cpaprx-cart-checkout-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Prevent body scroll when cart is open */
body.cart-sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Improve cart sidebar design - more standard/international */
.cpaprx-cart-sidebar {
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.cpaprx-cart-item {
    background: #ffffff;
}

.cpaprx-cart-item:hover {
    background: #f9fafb;
}

.cpaprx-cart-item-image {
    border: 1px solid #e5e7eb;
}

.cpaprx-cart-item-quantity {
    border: 1.5px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cpaprx-cart-quantity-btn {
    min-width: 32px;
    min-height: 32px;
}

.cpaprx-cart-quantity-btn:hover,
.cpaprx-cart-quantity-btn:active {
    background: #f3f4f6;
    color: #1F0300;
    transform: scale(1.05);
}

.cpaprx-cart-sidebar-footer {
    background: #fafbfc;
    border-top: 2px solid #e5e7eb;
}

.cpaprx-cart-summary-total {
    border-top: 2px solid #d1d5db;
    padding-top: 16px;
    margin-top: 12px;
}

