: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;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    padding-right: 40px;
}

.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;
    justify-content: space-between;
    gap: 12px;
    margin-top: 5px;
}

.watcp-item-price {
    color: #666;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.watcp-item-qty {
    color: var(--watcp-primary);
    font-weight: 500;
    font-size: 14px;
}

.watcp-item-right-meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.watcp-item-subtotal {
    color: var(--watcp-primary);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}

/* Quantity Control Box */
.watcp-quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #5CA0A8;
    border-radius: 4px;
    overflow: hidden;
    height: 28px;
    background: #fff;
    box-sizing: border-box;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.watcp-quantity-control.loading {
    opacity: 0.5;
    pointer-events: none;
}

.watcp-cart-item.updating {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.watcp-qty-btn {
    background: #fff;
    border: none;
    color: #555;
    font-size: 15px;
    line-height: 1;
    width: 26px;
    height: 100%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    font-family: inherit;
    transition: background-color 0.15s ease, color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.watcp-qty-btn:hover:not(.disabled):not(:disabled) {
    background-color: #edf6f7;
    color: #5CA0A8;
}

.watcp-qty-btn:active:not(.disabled):not(:disabled) {
    background-color: #e0f0f2;
}

.watcp-qty-btn.disabled,
.watcp-qty-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: #fff;
}

.watcp-qty-btn.watcp-qty-minus {
    border-right: 1px solid #5CA0A8;
}

.watcp-qty-btn.watcp-qty-plus {
    border-left: 1px solid #5CA0A8;
}

.watcp-qty-input {
    width: 32px;
    height: 100%;
    text-align: center;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    padding: 0;
    margin: 0;
    font-family: inherit;
    -moz-appearance: textfield;
}

.watcp-qty-input::-webkit-outer-spin-button,
.watcp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 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: #5CA0A8;
    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-popup-container {
        padding: 20px 15px;
    }

    .watcp-popup-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-right: 40px;
    }

    .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 */
    }

    .watcp-item-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}


/* Sale Price (Strikethrough) Styling - Scoped to Popup */
#watcp-popup-container .amount {
    font-size: 16px !important;
}

#watcp-popup-container .price del span bdi {
    color: #888;
    font-weight: 400 !important;
}

#watcp-popup-container .price del {
    text-decoration: none;
}

#watcp-popup-container .price del .amount {
    position: relative;
}

#watcp-popup-container .price del span bdi {
    font-size: 14px;
}

#watcp-popup-container .price del span bdi::after {
    content: "";
    height: 2px;
    background: rgb(84, 89, 95);
    position: absolute;
    width: 95%;
    top: 50%;
    left: 0;
}


/* ===== Quantity control: theme-proof reset ===== */
#watcp-popup-container .watcp-quantity-control {
    display: inline-flex !important;
    align-items: stretch !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: 28px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #5CA0A8 !important;
    border-radius: 4px !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 26px !important;
    width: 26px !important;
    min-width: 26px !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #555 !important;
    box-shadow: none !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box !important;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-btn.watcp-qty-minus {
    border-right: 1px solid #5CA0A8 !important;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-btn.watcp-qty-plus {
    border-left: 1px solid #5CA0A8 !important;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-btn:hover:not(.disabled):not(:disabled),
#watcp-popup-container .watcp-quantity-control .watcp-qty-btn:focus:not(.disabled):not(:disabled) {
    background: #edf6f7 !important;
    color: #5CA0A8 !important;
    box-shadow: none !important;
    outline: none !important;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-btn.disabled,
#watcp-popup-container .watcp-quantity-control .watcp-qty-btn:disabled {
    background: #fff !important;
    color: #ccc !important;
    cursor: not-allowed;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-input {
    flex: 0 0 32px !important;
    width: 32px !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 28px !important;
    text-align: center !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    box-sizing: border-box !important;
}

#watcp-popup-container .watcp-quantity-control .watcp-qty-input::-webkit-outer-spin-button,
#watcp-popup-container .watcp-quantity-control .watcp-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}