/* Sale Products Grid Widget CSS */
.wd-sale-grid-container {
    display: flex;
    flex-wrap: nowrap;
    /* Prevent wrapping on desktop to keep columns aligned */
    gap: 20px;
    direction: rtl;
    /* Ensure RTL for Hebrew */
    align-items: stretch;
    /* Critical for equal height */
}

.wd-sale-grid-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 250px;
    justify-content: space-between;
    /* Distribute cards vertically */
}

.wd-sale-grid-center {
    flex: 1.5;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #eee;
    min-width: 300px;
    text-align: center;
    justify-content: center;
    /* Vertically center the content */
    height: auto;
    /* Allow stretch */
    position: relative;
    /* For badges if needed */
}

/* Side Product Card */
.wd-sale-side-card {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    gap: 15px;
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.3s ease;
    flex: 1;
    position: relative;
}

.wd-sale-side-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.wd-sale-side-img img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.wd-sale-side-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.wd-sale-side-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px;
    line-height: 1.3;
}

.wd-sale-side-title a {
    text-decoration: none;
    color: inherit;
}

.wd-sale-side-price {
    font-weight: bold;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-direction: row-reverse;
}

.wd-sale-side-price ins {
    text-decoration: none;
    order: 2;
}

.wd-sale-side-price del {
    order: 1;
}

.wd-sale-side-price ins {
    text-decoration: none;
}

span.wd-sale-save-badge-inline.wd-sale-save-badge span.woocommerce-Price-amount.amount {
    margin-right: 4px;
}

/* Main Product Card */
.wd-sale-main-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.wd-sale-main-img img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

.wd-sale-main-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.wd-sale-main-title a {
    text-decoration: none;
    color: inherit;
}

.wd-sale-main-price {
    font-size: 18px;
    font-weight: bold;
    color: #ce0202;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-direction: row-reverse;
    /* Put deleted price (first in DOM) to the left (end) */
}

.wd-sale-main-price ins {
    text-decoration: none;
    order: 2;
    /* Ensure sale price is first (right in RTL) */
}

.wd-sale-main-price del {
    order: 1;
    /* Ensure regular price is last (left in RTL) */
}

.wd-sale-main-btn {
    background-color: var(--e-global-color-primary, #000);
    color: #fff;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.wd-sale-main-btn:hover {
    background-color: #333;
    color: #fff;
}

/* Timer */
.wd-sale-timer-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 5px;
    direction: ltr;
    /* Timer numbers usually look better LTR, labels handle RTL */
}

.wd-timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #eefdfd;
    /* Light teal/cyan bg */
    border: 1px solid #bceceb;
    border-radius: 5px;
    padding: 5px 10px;
    min-width: 50px;
}

.wd-timer-val {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    line-height: 1;
}

.wd-timer-label {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

/* Category Label */
.wd-sale-category {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.wd-sale-category.main-cat {
    font-size: 14px;
    margin-bottom: 10px;
}

/* Quick View & Actions Container */
.wd-sale-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.wd-sale-main-actions {
    margin-top: 15px;
    flex-wrap: wrap;
}

.wd-sale-side-actions {
    margin-top: 10px;
}

.wd-product-view-trigger {
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.wd-product-view-trigger:hover {
    opacity: 0.8;
}

/* Save Badge */
.wd-sale-save-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.wd-sale-actions.wd-sale-side-actions {
    position: absolute;
    bottom: 10px;
    left: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .wd-sale-grid-container {
        flex-direction: column;
    }

    .wd-sale-grid-center {
        order: -1;
        /* Main product on top for mobile */
    }
}

/* Alignment Controls */
/* Main Product */
.elementor-widget-wd_sale_products_grid.main-align-left .wd-sale-grid-center {
    align-items: flex-end;
    /* Left in RTL */
    text-align: left;
}

.elementor-widget-wd_sale_products_grid.main-align-center .wd-sale-grid-center {
    align-items: center;
    text-align: center;
}

.elementor-widget-wd_sale_products_grid.main-align-right .wd-sale-grid-center {
    align-items: flex-start;
    /* Right in RTL */
    text-align: right;
}

/* Main Price Alignment */
/* Row Reverse in RTL: Start is Left, End is Right */
.elementor-widget-wd_sale_products_grid.main-align-left .wd-sale-main-price {
    justify-content: flex-start;
    /* Left */
}

.elementor-widget-wd_sale_products_grid.main-align-center .wd-sale-main-price {
    justify-content: center;
}

.elementor-widget-wd_sale_products_grid.main-align-right .wd-sale-main-price {
    justify-content: flex-end;
    /* Right */
}


/* Side Products */
.elementor-widget-wd_sale_products_grid.side-align-left .wd-sale-side-content {
    align-items: flex-end;
    /* Left in RTL */
    text-align: left;
}

.elementor-widget-wd_sale_products_grid.side-align-center .wd-sale-side-content {
    align-items: center;
    text-align: center;
}

.elementor-widget-wd_sale_products_grid.side-align-right .wd-sale-side-content {
    align-items: flex-start;
    /* Right in RTL */
    text-align: right;
}

/* Side Price Alignment */
.elementor-widget-wd_sale_products_grid.side-align-left .wd-sale-side-price {
    justify-content: flex-start;
    /* Left */
}

.elementor-widget-wd_sale_products_grid.side-align-center .wd-sale-side-price {
    justify-content: center;
}

.elementor-widget-wd_sale_products_grid.side-align-right .wd-sale-side-price {
    justify-content: flex-end;
    /* Right */
}
