/* WD Upsell Wizard Premium Styles */

#wd-upsell-wizard-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    justify-content: center !important;
    align-items: center !important;
    direction: rtl !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#wd-upsell-wizard-overlay:not([style*="display: none"]) {
    display: flex !important;
}

.wd-upsell-wizard-modal {
    background: #ffffff !important;
    width: 100% !important;
    max-width: 1000px !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh !important;
    animation: wdSlideUpPremium 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

@keyframes wdSlideUpPremium {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.wd-wizard-header {
    padding: 24px 30px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f0f0f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.wd-wizard-header-titles {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.wd-wizard-header h3 {
    margin: 0 !important;
    font-size: 1.5rem !important;
    color: #111827 !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

#wd-wizard-step-marketing-title {
    margin: 0 !important;
    font-size: 18px !important;
    color: #1736CC !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.wd-wizard-close-top {
    background: #f3f4f6 !important;
    border: none !important;
    font-size: 18px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    transition: all 0.2s ease !important;
}

.wd-wizard-close-top:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
    transform: rotate(90deg) !important;
}

/* Body */
.wd-wizard-body {
    padding: 30px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    background: #fafafa !important;
}

.wd-wizard-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 20px !important;
}

/* Product Card */
.wd-wizard-product-card {
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 16px !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.wd-wizard-product-card:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
    transform: translateY(-3px) !important;
}

.wd-card-image {
    height: 140px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 12px !important;
    padding: 10px !important;
    background: #fff !important;
    border-radius: 12px !important;
}

.wd-card-image img {
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    transition: transform 0.3s ease !important;
}

.wd-wizard-product-card:hover .wd-card-image img {
    transform: scale(1.05) !important;
}

.wd-card-details h4 {
    margin: 0 0 8px !important;
    font-size: 0.95rem !important;
    color: #1f2937 !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    height: 2.8em !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.wd-card-desc {
    font-size: 0.8rem !important;
    color: #6b7280 !important;
    margin: 4px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.wd-card-price {
    margin: 12px 0 16px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    font-size: 1.1rem !important;
}

.wd-old-price {
    color: #9ca3af !important;
    text-decoration: line-through !important;
    font-weight: 500 !important;
    margin-left: 6px !important;
    font-size: 0.85em !important;
}

/* Variation Dropdown in Wizard Card */
.wd-wizard-variation-select {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
    color: #1f2937 !important;
    background-color: #f9fafb !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 10px center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 8px 0 !important;
    direction: rtl !important;
    padding-left: 30px !important;
    font-weight: 500 !important;
    outline: none !important;
}

.wd-wizard-variation-select:hover {
    border-color: #d1d5db !important;
    background-color: #ffffff !important;
}

.wd-wizard-variation-select:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08) !important;
    background-color: #ffffff !important;
}

/* Add to Cart Button on Card */
.wd-wizard-add-to-cart {
    width: 100% !important;
    padding: 12px !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    transition: all 0.2s font-weight !important;
    font-weight: 700 !important;
}

.wd-wizard-add-to-cart:hover {
    background: #111827 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.wd-wizard-add-to-cart.added {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    pointer-events: none !important;
    border-color: #e5e7eb !important;
}

.wd-wizard-product-card a.added_to_cart,
.wd-wizard-product-card a.wc-forward {
    display: none !important;
}

/* Footer */
.wd-wizard-footer {
    padding: 24px 30px !important;
    background: #ffffff !important;
    border-top: 1px solid #f0f0f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.wd-wizard-actions {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
}

.wd-wizard-btn,
.wd-wizard-cart,
.wd-wizard-checkout,
.wd-wizard-next,
.wd-wizard-skip {
    padding: 12px 24px !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
}

/* Primary Action - Checkout (Deep Blue/Black instead of Green) */
.wd-wizard-checkout {
    background: #111827 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(17, 24, 39, 0.2) !important;
}

.wd-wizard-checkout:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.23) !important;
    color: #ffffff !important;
}

/* Secondary Action - Cart */
.wd-wizard-cart {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
}

.wd-wizard-cart:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
}

/* Next Button */
.wd-wizard-next {
    background: #111827 !important;
    color: #ffffff !important;
}

.wd-wizard-next:hover {
    background: #000000 !important;
}

/* Skip/Close Button */
.wd-wizard-skip {
    background: transparent !important;
    color: #6b7280 !important;
    border: 1px solid transparent !important;
}

.wd-wizard-skip:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

/* Dots */
.wd-wizard-dots {
    display: flex !important;
    gap: 10px !important;
    margin: 0 20px !important;
}

.wd-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 4px !important;
    background: #e5e7eb !important;
    transition: all 0.3s ease !important;
}

.wd-dot.active {
    background: #111827 !important;
    width: 24px !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #wd-upsell-wizard-overlay {
        padding: 5% 0 0 !important;
        align-items: flex-end !important;
    }

    .wd-upsell-wizard-modal {
        height: 95vh !important;
        max-height: 95vh !important;
        border-radius: 16px 16px 0 0 !important;
        width: 100% !important;
        animation: none !important;
    }

    .wd-wizard-step {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .wd-wizard-header {
        padding: 16px 20px !important;
    }

    .wd-wizard-header h3 {
        font-size: 1.25rem !important;
    }

    .wd-wizard-body {
        padding: 16px !important;
        overflow-x: hidden !important;
    }

    .wd-wizard-products-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .wd-wizard-product-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .wd-card-image {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .wd-card-image img {
        max-width: 100% !important;
    }

    .wd-wizard-product-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .wd-card-image {
        height: 100px !important;
        padding: 5px !important;
        margin-bottom: 8px !important;
    }

    .wd-card-details h4 {
        font-size: 0.85rem !important;
        height: 2.8em !important;
    }

    .wd-card-desc {
        display: none !important;
    }

    .wd-wizard-add-to-cart {
        padding: 8px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }

    .wd-wizard-variation-select {
        padding: 6px 10px !important;
        padding-left: 26px !important;
        font-size: 0.8rem !important;
        margin: 6px 0 !important;
        border-radius: 8px !important;
    }

    .wd-wizard-footer {
        flex-direction: column !important;
        gap: 16px !important;
        padding: 16px 20px !important;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03) !important;
    }

    .wd-wizard-actions {
        width: 100% !important;
        flex-direction: column !important;
        gap: 10px !important;
        order: 1 !important;
    }

    .wd-wizard-dots {
        margin: 8px 0 !important;
        order: 2 !important;
    }

    .wd-wizard-skip {
        width: 100% !important;
        order: 3 !important;
    }

    .wd-wizard-btn,
    .wd-wizard-cart,
    .wd-wizard-checkout {
        width: 100% !important;
        /* Force buttons to take full width on mobile */
        box-sizing: border-box !important;
    }
}

/* ========== גריד אאפסל בעמוד קופה ========== */
.wd-checkout-upsell {
    margin: 0 0 32px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.wd-checkout-upsell-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 15px;
    padding-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.wd-checkout-upsell-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.wd-checkout-upsell-grid::-webkit-scrollbar {
    height: 4px;
}

.wd-checkout-upsell-grid::-webkit-scrollbar-track {
    background: transparent;
}

.wd-checkout-upsell-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.wd-checkout-upsell-card {
    flex: 0 0 calc((100% - 56px) / 6);
    min-width: 140px;
    background: #FFF;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.wd-checkout-upsell-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

.wd-checkout-upsell-image {
    height: 105px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    flex-shrink: 0;
}

.wd-checkout-upsell-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.wd-checkout-upsell-card:hover .wd-checkout-upsell-image img {
    transform: scale(1.05);
}

.wd-checkout-upsell-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.wd-checkout-upsell-price {
    font-size: 0.98rem;
    font-weight: 800;
    color: #111827;
}

.wd-checkout-upsell-old-price {
    color: #9ca3af;
    font-size: 0.78em;
    font-weight: 500;
    margin-left: 4px;
    text-decoration: line-through;
}

/* Checkout upsell variation dropdown */
.wd-checkout-upsell-variation-select {
    width: 100%;
    padding: 5px 8px;
    padding-left: 22px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #1f2937;
    background-color: #f9fafb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 6px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    direction: rtl;
    font-weight: 600;
    outline: none;
}

.wd-checkout-upsell-variation-select:hover {
    border-color: #d1d5db;
    background-color: #ffffff;
}

.wd-checkout-upsell-variation-select:focus {
    border-color: #222739;
    box-shadow: 0 0 0 2px rgba(34, 39, 57, 0.1);
    background-color: #ffffff;
}

.wd-checkout-upsell-btn {
    width: 100%;
    padding: 9px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    background: #222739;
    color: #FFF;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    margin-top: auto;
    line-height: 1.4;
}

.wd-checkout-upsell-btn:hover {
    background: #111827;
    color: #fff;
}

.wd-checkout-upsell-btn.loading {
    opacity: 0.65;
    cursor: not-allowed;
}

.wd-checkout-upsell-btn.added {
    background: #d1fae5;
    color: #065f46;
    pointer-events: none;
    border-color: #a7f3d0;
}

@media (max-width: 768px) {
    .wd-checkout-upsell {
        padding: 5px;
        width: 100%;
        max-width: 95vw;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .wd-checkout-upsell-grid {
        gap: 10px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wd-checkout-upsell-card {
        flex: 0 0 140px;
        min-width: 140px;
    }

    .wd-checkout-upsell-image {
        height: 80px;
    }
}