/* Base Cart Panel */
.stealth-cart-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: var(--stealth-bg);
    color: var(--stealth-text);
    z-index: 999999;
    /* transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: var(--stealth-panel-shadow);
    border-left: 1px solid var(--stealth-border);
}

/* Position */
.stealth-cart-right {
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid var(--stealth-border);
}

.stealth-cart-left {
    left: 0;
    transform: translateX(-100%);
    border-right: 1px solid var(--stealth-border);
    border-left: none;
}

/* Open State */
.stealth-cart-open .stealth-cart-panel {
    transform: translateX(0);
}

/* Overlay */
.stealth-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.stealth-cart-open .stealth-cart-overlay {
    opacity: 1;
    visibility: visible;
}

/* Styles: Floating */
.stealth-style-floating {
    top: 20px;
    bottom: 20px;
    height: auto;
    border-radius: var(--stealth-radius);
    border: 1px solid var(--stealth-border);
}

.stealth-cart-right.stealth-style-floating {
    right: 20px;
    transform: translateX(120%);
}

.stealth-cart-left.stealth-style-floating {
    left: 20px;
    transform: translateX(-120%);
}

/* Styles: Glass */
.stealth-style-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: dark) {
    .stealth-style-glass {
        background: rgba(30, 30, 30, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Styles: Minimal */
.stealth-style-minimal {
    border: none;
    box-shadow: none;
}

.stealth-style-minimal .stealth-cart-header {
    border-bottom: none;
    padding-bottom: 0;
}

/* Header */
.stealth-cart-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--stealth-border);
    flex-shrink: 0;
}

.stealth-cart-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stealth-text);
}

.stealth-cart-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--stealth-text);
    opacity: 0.6;
    transition: opacity 0.2s;
    display: flex;
}

.stealth-cart-close:hover {
    opacity: 1;
}

/* Content */
.stealth-cart-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.stealth-cart-items {
    padding: 20px 25px;
}

/* Cart Item */
.stealth-cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--stealth-bg);
    /* Ensure visible on glass/floating */
    border: 1px solid var(--stealth-border);
    border-radius: var(--stealth-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stealth-cart-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--stealth-card-shadow);
}

.stealth-style-minimal .stealth-cart-item {
    border: none;
    padding: 0 0 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--stealth-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
}

.stealth-style-minimal .stealth-cart-item:hover {
    transform: none;
}

.stealth-cart-item-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: calc(var(--stealth-radius) - 4px);
    overflow: hidden;
    background: #f3f4f6;
}

.stealth-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stealth-cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stealth-cart-item-name {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
}

.stealth-cart-item-name a {
    color: var(--stealth-text);
    text-decoration: none;
}

.stealth-cart-item-price {
    font-size: 0.9rem;
    color: var(--stealth-text);
    opacity: 0.8;
    margin-bottom: 8px;
}

.stealth-cart-item-quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--stealth-border);
    border-radius: 6px;
    width: fit-content;
    background: var(--stealth-bg);
}

.stealth-qty-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--stealth-text);
}

.stealth-qty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.stealth-qty-value {
    padding: 0 5px;
    font-size: 13px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.stealth-cart-item-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
    align-self: flex-start;
}

.stealth-cart-item-remove:hover {
    opacity: 1;
}

/* Footer Section */
.stealth-cart-footer {
    padding: 25px;
    border-top: 1px solid var(--stealth-border);
    background: var(--stealth-bg);
    flex-shrink: 0;
}

.stealth-style-glass .stealth-cart-footer {
    background: transparent;
}

.stealth-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.stealth-cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--stealth-accent);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: var(--stealth-radius);
    font-weight: 600;
    transition: filter 0.2s, transform 0.1s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.stealth-cart-checkout-btn:hover {
    filter: brightness(1.1);
}

.stealth-cart-checkout-btn:active {
    transform: scale(0.98);
}

.stealth-cart-continue-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: transparent;
    border: none;
    color: var(--stealth-text);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Upsells */
.stealth-cart-upsells {
    padding: 0 25px 25px;
    border-top: 1px solid var(--stealth-border);
}

.stealth-upsell-title {
    margin: 20px 0 15px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    color: #1f2937 !important;
    /* Force visible color */
    font-weight: 700;
}

.stealth-upsell-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.stealth-upsell-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    /* Explicit border color */
    border-radius: var(--stealth-radius);
    background: #ffffff;
    /* Explicit background */
}

/* Explicit text color for item names */
.stealth-cart-item-name a,
.stealth-upsell-name {
    color: #111827 !important;
}

/* Close/Remove Button */
.stealth-cart-item-remove {
    background: transparent;
    border: none;
    color: #ef4444 !important;
    /* Force Red */
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
    align-self: flex-start;
    font-size: 18px;
    /* Make it bigger */
    line-height: 1;
}

.stealth-cart-item-remove:hover {
    opacity: 1;
    background: #fee2e2;
    border-radius: 4px;
}

.stealth-upsell-price {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 6px;
}

.stealth-upsell-btn {
    align-self: flex-start;
    font-size: 0.8rem;
    padding: 6px 12px;
    background: var(--stealth-accent);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    line-height: 1;
}

.stealth-upsell-btn.loading {
    opacity: 0.7;
}

/* Coupon */
.stealth-cart-coupon {
    padding: 0 25px 20px;
}

.stealth-coupon-form {
    display: flex;
    gap: 10px;
}

.stealth-coupon-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid var(--stealth-border);
    border-radius: var(--stealth-radius);
    background: transparent;
    color: var(--stealth-text);
}

.stealth-coupon-apply {
    padding: 8px 15px;
    background: var(--stealth-text);
    color: var(--stealth-bg);
    border: none;
    border-radius: var(--stealth-radius);
    cursor: pointer;
    font-weight: 500;
}

/* Empty State */
.stealth-cart-empty {
    padding: 40px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    /* Grow to fill space but allow content below */
    justify-content: center;
}

.stealth-cart-empty-icon {
    margin-bottom: 20px;
    color: var(--stealth-accent);
    opacity: 0.5;
}

.stealth-cart-empty-icon svg {
    width: 64px;
    height: 64px;
}

.stealth-cart-empty-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
}

.stealth-cart-empty-message {
    margin: 0 0 30px;
    opacity: 0.7;
}

.stealth-cart-shop-btn {
    padding: 12px 30px;
    background: var(--stealth-accent);
    color: white;
    text-decoration: none;
    border-radius: var(--stealth-radius);
    font-weight: 600;
    display: inline-block;
}

/* Trigger Button */
.stealth-cart-trigger {
    position: fixed;
    bottom: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--stealth-accent);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stealth-cart-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.stealth-trigger-right {
    right: 30px;
}

.stealth-trigger-left {
    left: 30px;
}

.stealth-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

/* Widget Btn */
.stealth-cart-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--stealth-accent);
    color: white;
    border: none;
    border-radius: var(--stealth-radius);
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.stealth-cart-widget-btn:hover {
    opacity: 0.9;
}

.stealth-cart-widget-btn .stealth-cart-count {
    position: static;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    margin-left: 5px;
}