/**
 * DeltaNodes - Estilos del Sistema de Pedidos
 * ============================================
 */

/* Modal Overlay */
.order-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.order-modal.active {
    opacity: 1;
    visibility: visible;
}

.order-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

/* Modal Content */
.order-modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(25, 25, 25, 0.98), rgba(15, 15, 15, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.order-modal.active .order-modal-content {
    transform: translateY(0);
}

/* Close Button */
.order-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.order-modal-close svg {
    width: 20px;
    height: 20px;
    color: #888;
}

.order-modal-close:hover {
    background: rgba(255, 0, 0, 0.2);
}

.order-modal-close:hover svg {
    color: #ff4444;
}

/* Header */
.order-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.order-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700, #FDB931);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.order-header p {
    color: #888;
    font-size: 0.95rem;
}

/* Plan Info */
.order-plan-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}

.order-plan-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.order-plan-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.order-plan-description {
    font-size: 0.85rem;
    color: #888;
}

.order-plan-price {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700, #FDB931);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Form */
#order-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.order-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ccc;
}

.order-form-group input {
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.order-form-group input::placeholder {
    color: #666;
}

.order-form-group input:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.order-form-group input:invalid:not(:placeholder-shown) {
    border-color: rgba(255, 68, 68, 0.5);
}

.order-form-hint {
    font-size: 0.8rem;
    color: #666;
}

/* Submit Button */
.order-submit-btn {
    margin-top: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 50%, #B8860B 100%);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.order-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

.order-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner circle {
    stroke-dasharray: 30 70;
    stroke-linecap: round;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Footer */
.order-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #666;
    font-size: 0.85rem;
}

.order-footer svg {
    width: 18px;
    height: 18px;
    color: #50c878;
}

/* Success State */
.order-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 0;
    animation: fadeIn 0.5s ease;
}

.order-success svg {
    width: 80px;
    height: 80px;
    color: #50c878;
    margin-bottom: 1rem;
}

.order-success h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.order-success p {
    color: #888;
    margin-bottom: 0.5rem;
}

.order-invoice-number {
    font-family: monospace;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #FFD700;
    font-size: 0.9rem;
}

.order-done-btn {
    margin-top: 1.5rem;
    padding: 0.8rem 2rem;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    color: #FFD700;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-done-btn:hover {
    background: rgba(255, 215, 0, 0.3);
}

/* Error State */
.order-error {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-radius: 12px;
    margin-top: 1rem;
    animation: shake 0.5s ease;
}

.order-error svg {
    width: 50px;
    height: 50px;
    color: #ff4444;
    margin-bottom: 0.5rem;
}

.order-error h3 {
    color: #ff4444;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.order-error p {
    color: #888;
    font-size: 0.9rem;
}

.order-retry-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 8px;
    color: #ff4444;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-retry-btn:hover {
    background: rgba(255, 68, 68, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Responsive */
@media (max-width: 500px) {
    .order-modal-content {
        width: 95%;
        padding: 1.5rem;
        border-radius: 15px;
    }

    .order-form-row {
        grid-template-columns: 1fr;
    }

    .order-header h2 {
        font-size: 1.5rem;
    }
}