/**
 * Estilos para Consulta de Pedidos por Teléfono
 * =============================================
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --cp-primary-color: #2c3e50;
    --cp-primary-dark: #1a252f;
    --cp-accent-color: #3498db;
    --cp-success-color: #27ae60;
    --cp-warning-color: #f39c12;
    --cp-danger-color: #e74c3c;
    --cp-whatsapp-color: #25D366;
    --cp-whatsapp-hover: #128C7E;
    --cp-border-radius: 1rem;
    --cp-transition: all 0.3s ease;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--cp-primary-color) 0%, #34495e 50%, var(--cp-accent-color) 100%);
    padding: 3.5rem 0 5rem 0;
    color: white;
    text-align: center;
    position: relative;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #f8f9fa);
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
    font-weight: 300;
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    background: white;
    border-radius: var(--cp-border-radius);
    padding: 2rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    margin-top: -3rem;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ============================================
   INPUT TELÉFONO
   ============================================ */
.input-telefono {
    border: 2px solid #e5e7eb;
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    transition: var(--cp-transition);
    background-color: #fafafa;
}

.input-telefono:focus {
    border-color: var(--cp-primary-color);
    box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.1);
    background-color: white;
    outline: none;
}

.input-telefono::placeholder {
    color: #adb5bd;
}

/* ============================================
   BOTÓN CONSULTAR
   ============================================ */
.btn-consultar {
    background: linear-gradient(135deg, var(--cp-primary-color) 0%, var(--cp-primary-dark) 100%);
    border: none;
    border-radius: 0.875rem;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    transition: var(--cp-transition);
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.btn-consultar:hover {
    background: linear-gradient(135deg, var(--cp-primary-dark) 0%, #0d1318 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
    color: white;
}

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

.btn-consultar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
    padding: 2.5rem 0;
}

.results-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--cp-primary-color);
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

/* ============================================
   PEDIDO CARDS
   ============================================ */
.pedido-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--cp-border-radius);
    overflow: hidden;
    transition: var(--cp-transition);
    height: 100%;
    border-left-width: 4px;
    border-left-style: solid;
}

.pedido-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #d1d5db;
}

.pedido-card .card-header {
    background: linear-gradient(to bottom, #fafafa, white);
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
}

.pedido-card .card-body {
    padding: 1.25rem;
}

.pedido-card .card-footer {
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
}

/* Badge de Estado */
.pedido-card .badge {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
}

/* Consecutivo */
.pedido-consecutivo {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--cp-primary-color);
}

/* Total */
.pedido-total,
.total-section .text-success {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--cp-success-color);
}

/* Productos List */
.productos-section ul li {
    padding: 0.625rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.productos-section ul li:last-child {
    border-bottom: none;
}

.productos-section .badge.bg-dark {
    background-color: var(--cp-primary-color) !important;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ============================================
   BOTÓN WHATSAPP
   ============================================ */
.btn-contactar-whatsapp {
    background-color: var(--cp-whatsapp-color);
    border: none;
    border-radius: 0.625rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: var(--cp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-contactar-whatsapp:hover {
    background-color: var(--cp-whatsapp-hover);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.btn-contactar-whatsapp:active {
    transform: scale(0.98);
}

.btn-contactar-whatsapp i {
    font-size: 1.25rem;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-container {
    padding: 4rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-container .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 0.3rem;
    color: var(--cp-primary-color);
}

.loading-container p {
    margin-top: 1.25rem;
    color: #6c757d;
    font-size: 1rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: #fafafa;
    border-radius: var(--cp-border-radius);
    border: 2px dashed #dee2e6;
}

.empty-state i {
    font-size: 5rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
    display: block;
}

.empty-state h5 {
    color: #495057;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

/* ============================================
   RESPONSIVE - Mobile First
   ============================================ */

/* Extra Small (< 576px) */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 2.5rem 0 4rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .search-box {
        padding: 1.5rem;
        margin-top: -2rem;
        border-radius: 0.75rem;
    }

    .input-telefono {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .btn-consultar {
        width: 100%;
        margin-top: 1rem;
        padding: 0.875rem 1.5rem;
    }

    .results-title {
        font-size: 1.125rem;
    }

    .pedido-card {
        border-radius: 0.75rem;
    }

    .pedido-consecutivo,
    .pedido-card h5 {
        font-size: 1.125rem;
    }

    .pedido-total,
    .total-section .text-success {
        font-size: 1.375rem;
    }

    .empty-state {
        padding: 3rem 1rem;
    }

    .empty-state i {
        font-size: 3.5rem;
    }
}

/* Small (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .search-box {
        padding: 1.75rem;
    }
}

/* Medium+ (768px+) - 2 columnas */
@media (min-width: 768px) {
    .hero-section {
        padding: 4rem 0 5.5rem 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .search-box {
        padding: 2.5rem;
    }

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

/* Large+ (992px+) */
@media (min-width: 992px) {
    .hero-title {
        font-size: 2.75rem;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pedido-card {
    animation: fadeInUp 0.4s ease-out;
}

.pedido-card:nth-child(2) {
    animation-delay: 0.1s;
}

.pedido-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary {
    color: var(--cp-primary-color) !important;
}

.text-success {
    color: var(--cp-success-color) !important;
}

.bg-primary {
    background-color: var(--cp-primary-color) !important;
}
