/* ==========================================================
   ESTILOS GENERALES Y MODERNOS - TIENDA ONLINE
   ========================================================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-color: #f97316;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-main: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --card-hover-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.12);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NAVBAR Y FILTROS */
.navbar-custom {
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

.search-input-group {
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 2px 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.search-input-group:focus-within {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-input-group input {
    background: transparent;
    border: none;
    box-shadow: none !important;
}

.search-input-group span {
    background: transparent;
    border: none;
}

/* CARRITO FLOTANTE NAVBAR */
.cart-nav-btn {
    position: relative;
    background: #eff6ff;
    color: var(--primary-color);
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-nav-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-1px);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.bump {
    transform: scale(1.35);
}

/* SLIDER DE OFERTAS (BANNER) */
.hero-slider-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    overflow: hidden;
    color: white;
    margin: 20px 0 35px 0;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.15);
}

.slider-slide-img {
    height: 380px;
    width: 100%;
    object-fit: contain;
    padding: 20px;
}

@media (max-width: 768px) {
    .slider-slide-img {
        height: 260px;
    }
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
}

.hero-slider-container .carousel-control-prev,
.hero-slider-container .carousel-control-next {
    width: 60px;
    z-index: 25;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-slider-container .carousel-control-prev:hover,
.hero-slider-container .carousel-control-next:hover {
    opacity: 1;
}

.hero-slider-container .carousel-indicators {
    z-index: 25;
}

.hero-slider-container .carousel-item {
    position: relative;
    z-index: 5;
}

.hero-slider-container .btn {
    position: relative;
    z-index: 15;
}

/* TARJETAS DE PRODUCTOS */
.product-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
    border-color: #e2e8f0;
}

.product-card-img-wrap {
    position: relative;
    padding-top: 80%; /* Aspect Ratio 5:4 */
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
}

.product-card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 3px 6px rgba(239, 68, 68, 0.4);
}

.product-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    cursor: pointer;
}

.product-title:hover {
    color: var(--primary-color);
}

.product-short-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-prices {
    margin-top: auto;
    margin-bottom: 14px;
}

.price-regular {
    font-size: 0.95rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-right: 8px;
}

.price-current {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
}

.price-offer {
    color: #ef4444;
}

.btn-add-cart {
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

/* SKELETON LOADER Y SCROLL INFINITO */
.skeleton-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--card-shadow);
}

.skeleton-box {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ZOOM EN MODAL DE PRODUCTO */
.zoom-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
    cursor: crosshair;
}

.zoom-image {
    width: 100%;
    height: 380px;
    object-fit: contain;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
}

.modal-thumbs-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-top: 12px;
}

.modal-thumb {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    border: 2px solid transparent;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.modal-thumb.active, .modal-thumb:hover {
    border-color: var(--primary-color);
    opacity: 1;
    transform: scale(1.05);
}

/* OFF-CANVAS / MODAL DE CARRITO */
.cart-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.qty-control button {
    background: #f8fafc;
    border: none;
    padding: 4px 10px;
    font-weight: bold;
    color: #475569;
}

.qty-control button:hover {
    background: #e2e8f0;
}

.qty-control span {
    padding: 4px 10px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
    color: #1e293b;
    display: inline-block;
    user-select: none;
}

/* IMPRESIÓN DEL TICKET (CSS @media print) */
@media print {
    /* Ocultar todos los elementos de la interfaz por defecto */
    body * {
        visibility: hidden !important;
    }

    /* Mostrar estrictamente el contenedor del ticket y sus descendientes */
    #ticketImpresion,
    #ticketImpresion * {
        visibility: visible !important;
    }

    /* Posicionar el ticket en el origen del papel sin bordes de modal ni sombras */
    #ticketImpresion {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Ocultar botones, modales circundantes y elementos secundarios */
    .no-print,
    .modal,
    .modal-backdrop,
    .navbar,
    footer,
    .toast-container {
        display: none !important;
    }
}
