:root {
    --watcp-primary: var(--wd-primary-color, var(--primary-color, #333));
    --watcp-bg: #fff;
    --watcp-text: #333;
    --watcp-overlay: rgba(0, 0, 0, 0.7);
    --watcp-border-radius: 12px;
    --watcp-spacing: 20px;
    --watcp-green: #459647;
    /* Notification green */
    --watcp-light-bg: #f9f9f9;
}

.watcp-main-layout .amount {
    font-size: 16px !important;
}

/* Overlay & Container */
#watcp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--watcp-overlay);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#watcp-popup-overlay.open {
    opacity: 1;
    visibility: visible;
}

#watcp-popup-container {
    background: var(--watcp-bg);
    width: 95%;
    max-width: 960px;
    /* Wider for split layout */
    border-radius: var(--watcp-border-radius);
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
}

#watcp-popup-overlay.open #watcp-popup-container {
    transform: scale(1);
}

/* Close Button */
#watcp-close-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f5;
    border: none;
    color: #333;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

#watcp-close-popup:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* Header */
.watcp-popup-header {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.watcp-title {
    font-size: 22px;
    font-weight: 400;
    margin: 0;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.watcp-count {
    font-size: 16px;
    color: #777;
    font-weight: 400;
    text-transform: capitalize;
}



/* Main Layout (Split) */
.watcp-main-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.watcp-cart-list-wrapper {
    flex: 1.4;
    /* Takes more space */
    min-width: 0;
    /* Prevent flex overflow */
}

.watcp-cart-summary {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-left: 30px;
    border-left: 1px solid #eee;
}

/* Cart List */
.watcp-cart-list {
    max-height: 280px;
    /* Fixed height for scroll */
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar styling */
.watcp-cart-list::-webkit-scrollbar {
    width: 6px;
}

.watcp-cart-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.watcp-cart-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.watcp-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    /* For absolute remove button */
}

/* Remove Button */
.watcp-item-remove {
    position: absolute;
    top: 5px;
    right: 0;
    z-index: 10;
}

.watcp-item-remove a {
    color: #999;
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
    display: block;
    width: 24px;
    height: 24px;
    text-align: center;
    transition: color 0.3s;
}

.watcp-item-remove a:hover {
    color: var(--watcp-red);
}

.watcp-item-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.watcp-item-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

.watcp-item-details {
    flex: 1;
}

.watcp-item-title {
    font-weight: 400;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

.watcp-item-meta {
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.watcp-item-price {
    color: #666;
    font-size: 14px;
}

.watcp-item-qty {
    color: var(--watcp-primary);
    font-weight: 500;
    font-size: 14px;
}

.watcp-item-subtotal {
    color: var(--watcp-primary);
    font-weight: 500;
    font-size: 14px;
}

/* Shipping Bar */
.watcp-shipping-bar-container {
    margin-top: 20px;
    border: 1px dashed #5CA0A8;
    background: #edf6f7;
    /* Very light tint of #5CA0A8 */
    padding: 15px 20px;
    border-radius: 8px;
    text-align: left;
}

.watcp-shipping-message {
    color: #555;
    font-size: 0.95em;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.watcp-progress-track {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.watcp-progress-fill {
    height: 100%;
    background-color: #5CA0A8;
    border-radius: 5px;
    transition: width 0.6s ease;
    /* Striped Pattern */
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

/* Summary Column */
.watcp-summary-row.total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.watcp-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.watcp-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
    padding: 15px 40px;
    text-align: center;
    border-radius: 30px;
    /* Pill shape */
    text-decoration: none;
    font-weight: 400;
    font-size: 18px;
    font-family: inherit;
    /* Ensure button inherits font */
    line-height: 1.5;
    /* Normalize line height */
    text-transform: capitalize;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    /* remove browser default styling */
    -webkit-appearance: none;
    background: transparent;
    /* Reset background for button */
}

.watcp-btn-outline {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
}

.watcp-btn-outline:hover {
    background: #5CA0A8;
    color: #fff;
    border-color: #5CA0A8;
    /* Ensure border matches hover */
}

.watcp-btn-primary {
    background: #f5f5f5;
    /* Default grey before checkout */
    color: #333;
    border: none;
}

/* Checkout Button */
.watcp-checkout-btn {
    background: var(--watcp-primary);
    color: #fff;
    margin-top: 10px;
    pointer-events: auto;
    border: none;
}

.watcp-checkout-btn:hover {
    background: #e4aa81;
    /* User requested specific hover color */
    opacity: 1;
    /* Reset opacity since we change color */
    color: #fff;
}

/* Fallback/Legacy support removal - keeping selector just in case but overrides above apply */
.watcp-checkout-btn.enabled {
    background: var(--watcp-primary);
    color: #fff;
    pointer-events: auto;
}

/* Recommended Products Slider */
.watcp-recommendations-section {
    border-top: 1px solid #eee;
    padding-top: 25px;
}

.watcp-rec-heading {
    font-size: 1em;
    font-weight: 800;
    color: #333;
    margin-bottom: 20px;
}

.watcp-rec-slider-wrapper {
    position: relative;
    overflow: hidden;
    padding: 0 5px;
    /* Slight horizontal padding for focus */
}

.watcp-rec-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Hide scrollbar IE/Edge */
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    /* Modern snap scrolling */
}

.watcp-rec-slider::-webkit-scrollbar {
    display: none;
}

.watcp-rec-slide {
    flex: 0 0 calc(33.333% - 14px);
    /* Desktop: 3 per page */
    max-width: calc(33.333% - 14px);
    scroll-snap-align: start;
}

.watcp-rec-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    /* Slightly less padding */
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    transition: all 0.3s ease;
    height: 100%;
    /* Ensure all cards are same height */
    box-sizing: border-box;
}

.watcp-rec-image {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
}

.watcp-rec-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.watcp-rec-details {
    flex: 1;
    min-width: 0;
    /* Important for ellipsis */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.watcp-rec-title {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.watcp-rec-price {
    font-size: 15px;
    color: var(--watcp-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    /* Clip if too narrow, or ellipsis */
    display: block;
}

/* Force price parts to stay on one line if WC returns detailed HTML */
.watcp-rec-price * {
    display: inline !important;
    white-space: nowrap !important;
}

/* Dots */
.watcp-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.watcp-dot {
    width: 8px;
    height: 8px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.watcp-dot.active {
    background: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .watcp-main-layout {
        flex-direction: column;
        gap: 20px;
    }

    .watcp-cart-summary {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }

    .watcp-rec-slide {
        flex: 0 0 80%;
        /* 1 item mostly visible on mobile */
    }
}