@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
    --primary-color: #e74c3c;
    --secondary-color: #2ecc71;
    --text-color: #2c3e50;
    --light-gray: #f5f7fa;
    --white: #fff;
}

.mossaab-form-container {
    color-scheme: light;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #667eea, #764ba2);
    min-height: 100vh;
    padding: 20px 0;
}

.mossaab-form-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.mossaab-form-container .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
}

.form-header h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,.3);
}

.form-header .subtitle {
    font-size: 1.1rem;
    opacity: .9;
}

.form-container {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
    max-width: 600px;
    margin: 0 auto 30px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp .4s ease;
}

.step-header {
    text-align: center;
    margin-bottom: 24px;
}

.step-header h2 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-bottom: 6px;
}

.step-header p {
    color: #718096;
    font-size: .95rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.modern-input, .modern-select, textarea.modern-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    transition: .2s;
    font-family: 'Tajawal', sans-serif;
}

.modern-input:focus, .modern-select:focus, textarea.modern-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102,126,234,.12);
}

.select-wrapper {
    position: relative;
}

.select-wrapper .modern-select {
    appearance: none;
    padding-right: 40px;
}

.select-arrow {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
}

.validation-error {
    color: #e53e3e;
    font-size: .85rem;
    margin-top: 6px;
}

.step-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 16px;
}

.btn-prev, .btn-next, .btn-submit {
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Tajawal', sans-serif;
}

.btn-prev {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-prev:hover {
    background: #cbd5e0;
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.btn-next:hover, .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(102,126,234,.28);
}

.btn-submit.loading {
    pointer-events: none;
    opacity: .8;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 4px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 8px;
    border: 4px solid #fff;
}

.step-text {
    font-size: .9rem;
    color: #718096;
    font-weight: 500;
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.progress-step.active .step-text {
    color: #2d3748;
}

.option-group {
    margin-bottom: 24px;
}

.option-label {
    font-weight: 700;
    margin-bottom: 12px;
    color: #2d3748;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-circles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.color-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    transition: .2s;
    margin-bottom: 6px;
}

.color-circle.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.2);
}

.color-name {
    font-size: .85rem;
    color: #4a5568;
    text-align: center;
}

.size-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.size-option-item {
    display: flex;
    justify-content: center;
}

.size-option {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: .2s;
    font-weight: 500;
    background: #f8fafc;
    width: 100%;
}

.size-option:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.size-option.selected {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

.selected-items-container {
    margin-top: 24px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.selected-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: #2d3748;
    font-size: 1.1rem;
}

.selected-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* أنماط أزرار الكمية */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f0f0f0;
}

.quantity-btn.minus {
    color: #e74c3c;
}

.quantity-btn.plus {
    color: #2ecc71;
}

.quantity-display {
    font-weight: bold;
    padding: 0 8px;
    min-width: 30px;
    text-align: center;
}

.remove-selection {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 8px;
}

.remove-selection:hover {
    background: #c0392b;
}

.delivery-section {
    margin-bottom: 24px;
}

.delivery-options-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.delivery-card {
    position: relative;
}

.delivery-radio {
    position: absolute;
    opacity: 0;
}

.delivery-card-label {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: .2s;
    background: #f8fafc;
}

.delivery-card-label:hover {
    border-color: #cbd5e0;
}

.delivery-radio:checked + .delivery-card-label {
    border-color: #667eea;
    background: rgba(102,126,234,.08);
}

.card-icon {
    font-size: 1.8rem;
    margin-left: 12px;
}

.card-content h4 {
    margin-bottom: 4px;
    color: #2d3748;
}

.card-content p {
    color: #718096;
    font-size: .9rem;
    margin-bottom: 6px;
}

.delivery-price {
    color: #667eea;
    font-weight: 700;
}

.order-summary-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.summary-title {
    font-weight: 700;
    margin-bottom: 16px;
    color: #2d3748;
    font-size: 1.1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #4a5568;
}

.summary-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0;
}

.total-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
}

.floating-order-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.order-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: 0;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(102,126,234,.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: .2s;
}

.order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(102,126,234,.5);
}

#order-bump-offer {
    margin-bottom: 24px;
    padding: 16px;
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-radius: 12px;
}

.bump-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #2d3748;
}

.bump-text2 {
    color: #4a5568;
    font-size: .95rem;
}

.bump-text2 .limited {
    color: #e74c3c;
    font-weight: 700;
}

.arrow {
    font-size: 1.2rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Service details styling */
.service-details-container textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Tajawal', sans-serif;
}

/* إخفاء الكمية في البيع بالتجزئة */
.sale-type-retail .selected-item .quantity-btn,
.sale-type-retail .selected-item .quantity-display {
    display: none !important;
}

.sale-type-wholesale .selected-item .quantity-control {
    display: flex !important;
}

/* جعل النص في ملخص الطلب أسود */
.summary-item {
    color: #000 !important;
}

/* تنسيقات ORDER BUMP في الملخص */
.order-bump-item {
    background-color: #fffbe6 !important;
    border-left: 3px solid #ffd700 !important;
    padding: 10px !important;
    margin: 5px 0 !important;
    border-radius: 5px !important;
}

.summary-item {
    color: #000 !important;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Selection notice styling */
.selection-notice {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.selection-notice i {
    color: #0369a1;
    font-size: 1.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .delivery-options-cards {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .container {
        padding: 10px;
    }
    
    .form-header h1 {
        font-size: 2rem;
    }
    
    .floating-order-btn {
        bottom: 10px;
        left: 10px;
        right: 10px;
        text-align: center;
    }
    
    .order-btn {
        width: 100%;
        justify-content: center;
    }
    
    .color-circles-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .size-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .selected-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .quantity-control {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-header h1 {
        font-size: 1.8rem;
    }
    
    .form-progress {
        flex-wrap: wrap;
    }
    
    .progress-step {
        flex: 1;
        min-width: 80px;
    }
    
    .color-circle {
        width: 45px;
        height: 45px;
    }
    
    .selected-items-container {
        padding: 20px 15px;
    }
}

/* Hide product selection for service forms */
.service-form .product-selection {
    display: none;
}

.service-form .service-details-container {
    display: block;
}

/* Show service details for service forms */
.service-details-container {
    display: none;
}

.service-form .service-details-container {
    display: block;
}

/* Dynamic selection text based on available options */
.selection-required-text {
    color: #e53e3e;
    font-weight: 600;
    margin-top: 10px;
}