/* WD Upsell Wizard Styles */

#wd-upsell-wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    direction: rtl;
    /* Force RTL for Hebrew interface */
}

.wd-upsell-wizard-modal {
    background: #fff;
    width: 90%;
    max-width: 1200px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: wdSlideUp 0.3s ease-out;
}

@keyframes wdSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.wd-wizard-header {
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wd-wizard-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
    font-weight: 700;
}

.wd-wizard-close-top {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.wd-wizard-close-top:hover {
    color: #333;
}

/* Body */
.wd-wizard-body {
    padding: 15px;
    /* Reduced padding */
    overflow-y: auto;
    flex: 1;
}

.wd-wizard-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    /* Reduced min-width to fit 4 */
    gap: 15px;
    /* Reduced gap */
}

/* Product Card */
.wd-wizard-product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    /* Reduced padding */
    text-align: center;
    transition: box-shadow 0.2s;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wd-wizard-product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.wd-card-image {
    height: 120px;
    /* Reduced height */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.wd-card-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.wd-card-details h4 {
    margin: 0 0 5px;
    font-size: 0.9rem;
    color: #000;
    /* Smaller title */
    line-height: 1.3;
    height: 2.4em;
    /* Limit to 2 lines */
    overflow: hidden;
}

.wd-card-desc {
    font-size: 0.8rem;
    color: #666;
    margin: 3px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wd-card-price {
    margin: 8px 0;
    font-weight: bold;
    color: #000;
    font-size: 0.95rem;
}

.wd-old-price {
    color: #999;
    font-weight: normal;
    margin-left: 5px;
    font-size: 0.9em;
}

.wd-wizard-add-to-cart {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    cursor: pointer;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    transition: background 0.2s;
    font-weight: bold;
}

.wd-wizard-add-to-cart:hover {
    background: #333;
    border-color: #333;
}

.wd-wizard-add-to-cart.added {
    background: #555 !important;
    border-color: #555 !important;
    color: #fff !important;
    pointer-events: none;
    opacity: 0.8;
}

.wd-wizard-add-to-cart.added:before {
    content: "";
    /* Remove checkmark */
}

/* Hide the standard WooCommerce 'View Cart' link that might be appended */
.wd-wizard-product-card a.added_to_cart,
.wd-wizard-product-card a.wc-forward {
    display: none !important;
}

/* Footer */
.wd-wizard-footer {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wd-wizard-btn {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.wd-wizard-next {
    background: #000;
    color: #fff;
    font-size: 1rem;
}

.wd-wizard-next:hover {
    background: #333;
}

.wd-wizard-skip {
    background: #f1f1f1;
    color: #666;
}

.wd-wizard-skip:hover {
    background: #e1e1e1;
    color: #333;
}

/* Dots */
.wd-wizard-dots {
    display: flex;
    gap: 8px;
    margin: 0 15px;
    /* Spacing around dots */
}

.wd-wizard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wd-wizard-cart {
    background: #000;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
}

.wd-wizard-cart:hover {
    background: #333;
    color: #fff;
}

.wd-wizard-checkout {
    background: #000;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
}

.wd-wizard-checkout:hover {
    background: #219150;
    color: #fff;
}


.wd-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s;
}

.wd-dot.active {
    background: #3498db;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .wd-upsell-wizard-modal {
        width: 95%;
        max-height: 95vh;
        max-width: none;
    }

    .wd-wizard-body {
        padding: 10px;
    }

    /* 1. Force 2 columns Grid */
    .wd-wizard-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wd-wizard-product-card {
        padding: 5px;
    }

    .wd-card-image {
        height: 100px;
    }

    .wd-card-details h4 {
        font-size: 0.85rem;
        height: 2.4em;
    }

    .wd-card-desc {
        display: none;
        /* Hide description on mobile to save space? or keep it small */
    }

    .wd-wizard-add-to-cart {
        padding: 5px;
        font-size: 0.8rem;
    }

    /* 2. Responsive Button Layout */
    .wd-wizard-footer {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .wd-wizard-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        /* Stack actions */
        gap: 10px;
        order: 1;
        /* Main actions first (top) or last (bottom)? Let's put them Top */
    }

    .wd-wizard-skip {
        width: 100%;
        order: 3;
    }

    .wd-wizard-dots {
        margin: 5px 0;
        order: 2;
    }

    .wd-wizard-btn {
        width: 100%;
        margin: 0;
        padding: 12px 0;
        /* Taller touch targets */
        display: block;
        text-align: center;
    }

    /* Ensure action buttons in the container are full width */
    .wd-wizard-actions .wd-wizard-btn {
        width: 100%;
    }
}