/* Modal (Order & User) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--light-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: 300;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--primary-color);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 80, 0.1);
}

.order-summary {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1.5rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.summary-row.total {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.form-error {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* User Modal (Account Info & Change Password) */
.user-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.user-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.user-modal-content {
    position: relative;
    background: var(--light-color);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
    z-index: 1;
}

.user-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.user-modal-header h2 {
    font-size: 1.2rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.user-modal-header h2 i {
    color: var(--primary-color);
}

.user-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.user-modal-close:hover {
    color: var(--primary-color);
}

.user-modal-body {
    padding: 1.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.info-row span {
    color: var(--gray-color);
    font-size: 0.95rem;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.info-row.highlight {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    margin: 0.5rem -1.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
}

.info-row.highlight label {
    color: #e65100;
}

.info-row.highlight span {
    color: #e65100;
    font-weight: 700;
    font-size: 1.1rem;
}

.auth-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Delivery Modal */
.delivery-modal-content {
    max-width: 550px !important;
    text-align: center;
    padding: 2rem !important;
}

.delivery-success-icon {
    margin: 1rem 0;
}

.delivery-success-icon i {
    font-size: 4rem;
    color: #00c853;
}

.delivery-subtitle {
    color: var(--gray-color, #8a8b91);
    margin-bottom: 1rem;
}

.delivery-warning {
    background: #fff3e0;
    border: 1px solid #ffab00;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #e65100;
}

.delivery-warning i {
    margin-top: 2px;
}

.delivery-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.delivery-account-item {
    background: #f5f7fa;
    border-radius: 8px;
    overflow: hidden;
}

.delivery-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #e3e3e4;
    font-size: 0.85rem;
    font-weight: 600;
}

.delivery-account-data {
    padding: 0.75rem 1rem;
}

.delivery-account-data code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: #161823;
    user-select: all;
}

.copy-btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8rem !important;
}

/* Product Form Modal */
.modal-content.product-form-modal {
    max-width: 560px;
}

.pf-section {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.pf-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.pf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pf-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.pf-row .form-group,
.pf-row-3 .form-group {
    margin-bottom: 0;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--light-color);
    transition: var(--transition);
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 80, 0.1);
}

.pf-actions {
    margin-top: 1.5rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.btn-secondary {
    background: #fff;
    color: #161823;
    border: 1px solid #e3e3e4;
}

.btn-secondary:hover {
    background: #f5f7fa;
}