/**
 * Quantity Discounts - Quick Order Modal Styles
 */

/* Wrapper inside modal */
.quick-order-discount-wrapper {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.quick-order-discount-wrapper h6 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.quick-order-discount-wrapper .discount-max-percent {
    color: #FF5252;
    font-weight: 800;
}

/* Discount Options */
.quick-order-discount-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.discount-option {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.discount-option:hover {
    border-color: #4CAF50;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.discount-option.selected {
    border-color: #FF5252;
    background: #FFF5F5;
    box-shadow: 0 3px 12px rgba(255, 82, 82, 0.2);
}

.discount-option input[type="radio"] {
    position: absolute;
    width: 20px;
    height: 20px;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    accent-color: #FF5252;
}

.discount-option label {
    display: block;
    cursor: pointer;
    margin: 0 0 0 32px;
}

.option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.option-left h6 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.save-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    background: #E0E0E0;
    color: #666;
}

.save-badge.save-20 {
    background: #C8E6C9;
    color: #2E7D32;
}

.save-badge.save-30 {
    background: #FFCDD2;
    color: #C62828;
}

.save-badge.save-40,
.save-badge.save-50 {
    background: #FFCDD2;
    color: #C62828;
}

.option-right {
    text-align: right;
    flex-shrink: 0;
}

.price-current {
    font-size: 18px;
    font-weight: 700;
    color: #FF5252;
    margin-bottom: 2px;
    white-space: nowrap;
}

.price-original {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    white-space: nowrap;
}

/* Option Badges (Popular, Best Value, etc.) */
.option-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: #FF5252;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    z-index: 1;
}

/* Responsive adjustments for modal */
@media (max-width: 576px) {
    .quick-order-discount-wrapper {
        padding: 12px;
    }

    .discount-option {
        padding: 12px;
    }

    .option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .option-right {
        width: 100%;
        text-align: left;
    }

    .price-current {
        font-size: 16px;
    }

    .option-left h6 {
        font-size: 14px;
    }

    .discount-option label {
        margin-left: 28px;
    }
}

/* RTL Support (for Arabic) */
[dir="rtl"] .discount-option input[type="radio"] {
    left: auto;
    right: 14px;
}

[dir="rtl"] .discount-option label {
    margin: 0 32px 0 0;
}

[dir="rtl"] .option-right {
    text-align: left;
}

[dir="rtl"] .option-badge {
    right: auto;
    left: 14px;
}

@media (max-width: 576px) {
    [dir="rtl"] .discount-option label {
        margin-right: 28px;
        margin-left: 0;
    }
}

/* ========================================
   Upsell Products Styles
   ======================================== */

.quick-order-upsells-wrapper {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.quick-order-upsells-wrapper h6 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.quick-order-upsells-wrapper h6 svg {
    stroke: #4CAF50;
}

.quick-order-upsells-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upsell-product {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upsell-product:hover {
    border-color: #4CAF50;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.upsell-product.selected {
    border-color: #4CAF50;
    background: #F1F8F4;
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.2);
}

.sale-badge {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #FF5252;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.upsell-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upsell-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.upsell-info {
    flex: 1;
}

.upsell-name {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.upsell-price {
    font-size: 16px;
    font-weight: 700;
    color: #4CAF50;
}

.upsell-price .price-sale {
    color: #FF5252;
    margin-left: 8px;
}

.upsell-price .price-regular {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.upsell-actions {
    flex-shrink: 0;
}

.upsell-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.upsell-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.checkbox-label {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
    white-space: nowrap;
}

.upsell-product.selected .checkbox-label {
    color: #2E7D32;
}

/* Responsive upsells */
@media (max-width: 576px) {
    .upsell-image {
        width: 50px;
        height: 50px;
    }

    .upsell-name {
        font-size: 14px;
    }

    .upsell-price {
        font-size: 14px;
    }
}

/* RTL Support for upsells */
[dir="rtl"] .sale-badge {
    left: auto;
    right: 12px;
}

[dir="rtl"] .upsell-price .price-sale {
    margin-left: 0;
    margin-right: 8px;
}

/* ========================================
   Sticky Quick Order Button
   ======================================== */

.sticky-quick-order-button {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    opacity: 0;
    transform: translateY(100px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: block !important;
    visibility: visible !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
}

.sticky-quick-order-button.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.sticky-order-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
    color: white !important;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    transition: all 0.3s ease;
    white-space: nowrap;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: auto !important;
    height: auto !important;
}

.sticky-order-btn:hover {
    background: linear-gradient(135deg, #45A049 0%, #388E3C 100%);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
}

.sticky-order-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(76, 175, 80, 0.4);
}

.sticky-order-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    flex-shrink: 0;
}

.sticky-btn-text {
    font-size: 16px;
    font-weight: 700;
}

/* Pulse animation for attention */
@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.sticky-order-btn.pulse {
    animation: pulse-ring 2s infinite;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sticky-quick-order-button {
        bottom: 15px !important;
        right: 15px !important;
        display: block !important;
    }

    .sticky-order-btn {
        padding: 14px 22px !important;
        font-size: 15px !important;
        min-width: auto !important;
        /* Ensure good touch target size */
        min-height: 48px;
    }

    .sticky-btn-text {
        font-size: 15px !important;
    }

    .sticky-order-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
}

@media (max-width: 576px) {
    .sticky-quick-order-button {
        bottom: 12px !important;
        right: 12px !important;
    }

    .sticky-order-btn {
        padding: 12px 18px !important;
        font-size: 14px !important;
    }

    .sticky-btn-text {
        font-size: 14px !important;
    }

    .sticky-order-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* RTL Support */
[dir="rtl"] .sticky-quick-order-button {
    right: auto !important;
    left: 20px !important;
}

@media (max-width: 768px) {
    [dir="rtl"] .sticky-quick-order-button {
        left: 15px !important;
    }
}

@media (max-width: 576px) {
    [dir="rtl"] .sticky-quick-order-button {
        left: 12px !important;
    }
}
