/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    line-height: 1.7;
    font-weight: 400;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

/* Main Content */
.main-content {
    padding: 0;
}

/* Product Banner */
.product-banner {
    width: 100%;
    margin-bottom: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Order Section */
.order-section {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 30px;
    padding-bottom: 40px;
    box-shadow: 0 -5px 35px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    margin-top: -5px;
}

/* Order Form */
.order-form {
    width: 100%;
}

.form-header {
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 18px;
    border-radius: 15px;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #999;
    font-weight: 300;
}

/* Delivery Selection */
.delivery-selection-label {
    display: block;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.delivery-selection-label i {
    margin-left: 6px;
    color: #28a745;
    font-size: 13px;
}

.delivery-options-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
}

.delivery-option {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-family: 'Cairo', sans-serif;
    text-align: center;
    min-height: 40px;
    flex: 1;
}

.delivery-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.delivery-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    font-weight: 600;
}

.delivery-price-display {
    text-align: center;
    font-weight: 600;
    color: #495057;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    font-size: 13px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
}

.delivery-price-display:empty {
    display: none;
}

/* Quantity Section */
.quantity-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.quantity-section label {
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.qty-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.qty-btn:first-child {
    border-radius: 10px 0 0 10px;
}

.qty-btn:last-child {
    border-radius: 0 10px 10px 0;
}

#quantity {
    width: 70px;
    height: 45px;
    text-align: center;
    border: none;
    background: white;
    font-weight: bold;
    font-size: 18px;
    font-family: 'Cairo', sans-serif;
    color: #667eea;
}

/* Price Display */
.price-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    padding-bottom: 25px;
    margin: 25px 0;
    margin-bottom: 0;
    border: 2px solid #dee2e6;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    color: #495057;
}

.price-values {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.current-price {
    color: #667eea;
    font-weight: 700;
    font-size: 18px;
}

.delivery-cost {
    font-weight: 600;
    color: #28a745;
}

.price-divider {
    height: 2px;
    background: #dee2e6;
    margin: 15px 0;
}

.price-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    font-weight: 700;
    font-size: 18px;
    color: #667eea;
}

.total-amount {
    color: #28a745;
    font-size: 22px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 18px 25px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 25px;
    border-radius: 15px;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: none;
    transition: transform 0.2s ease;
}

.close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s ease;
    line-height: 1;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #666;
    background: #f5f5f5;
    border-radius: 50%;
}

.modal-icon {
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.modal.success .modal-icon {
    color: #28a745;
}

.modal.success .modal-icon::before {
    content: '✓';
}

.modal.error .modal-icon {
    color: #dc3545;
}

.modal.error .modal-icon::before {
    content: '✕';
}

.modal-message {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    font-weight: 500;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

/* Form Validation */
.form-group input.invalid,
.form-group select.invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15) !important;
}

.validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .order-section {
        padding: 20px;
        padding-bottom: 35px;
        border-radius: 15px 15px 0 0;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group input,
    .form-group select {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .form-header {
        padding: 15px;
        font-size: 16px;
    }
    
    .submit-btn {
        font-size: 16px;
        padding: 16px 20px;
    }
    
    .quantity-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 18px;
    }
    
    .delivery-options-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .delivery-option {
        width: 100%;
        padding: 12px 20px;
    }
    
    .price-display {
        padding: 18px;
    }
    
    .price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .price-values {
        width: 100%;
        justify-content: space-between;
    }
    
    .modal-content {
        width: 85%;
        max-width: 280px;
        padding: 18px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }
    
    .product-banner {
        margin-bottom: 0;
    }
    
    .order-section {
        padding: 15px;
        padding-bottom: 30px;
        border-radius: 12px 12px 0 0;
        margin-top: -3px;
    }
    
    .form-header {
        padding: 12px;
        font-size: 14px;
        gap: 8px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .submit-btn {
        font-size: 15px;
        padding: 14px 18px;
    }
    
    .quantity-section {
        padding: 15px;
    }
    
    .qty-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    #quantity {
        width: 60px;
        height: 40px;
        font-size: 16px;
    }
    
    .price-display {
        padding: 15px;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .total-amount {
        font-size: 20px;
    }
}

/* Floating Order Button Animation */
@keyframes floatPulse {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-8px);
    }
}

/* Floating Order Button */
.floating-order-btn {
    position: fixed;
    bottom: 70px;
    right: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 18px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    animation: floatPulse 2.5s ease-in-out infinite;
}

.floating-order-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
    animation: none;
}

.floating-order-btn:active {
    transform: translateY(-1px);
}

.floating-order-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
}

.floating-order-btn i {
    font-size: 19px;
}

@media (max-width: 768px) {
    .floating-order-btn {
        bottom: 55px;
        right: 30px;
        padding: 16px 28px;
        font-size: 16px;
    }
    
    .floating-order-btn i {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .floating-order-btn {
        bottom: 50px;
        right: 25px;
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .floating-order-btn i {
        font-size: 16px;
    }
}
