﻿/* Variables de color MK_Toys */
:root {
    --primary-color: #0686bd;
    --primary-dark: #055a7e;
    --primary-light: #e6f4fa;
    --dark-color: #000000;
    --gray-dark: #1a1a1a;
    --gray-light: #f5f5f5;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

/* Enlaces */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

    a:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* ============================================
   ESTILOS GENERALES
   ============================================ */
/*body {
    background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}*/

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: url('/images/Logo_Fondo.png') no-repeat center center;
    background-size: 500px;
    background-attachment: fixed;
}

    /* Overlay sutil para que el texto sea legible */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.88);
        z-index: -1;
    }

/* ============================================
   TARJETAS Y CONTENEDORES
   ============================================ */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    }

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 1.5rem;
    text-align: center;
}

    .card-header h3 {
        margin: 0;
        font-weight: 600;
    }

.card-body {
    padding: 2rem;
}

/* ============================================
   CAMPOS DE FORMULARIO CON ÍCONOS
   ============================================ */
.input-group-icon {
    position: relative;
    margin-bottom: 1.5rem;
}

    .input-group-icon .form-control {
        padding-left: 45px;
        height: 50px;
        border-radius: 10px;
        border: 2px solid #e0e0e0;
        transition: all 0.3s ease;
        font-size: 1rem;
    }

        .input-group-icon .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(6, 134, 189, 0.25);
        }

    .input-group-icon .input-icon {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--primary-color);
        font-size: 1.2rem;
        z-index: 10;
    }

/* Grupo de contraseña con botón mostrar */
.password-group {
    position: relative;
}

    .password-group .form-control {
        padding-right: 45px;
    }

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.2rem;
    z-index: 10;
    background: none;
    border: none;
}

    .password-toggle:hover {
        color: var(--primary-dark);
    }

/* ============================================
   BOTONES
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(6, 134, 189, 0.4);
    }

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    transition: all 0.3s ease;
    color: white;
}

    .btn-primary-custom:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        color: white;
    }

.btn-outline-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    padding: 8px 25px;
    transition: all 0.3s ease;
    background: transparent;
}

    .btn-outline-custom:hover {
        background: var(--primary-color);
        color: white;
    }

.btn-action {
    margin: 0 3px;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* ============================================
   ENCABEZADOS DE PÁGINA
   ============================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 40px 0;
    margin-bottom: 40px;
    border-radius: 0 0 30px 30px;
    color: white;
}

.detail-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 40px 0;
    margin-bottom: 40px;
    color: white;
}

/* ============================================
   ESTILOS PARA CATEGORÍAS
   ============================================ */

/* Tarjeta de categoría */
.category-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    margin-bottom: 30px;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .category-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    }

/* Contenedor de imagen - manteniendo el tamaño original */
.category-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Cambiado de 'cover' a 'contain' para mostrar toda la imagen */
    object-position: center;
    transition: transform 0.5s ease;
    background-color: white;
    padding: 10px;
}

.category-card:hover .category-img {
    transform: scale(1.05);
}

.category-body {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
}

.category-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.subcategory-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
}

.subcategory-item {
    display: inline-block;
    background: white;
    padding: 3px 10px;
    margin: 3px;
    border-radius: 15px;
    font-size: 0.75rem;
    color: var(--primary-color);
    border: 1px solid #e0e0e0;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .subcategory-item:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

/* Banner de categoría en detalle - manteniendo tamaño original */
.category-banner {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.category-banner-img {
    width: 100%;
    height: 300px;
    object-fit: contain; /* Cambiado de 'cover' a 'contain' */
    object-position: center;
    background-color: white;
}

/* Para dispositivos móviles */
@media (max-width: 768px) {
    .category-img-container {
        height: 160px;
    }

    .category-banner-img {
        height: 200px;
    }

    .category-img {
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .category-img-container {
        height: 140px;
    }

    .category-banner-img {
        height: 150px;
    }
}

/* ============================================
   ESTILOS PARA CATEGORÍAS EN HOME
   ============================================ */
.category-img-home {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    background-color: white;
    padding: 10px;
}

    .category-img-home:hover {
        transform: scale(1.05);
    }

.category-count {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

/* ============================================
   ESTILOS PARA PRODUCTOS
   ============================================ */

/* Tarjeta de producto */
.product-card {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background: white;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }

    /* Contenedor de imagen - nuevo wrapper para mejorar visualización */
    .product-card > .product-img,
    .product-card > div:first-child > .product-img {
        width: 100%;
        height: 200px;
        object-fit: contain;
        object-position: center;
        background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
        padding: 10px;
        transition: transform 0.5s ease;
    }

    .product-card:hover > .product-img,
    .product-card:hover > div:first-child > .product-img {
        transform: scale(1.05);
    }

.product-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: auto;
}

/* ============================================
   ESTILOS PARA PRODUCTOS PÚBLICOS (Categorías/Details)
   ============================================ */
.public-product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .public-product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }

.public-product-img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    padding: 10px;
    transition: transform 0.5s ease;
}

.public-product-card:hover .public-product-img {
    transform: scale(1.05);
}

.public-product-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.public-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.public-product-price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: auto;
}

.public-product-stock {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

/* ============================================
   FORZAR TAMAÑO CONSISTENTE DE IMÁGENES EN PRODUCTOS
   ============================================ */

/* Asegurar que todas las imágenes de productos tengan el mismo tamaño */
.product-card .product-img {
    min-height: 200px;
    max-height: 200px;
    width: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .product-card .product-img {
        min-height: 160px;
        max-height: 160px;
    }
}

@media (max-width: 480px) {
    .product-card .product-img {
        min-height: 140px;
        max-height: 140px;
    }
}

/* Forzar consistencia también en productos públicos */
.public-product-img {
    min-height: 180px;
    max-height: 180px;
    width: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .public-product-img {
        min-height: 150px;
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .public-product-img {
        min-height: 130px;
        max-height: 130px;
    }
}

/* ============================================
   RESPONSIVE PARA PRODUCTOS
   ============================================ */
@media (max-width: 768px) {
    .product-card > .product-img,
    .product-card > div:first-child > .product-img {
        height: 160px;
        padding: 8px;
    }

    .public-product-img {
        height: 150px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .product-card > .product-img,
    .product-card > div:first-child > .product-img {
        height: 140px;
        padding: 5px;
    }

    .public-product-img {
        height: 130px;
        padding: 5px;
    }
}



/* ============================================
   FORMULARIOS
   ============================================ */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 25px;
    color: white;
}

.form-body {
    padding: 30px;
}

.preview-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    margin-top: 10px;
}

.current-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 15px;
    border: 2px solid var(--primary-color);
}

/* ============================================
   INFO CARD
   ============================================ */
.info-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    background: white;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 60px 0;
    margin-bottom: 40px;
    color: white;
    border-radius: 0 0 30px 30px;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ============================================
   ESTADÍSTICAS
   ============================================ */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
}

/* ============================================
   SECCIÓN DE TÍTULOS
   ============================================ */
.section-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

    .section-title:after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 0;
        width: 60px;
        height: 3px;
        background: var(--primary-color);
    }

/* ============================================
   CARRUSEL
   ============================================ */
.carrusel-img {
    height: 500px;
    object-fit: cover;
    border-radius: 20px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-item a {
    color: white;
    text-decoration: none;
}

    .breadcrumb-item a:hover {
        text-decoration: underline;
    }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--gray-dark) 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 0;
    margin-top: 3rem;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .category-card, .product-card {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   ESTILOS PARA GALERÍA DE IMÁGENES
   ============================================ */
.galeria-item {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .galeria-item:hover {
        transform: scale(1.05);
        border-color: var(--primary-color);
    }

    .galeria-item.selected {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px var(--primary-color);
    }

.galeria-check {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.galeria-item.selected .galeria-check {
    display: flex;
}

.galeria-img {
    height: 100px;
    width: 100%;
    object-fit: cover;
}

/* Opciones de imagen */
.opcion-imagen-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

    .opcion-imagen-group .form-check-inline {
        margin-right: 20px;
    }


/* ============================================
   ESTILOS PARA CATEGORÍAS EN HOME
   ============================================ */
.category-img-container {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.category-img-home {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-img-home {
    transform: scale(1.1);
}

.category-count {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

/* ============================================
   ESTILOS PARA VISTA PÚBLICA DE CATEGORÍAS
   ============================================ */
.public-category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 40px 0;
    margin-bottom: 40px;
    color: white;
}

.public-product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

    .public-product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }

.public-product-img {
    height: 180px;
    object-fit: cover;
    width: 100%;
}

.public-product-info {
    padding: 15px;
    text-align: center;
}

.public-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    height: 45px;
    overflow: hidden;
}

.public-product-price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.public-product-stock {
    font-size: 0.75rem;
    color: #888;
}

.btn-view-details {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    padding: 5px 15px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

    .btn-view-details:hover {
        background: var(--primary-color);
        color: white;
    }

/* ============================================
   ESTILOS PARA GALERÍA DE IMÁGENES
   ============================================ */

/* Tarjeta de imagen en galería */
.galeria-item-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

    .galeria-item-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .galeria-item-card.inactivo {
        opacity: 0.6;
        background: #f8f9fa;
    }

/* Contenedor de imagen */
.galeria-img-container {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
}

.galeria-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

    .galeria-img-thumb:hover {
        transform: scale(1.05);
    }

/* Badge de inactivo */
.inactive-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
}

/* Información de la imagen */
.galeria-info {
    padding: 10px;
}

.galeria-nombre {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.galeria-detalle {
    font-size: 0.7rem;
    margin-top: 5px;
}

.galeria-etiquetas {
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.galeria-fecha {
    margin-top: 5px;
}

.galeria-acciones {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* ============================================
   ESTILOS PARA PREVISUALIZACIÓN DE IMÁGENES EN SUBIDA
   ============================================ */

.preview-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: transform 0.2s;
}

    .preview-card:hover {
        transform: scale(1.02);
    }

.preview-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.preview-info {
    padding: 8px;
    text-align: center;
}

.preview-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.7rem;
    color: #888;
}

/* ============================================
   ESTILOS PARA MODALES
   ============================================ */

.modal-img {
    max-height: 70vh;
    width: auto;
    margin: 0 auto;
    display: block;
}

/* ============================================
   ESTILOS PARA PÁGINA DE ERROR
   ============================================ */
.error-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: white;
    transition: transform 0.3s ease;
}

    .error-card:hover {
        transform: translateY(-5px);
    }

.error-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-code {
    font-size: 6rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.error-message {
    color: #666;
    margin-bottom: 1.5rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ============================================
   ESTILOS PARA DETALLE DE VENTA
   ============================================ */

/* Badges para descuentos */
.badge-descuento {
    background-color: #28a745;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-incremento {
    background-color: #ffc107;
    color: #333;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-sin-cambio {
    background-color: #6c757d;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Tarjetas de información */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .info-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }

    .info-card .card-title {
        font-size: 0.9rem;
        font-weight: 600;
        color: #0686bd;
        margin-bottom: 0.75rem;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 0.5rem;
    }

    .info-card p {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .info-card .badge {
        font-size: 0.8rem;
    }

/* Tabla de detalle - Escritorio */
.venta-detalle-table {
    width: 100%;
    border-collapse: collapse;
}

    .venta-detalle-table th,
    .venta-detalle-table td {
        padding: 0.75rem;
        vertical-align: middle;
    }

    .venta-detalle-table thead th {
        background-color: #0686bd;
        color: white;
        font-weight: 600;
        white-space: nowrap;
    }

    .venta-detalle-table tbody tr:hover {
        background-color: #f5f5f5;
    }

/* Estilos para móvil - Tabla horizontal a vertical */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .venta-detalle-table,
    .venta-detalle-table thead,
    .venta-detalle-table tbody,
    .venta-detalle-table th,
    .venta-detalle-table td,
    .venta-detalle-table tr {
        display: block;
    }

        .venta-detalle-table thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }

        .venta-detalle-table tr {
            border: 1px solid #e0e0e0;
            border-radius: 10px;
            margin-bottom: 1rem;
            background: white;
            padding: 0.75rem;
        }

        .venta-detalle-table td {
            border: none;
            position: relative;
            padding: 0.5rem 0;
            text-align: right;
            white-space: normal;
            word-wrap: break-word;
            font-size: 0.85rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.5rem;
        }

            .venta-detalle-table td:before {
                position: relative;
                width: 45%;
                font-weight: 600;
                color: #0686bd;
                text-align: left;
                content: attr(data-label);
                white-space: normal;
                word-break: break-word;
            }

            .venta-detalle-table td:first-child {
                padding-top: 0;
            }

            .venta-detalle-table td:last-child {
                padding-bottom: 0;
            }

        /* Estilo especial para el footer de la tabla */
        .venta-detalle-table tfoot {
            margin-top: 1rem;
        }

            .venta-detalle-table tfoot tr {
                background-color: #f8f9fa;
                border: 1px solid #e0e0e0;
                margin-top: 0;
            }

            .venta-detalle-table tfoot td {
                background-color: #f8f9fa;
                font-weight: bold;
                padding: 0.75rem;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }

                .venta-detalle-table tfoot td:before {
                    content: attr(data-label);
                    font-weight: 600;
                    color: #0686bd;
                    width: auto;
                }

    .badge-descuento,
    .badge-incremento,
    .badge-sin-cambio {
        display: inline-block;
        white-space: normal;
        word-break: break-word;
    }
}

/* Estilos para tablet (entre 481px y 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

        .info-grid .info-card:last-child {
            grid-column: span 2;
        }
}

/* Estilos para impresión */
@media print {
    .detail-header .btn,
    .detail-header a,
    .card-header .btn,
    .card-header a,
    .btn {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
    }

    .detail-header {
        background: #0686bd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .info-card {
        break-inside: avoid;
    }

    .venta-detalle-table td,
    .venta-detalle-table th {
        break-inside: avoid;
    }

    .venta-detalle-table tfoot td {
        background-color: #f0f0f0 !important;
    }
}

/* Ocultar elementos sin reservar espacio */
.hidden-element {
    display: none !important;
}

/* Formulario de confirmación */
#formularioConfirmacion {
    transition: all 0.3s ease;
}

    #formularioConfirmacion.hidden {
        display: none !important;
    }

/* ============================================
   ESTILOS PARA AUTOCOMPLETADO DE COMPRAS - GRID
   ============================================ */
.ui-autocomplete {
    max-height: 500px;
    width: 500px !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    padding: 8px;
}

    .ui-autocomplete .ui-menu-item {
        display: inline-block !important;
        width: calc(50% - 8px) !important;
        margin: 4px;
        padding: 0;
        border-radius: 8px;
        border: 1px solid #f0f0f0;
        vertical-align: top;
        transition: all 0.2s ease;
    }

        .ui-autocomplete .ui-menu-item:hover {
            border-color: #0686bd;
            box-shadow: 0 2px 8px rgba(6, 134, 189, 0.2);
        }

    .ui-autocomplete .ui-menu-item-wrapper {
        padding: 0;
    }

.autocomplete-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: white;
    border-radius: 8px;
}

    .autocomplete-item:hover {
        background-color: #e6f4fa;
    }

.autocomplete-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.autocomplete-info {
    width: 100%;
}

.autocomplete-title {
    font-weight: 600;
    font-size: 0.75rem;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.autocomplete-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

    .autocomplete-details .badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

/* Para evitar que el autocomplete se desborde */
.ui-front {
    z-index: 9999;
}

/* Para dispositivos móviles */
@media (max-width: 768px) {
    .ui-autocomplete {
        width: 95% !important;
        max-width: 350px;
        left: 2.5% !important;
    }

        .ui-autocomplete .ui-menu-item {
            width: calc(100% - 8px) !important;
        }

    .autocomplete-img {
        width: 50px;
        height: 50px;
    }

    .autocomplete-title {
        font-size: 0.7rem;
    }
}
