/* ============================================
   ORDER POPUP - COMPACT MODERN DESIGN
   ============================================ */

/* Main Popup Container */
#generalOrderPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    background: linear-gradient(135deg, #ffffff 0%, #f8fdf5 100%);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(154, 188, 49, 0.25), 0 8px 30px rgba(0, 0, 0, 0.12);
    visibility: hidden;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#generalOrderPopup.active {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Custom Scrollbar */
#generalOrderPopup::-webkit-scrollbar {
    width: 6px;
}

#generalOrderPopup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#generalOrderPopup::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9abc31, #7a9a20);
    border-radius: 10px;
}

/* Popup Content */
#generalOrderPopup .general-popup-content {
    padding: 20px;
    position: relative;
}

/* Header */
#generalOrderPopup .general-popup-content h2 {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 15px 0;
    padding: 12px 15px;
    background: linear-gradient(135deg, #9abc31 0%, #7a9a20 100%);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(154, 188, 49, 0.3);
}

/* Close Button */
#generalOrderPopup .close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(238, 90, 90, 0.4);
    z-index: 10;
}

#generalOrderPopup .close:hover {
    transform: rotate(90deg) scale(1.1);
}

#generalOrderPopup .close font {
    font-size: 16px !important;
    color: #fff !important;
    font-weight: bold;
}

/* Form Groups */
#generalOrderPopup .form-group {
    margin-bottom: 12px;
}

#generalOrderPopup .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2d5016;
    font-size: 13px;
}

#generalOrderPopup .form-group label .required {
    color: #ff6b6b;
}

/* Form Controls */
#generalOrderPopup .form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8f0dc;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    line-height: 1.5;
    height: auto;
    min-height: 44px;
}

#generalOrderPopup .form-control:focus {
    outline: none;
    border-color: #9abc31;
    box-shadow: 0 0 0 3px rgba(154, 188, 49, 0.15);
}

/* Select Styling - FIX for visibility */
#generalOrderPopup select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239abc31' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding: 13px 40px 13px 14px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    height: 48px;
    vertical-align: middle;
    display: block;
}

#generalOrderPopup select.form-control option {
    color: #333;
    background: #fff;
    padding: 10px 14px;
    line-height: 2;
    min-height: 40px;
    font-size: 14px;
    white-space: normal;
    height: auto;
}

#generalOrderPopup select.form-control optgroup {
    font-weight: 600;
    color: #2d5016;
    padding: 5px 0;
}

/* Price Summary */
#generalOrderPopup .price-summary {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.15);
}

#generalOrderPopup .price-summary .price-label {
    font-size: 12px;
    color: #8b6914;
    margin-bottom: 3px;
    font-weight: 500;
    text-transform: uppercase;
}

#generalOrderPopup .price-summary .price-value {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #9abc31 0%, #5a7a10 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#generalOrderPopup .price-summary .price-currency {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #9abc31 0%, #5a7a10 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#generalOrderPopup .price-summary .price-note {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

/* Consent Group */
#generalOrderPopup .consent-group {
    margin: 15px 0;
    padding: 12px;
    background: #f8fdf5;
    border-radius: 8px;
    border: 1px solid #e8f0dc;
}

#generalOrderPopup .checkbox-label {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.5;
    color: #555;
    user-select: none;
    gap: 10px;
}

#generalOrderPopup .checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom Checkbox */
#generalOrderPopup .checkbox-label .checkmark {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    flex-shrink: 0;
    border: 2px solid #9abc31;
    border-radius: 5px;
    position: relative;
    transition: all 0.3s ease;
    background: #fff;
    display: inline-block;
    vertical-align: middle;
}

#generalOrderPopup .checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #9abc31 0%, #7a9a20 100%);
    border-color: #7a9a20;
}

#generalOrderPopup .checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#generalOrderPopup .consent-text {
    flex: 1;
    line-height: 1.5;
}

#generalOrderPopup .consent-text a {
    color: #9abc31;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #9abc31;
}

/* Consent Error */
#generalOrderPopup .consent-error {
    display: none;
    color: #d32f2f;
    font-size: 12px;
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    text-align: center;
}

#generalOrderPopup .consent-error.show {
    display: block;
}

/* Phone Error */
#generalOrderPopup .phone-error {
    display: none;
    color: #d32f2f;
    font-size: 12px;
    margin-top: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    text-align: center;
    animation: shake 0.3s ease-in-out;
}

#generalOrderPopup .phone-error.show {
    display: block;
}

/* Invalid input styling */
#generalOrderPopup .form-control.invalid {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15) !important;
    background: #fff8f8;
}

/* Phone input styling */
#generalOrderPopup #orderPhone {
    letter-spacing: 0.5px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Submit Button */
#generalOrderPopup #orderSubmitBtn {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
    color: #666;
    box-shadow: none;
}

#generalOrderPopup #orderSubmitBtn:not(:disabled) {
    background: linear-gradient(135deg, #9abc31 0%, #5a7a10 100%);
    color: #fff;
    box-shadow: 0 5px 20px rgba(154, 188, 49, 0.4);
}

#generalOrderPopup #orderSubmitBtn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(154, 188, 49, 0.5);
}

#generalOrderPopup #orderSubmitBtn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Mobile Phones */
@media (max-width: 480px) {
    #generalOrderPopup {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-width: none;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(100%) scale(1);
    }
    
    #generalOrderPopup.active {
        transform: translateY(0) scale(1);
    }
    
    #generalOrderPopup .general-popup-content {
        padding: 15px;
        padding-top: 45px;
    }
    
    #generalOrderPopup .close {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
    }
    
    #generalOrderPopup .general-popup-content h2 {
        font-size: 16px;
        padding: 10px;
        margin-bottom: 12px;
    }
    
    #generalOrderPopup .form-group {
        margin-bottom: 10px;
    }
    
    #generalOrderPopup .form-control {
        padding: 10px;
        font-size: 16px;
    }
    
    #generalOrderPopup .price-summary {
        padding: 10px;
        margin: 12px 0;
    }
    
    #generalOrderPopup .price-summary .price-value {
        font-size: 24px;
    }
    
    #generalOrderPopup #orderSubmitBtn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Landscape Mode on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #generalOrderPopup {
        max-height: 100vh;
    }
    
    #generalOrderPopup .general-popup-content {
        padding: 12px;
    }
    
    #generalOrderPopup .general-popup-content h2 {
        font-size: 14px;
        padding: 8px;
        margin-bottom: 10px;
    }
    
    #generalOrderPopup .form-group {
        margin-bottom: 8px;
    }
    
    #generalOrderPopup .price-summary {
        padding: 8px;
        margin: 10px 0;
    }
}

/* Decorative top bar */
#generalOrderPopup .general-popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9abc31, #ffd700, #9abc31);
    border-radius: 16px 16px 0 0;
}

@media (max-width: 480px) {
    #generalOrderPopup .general-popup-content::before {
        display: none;
    }
}