/**
 * Estilos para el shortcode de órdenes de cocina
 * Padrino Ventas Plugin
 */

/* ===== CONTENEDOR PRINCIPAL ===== */
.padrino-kitchen-orders-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    background: #f8f9fa;
    min-height: 500px;
}

/* ===== HEADER DE COCINA ===== */
.kitchen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border: 1px solid #e1e5e9;
}

.kitchen-header-left h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.orders-count {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.kitchen-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-refresh {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-refresh .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.auto-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #7f8c8d;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== CONTENEDOR DE ÓRDENES ===== */
.orders-container {
    position: relative;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== TARJETA DE ORDEN ===== */
.order-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e1e5e9;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ===== HEADER DE LA ORDEN (AZUL) ===== */
.order-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.order-header-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-folio {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.order-type {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.order-time {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

.mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===== CONTENIDO DE LA ORDEN (BLANCO) ===== */
.order-content {
    padding: 20px;
    background: white;
}

.order-customer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.customer-icon {
    font-size: 14px;
}

.customer-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

/* ===== PRODUCTOS ===== */
.order-products {
    margin-bottom: 15px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f2f6;
}

.product-item:last-child {
    border-bottom: none;
}

.product-quantity {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.product-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

/* ===== OBSERVACIONES ===== */
.order-observations {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.obs-icon {
    font-size: 14px;
}

.obs-text {
    flex: 1;
    font-size: 13px;
    color: #856404;
    line-height: 1.4;
}

/* ===== BOTÓN COMPLETAR ORDEN ===== */
.order-actions {
    margin-top: 15px;
}

.btn-complete-order {
    width: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-complete-order:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-1px);
}

.btn-complete-order:active {
    transform: translateY(0);
}

/* ===== ESTADO VACÍO ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.empty-state h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-state p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 25px;
}

/* ===== MODAL DE CONFIRMACIÓN ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #f1f2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #7f8c8d;
}

.modal-body {
    padding: 20px 25px;
}

.modal-body p {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.modal-order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.modal-footer {
    padding: 15px 25px 25px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.btn-confirm {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

/* ===== OVERLAY DE CARGA ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 768px) {
    .padrino-kitchen-orders-container {
        padding: 15px;
    }

    .kitchen-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .kitchen-header-right {
        justify-content: center;
    }

    .orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }

    .order-card {
        font-size: 14px;
    }
}

/* ===== RESPONSIVE - MÓVIL ===== */
@media (max-width: 480px) {
    .padrino-kitchen-orders-container {
        padding: 10px;
    }

    .kitchen-header {
        padding: 15px;
    }

    .kitchen-header-left h2 {
        font-size: 20px;
    }

    .btn-refresh {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Grid se convierte en lista */
    .orders-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Mostrar botón mobile toggle */
    .mobile-toggle {
        display: flex;
    }

    .order-header {
        cursor: pointer;
        user-select: none;
    }

    /* Contenido colapsado por defecto en móvil */
    .order-content {
        display: none;
        padding: 15px;
    }

    .order-card.expanded .order-content {
        display: block;
    }

    .order-card.expanded .mobile-toggle .dashicons:before {
        content: "\f142"; /* arrow-up */
    }

    .order-folio {
        font-size: 16px;
    }

    .order-type {
        font-size: 12px;
    }

    .product-item {
        padding: 6px 0;
    }

    .product-name {
        font-size: 13px;
    }

    .btn-complete-order {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Modal responsive */
    .modal-content {
        margin: 0 10px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-confirm {
        width: 100%;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
.order-card.completing {
    opacity: 0.6;
    pointer-events: none;
    transform: scale(0.98);
}

.order-card.completed {
    animation: slideOut 0.5s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-100%);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* ===== ESTADOS DE TIPO DE CONSUMO ===== */
.order-header[data-consumo="local"] {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.order-header[data-consumo="llevar"] {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.order-header[data-consumo="envio"] {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .pulse-dot {
        animation: none;
    }
    
    .empty-icon {
        animation: none;
    }
}

/* ===== MODO OSCURO (OPCIONAL) ===== */
@media (prefers-color-scheme: dark) {
    .padrino-kitchen-orders-container {
        background: #1a1a1a;
        color: #ffffff;
    }

    .kitchen-header,
    .order-card,
    .order-content,
    .empty-state,
    .modal-content {
        background: #2c2c2c;
        border-color: #404040;
    }

    .kitchen-header-left h2,
    .customer-name,
    .product-name {
        color: #ffffff;
    }

    .order-customer {
        background: #3a3a3a;
    }

    .empty-state h3 {
        color: #ffffff;
    }

    .empty-state p {
        color: #b0b0b0;
    }
}