/* ============================================
   Sistema de Pedidos - Estilos unificados con Presupuestador
   ============================================ */

/* ============================================
   CSS VARIABLES - Sistema de Diseño (igual al Presupuestador)
   ============================================ */
:root {
    /* Colores principales - IGUAL AL PRESUPUESTADOR */
    --primary: #FF6600;
    --primary-dark: #e55c00;
    --primary-light: #FF8533;

    --secondary: #333;
    --secondary-dark: #222;
    --secondary-light: #555;

    /* Colores de estado */
    --color-success: #55aa44;
    --color-warning: #F59E0B;
    --color-error: #E31937;
    --color-info: #3B82F6;

    /* Grises */
    --light: #f4f4f4;
    --border: #ddd;
    --gray-600: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;

    --white: #FFFFFF;
    --dark: #333;

    /* Estados de pedidos */
    --color-pendiente: #F58427;
    --color-pedido: #3B82F6;
    --color-encamino: #8B5CF6;
    --color-deposito: #10B981;

    /* Tipografía - IGUAL AL PRESUPUESTADOR */
    --font-primary: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 4px 20px rgba(0, 0, 0, 0.1);

    /* Bordes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-full: 9999px;

    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Transiciones */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
}

/* ============================================
   RESET Y ESTILOS GLOBALES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background: var(--light);
    color: var(--secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER - Estilo Presupuestador
   ============================================ */
.header {
    background: var(--white);
    padding: 10px 20px;
    border-bottom: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
}

/* ============================================
   CONTENEDORES
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ============================================
   BOTONES - Estilo Presupuestador
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 25px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   CARDS - Estilo Presupuestador
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--primary);
    color: var(--dark);
}

/* ============================================
   GRIDS
   ============================================ */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FORMULARIOS - Estilo Presupuestador
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 10px;
    font-family: var(--font-primary);
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: all var(--transition-fast);
}

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

.form-select {
    width: 100%;
    padding: 10px;
    font-family: var(--font-primary);
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   BADGES - Estilo Presupuestador
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 15px;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary);
    color: var(--white);
}

.badge-success {
    background: var(--color-success);
    color: var(--white);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--white);
}

.badge-error {
    background: var(--color-error);
    color: var(--white);
}

/* ============================================
   MODAL - Estilo Presupuestador
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 0;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
}

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

.modal-body {
    margin-bottom: var(--spacing-md);
}

/* Toast styles moved to toast.css */

/* ============================================
   BOTÓN FLOTANTE (CARRITO) - Estilo Presupuestador
   ============================================ */
.floating-btn {
    position: fixed;
    bottom: var(--spacing-2xl);
    right: var(--spacing-2xl);
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-base);
    z-index: 999;
    text-decoration: none;
    animation: pulse-glow 2s ease-in-out infinite;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.6);
    animation: none;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 102, 0, 0.7);
    }
}

.floating-btn .badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-error);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--white);
}

/* ============================================
   TABLA - Estilo Presupuestador
   ============================================ */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #eee;
    padding: 10px;
    text-align: left;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.table tr:hover {
    background: #f9f9f9;
}

/* ============================================
   SPINNER DE CARGA
   ============================================ */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: var(--spacing-lg) auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mt-4 {
    margin-top: var(--spacing-xl);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.mb-4 {
    margin-bottom: var(--spacing-xl);
}

.flex {
    display: flex;
}

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

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

.gap-3 {
    gap: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.25rem;
    }

    .floating-btn {
        bottom: var(--spacing-lg);
        right: var(--spacing-lg);
    }

    .modal {
        padding: var(--spacing-lg);
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}