/* ==========================================================================
   ESTILOS PREMIUM - COMPLEMENTO DE TABLER.IO
   ========================================================================== */

/* 1. SISTEMA DE ANIMACIONES */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-wrapper {
    animation: fadeInUp 0.4s ease-out;
}

/* Transiciones globales fluidas */
a, .btn, .card, .form-control, .form-select, .list-group-item {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. REFORMA DE TARJETAS (CARDS) & SOMBRAS */
.card {
    border: 1px solid rgba(15, 23, 42, 0.07) !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03) !important;
    background-color: #ffffff;
}

.card:hover {
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06) !important;
}

/* Efecto Premium en las Tarjetas de Producto */
.product-card {
    border-radius: 14px !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card .img-container {
    overflow: hidden;
    position: relative;
    background: #f8fafc;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.product-card .product-img {
    width: 100%;
    height: 185px;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.product-placeholder {
    height: 185px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: #64748b;
}

.product-placeholder i {
    font-size: 2.5rem;
    opacity: 0.45;
    margin-bottom: 0.35rem;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--tblr-primary) !important;
    box-shadow: 0 15px 35px rgba(32, 107, 196, 0.08) !important;
}

/* 3. MENÚ LATERAL DE CATEGORÍAS (PILAS ELEGANTES) */
.list-group-item {
    border-radius: 8px !important;
    margin-bottom: 4px;
    border: none !important;
    font-weight: 500;
    color: #4f5e71;
    padding: 10px 14px !important;
}

.list-group-item:hover {
    background-color: rgba(32, 107, 196, 0.05) !important;
    color: var(--tblr-primary) !important;
    transform: translateX(3px);
}

.list-group-item.active {
    background-color: var(--tblr-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(32, 107, 196, 0.25) !important;
}

/* 4. FORMULARIOS E INPUTS MODERNOS */
.form-control, .form-select {
    border-radius: 10px !important;
    border: 1px solid rgba(101, 109, 119, 0.22) !important;
    padding: 10px 14px !important;
}

.input-icon .form-control {
    padding-left: 2.5rem !important;
}

.qty-input {
    padding: 8px 4px !important;
    min-width: 46px;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-control:focus, .form-select:focus {
    border-color: var(--tblr-primary) !important;
    box-shadow: 0 0 0 4px rgba(32, 107, 196, 0.12) !important;
}

/* Búsqueda Predictiva */
.predictive-wrapper {
    position: relative;
}

.predictive-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    z-index: 1050;
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.predictive-results.show {
    display: block;
}

.predictive-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

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

.predictive-item:hover {
    background-color: #f8fafc;
}

.predictive-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

/* Banner Principal Opcional */
.store-hero-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    background: #0f172a;
}

.store-hero-banner img {
    width: 100%;
    max-height: 290px;
    object-fit: cover;
    display: block;
}

.store-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.15) 70%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem 2rem;
}

/* Pills horizontales de categorías en móvil */
.category-pills-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-pills-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    white-space: nowrap;
    border-radius: 999px !important;
    padding: 7px 14px !important;
    font-size: 0.84rem;
    font-weight: 500;
    background: #ffffff;
    color: #334155;
    border: 1px solid rgba(15, 23, 42, 0.1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-pill.active {
    background: var(--tblr-primary);
    color: #ffffff;
    border-color: var(--tblr-primary);
    box-shadow: 0 4px 10px rgba(32, 107, 196, 0.2);
}

@media (max-width: 575.98px) {
    .product-card .product-img,
    .product-placeholder {
        height: 138px;
    }
    .store-hero-banner img {
        max-height: 170px;
    }
    .store-hero-overlay {
        padding: 1rem;
    }
    .store-hero-overlay h2 {
        font-size: 1.15rem !important;
    }
}

/* 5. BOTONES PREMIUM */
.btn {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    box-shadow: 0 4px 12px rgba(32, 107, 196, 0.15) !important;
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(32, 107, 196, 0.25) !important;
}

.btn-success {
    box-shadow: 0 4px 12px rgba(47, 179, 68, 0.15) !important;
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(47, 179, 68, 0.25) !important;
}

/* 6. COMPONENTES Y DETALLES FLOTANTES */
.badge-cart {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.35em 0.6em;
    border-radius: 50rem;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(214, 57, 57, 0.3);
}

/* Clamping para líneas de texto */
.text-truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3-lines {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 7. AMPLIAR ANCHO DE LA PÁGINA EN PANTALLAS GRANDES (90% del ancho de página) */
@media (min-width: 1200px) {
    .container-xl {
        max-width: 90% !important;
        width: 90% !important;
    }
}

/* 8. ESTILOS DE IMPRESIÓN DE COMPROBANTES */
@media print {
    .d-print-none {
        display: none !important;
    }
    .page-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        background-color: #fff !important;
        animation: none !important;
    }
    body {
        background-color: #fff !important;
        font-size: 14px;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    .col-lg-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    .col-lg-4 {
        display: none !important;
    }
}

/* 9. ESTILOS DE LA FICHA DEL PEDIDO (DETALLE DEL PEDIDO) */
.order-detail-page {
    font-size: 1.15rem; /* Aumentar base de fuente */
}
.order-detail-page .table th, 
.order-detail-page .table td {
    font-size: 1.1rem; /* Tablas más legibles */
    padding: 12px 16px !important;
}
.order-detail-page .card-title {
    font-size: 1.3rem !important; /* Títulos de bloques más grandes */
}
.order-detail-page .text-muted {
    font-size: 0.9rem !important; /* Textos secundarios más legibles */
}

/* Modificar tamaño en impresión para legibilidad */
@media print {
    .order-detail-page {
        font-size: 14px !important;
    }
    .order-detail-page .table th, 
    .order-detail-page .table td {
        font-size: 13px !important;
    }
}
