/**
 * TP4R Quantity Discounts - Frontend Styles
 * עיצוב נקי ומינימליסטי - RTL
 */

/* ===== RTL Support ===== */
.tp4r-qd-badge,
.tp4r-qd-deals-wrapper,
.tp4r-qd-price-wrapper,
.tp4r-qd-cart-notice,
.tp4r-qd-savings-summary,
.tp4r-qd-encouragement {
    direction: rtl;
    text-align: right;
}

/* ===== Product Badge - Minimal ===== */
.tp4r-qd-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    display: inline-block;
    padding: 4px 10px;
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    z-index: 10;
}

.tp4r-qd-badge-icon {
    display: none;
}

.products .product,
.woocommerce-loop-product,
ul.products li.product {
    position: relative;
}

/* ===== Price Display ===== */
.tp4r-qd-price-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.tp4r-qd-original-price {
    color: #999;
    font-size: 0.85em;
    text-decoration: line-through;
}

.tp4r-qd-discounted-price {
    color: #333;
    font-weight: 700;
    text-decoration: none;
    background: none;
}

.tp4r-qd-savings {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
}

/* ===== Variable Product Notice ===== */
.tp4r-qd-variable-notice {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #666;
}

/* ===== Deals Banner Wrapper ===== */
.tp4r-qd-deals-wrapper {
    margin: 20px 0;
    padding: 0;
}

.tp4r-qd-deals-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* ===== Deal Cards Grid ===== */
.tp4r-qd-deals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== Single Deal Card ===== */
.tp4r-qd-deal-card {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tp4r-qd-deal-card:hover {
    border-color: #333;
    background: #fff;
}

.tp4r-qd-deal-card.tp4r-qd-active {
    border-color: #333;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Deal Image Container */
.tp4r-qd-deal-image {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
}

.tp4r-qd-deal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.tp4r-qd-deal-qty-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 24px;
}

/* Deal Info */
.tp4r-qd-deal-discount {
    font-size: 16px;
    font-weight: 700;
    color: #c62828;
    margin-bottom: 4px;
}

.tp4r-qd-deal-price {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.tp4r-qd-deal-price del {
    color: #999;
    font-size: 11px;
    margin-left: 4px;
}

.tp4r-qd-deal-savings {
    font-size: 11px;
    color: #2e7d32;
    margin-bottom: 8px;
}

/* Add to Cart Button */
.tp4r-qd-deal-btn {
    display: block;
    width: 100%;
    padding: 6px 10px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tp4r-qd-deal-btn:hover {
    background: #555;
}

/* ===== Encouragement Message ===== */
.tp4r-qd-encouragement {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
}

.tp4r-qd-encouragement-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.tp4r-qd-encouragement-text strong {
    color: #f57c00;
}

/* ===== Cart Notice ===== */
.tp4r-qd-cart-notice {
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
}

.tp4r-qd-cart-notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.tp4r-qd-cart-notice ul {
    margin: 0;
    padding: 0 15px 0 0;
    list-style: none;
}

.tp4r-qd-cart-notice li {
    padding: 5px 0;
    font-size: 13px;
    color: #555;
}

/* ===== Cart Savings Summary ===== */
.tp4r-qd-savings-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 15px;
    background: #e8f5e9;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #2e7d32;
    font-weight: 600;
}

/* ===== Cart Item Price ===== */
.tp4r-qd-cart-price,
.tp4r-qd-cart-subtotal {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tp4r-qd-cart-price del,
.tp4r-qd-cart-subtotal del {
    color: #999;
    font-size: 0.85em;
}

.tp4r-qd-cart-price ins,
.tp4r-qd-cart-subtotal ins {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    background: none;
}

.tp4r-qd-discount-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #333;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    margin-top: 4px;
}

/* ===== Checkout Savings ===== */
.tp4r-qd-checkout-savings th,
.tp4r-qd-checkout-savings td {
    background: #f5f5f5 !important;
}

.tp4r-qd-checkout-savings td {
    color: #2e7d32 !important;
    font-weight: 600 !important;
}

/* ===== Dynamic Price Update ===== */
.tp4r-qd-price-updating {
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* ===== Mini Info on Archive ===== */
.tp4r-qd-mini-info {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .tp4r-qd-badge {
        top: 5px;
        right: 5px;
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .tp4r-qd-deals-grid {
        gap: 8px;
    }
    
    .tp4r-qd-deal-card {
        min-width: 100px;
        max-width: 140px;
        padding: 10px;
    }
    
    .tp4r-qd-deal-image {
        width: 50px;
        height: 50px;
    }
    
    .tp4r-qd-deal-discount {
        font-size: 14px;
    }
    
    .tp4r-qd-deal-price {
        font-size: 12px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    .tp4r-qd-deal-card {
        transition: none;
    }
}
