/* ============================= 1. VARIABLES CSS Y CONFIGURACIÓN BASE ============================= */

:root {
    /* PALETA PROFESIONAL MINIMALISTA */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    
    /* GRISES PROFESIONALES */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* SISTEMA DE SOMBRAS */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* TIPOGRAFÍA */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* ESPACIADO Y BORDES */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;

    /* COLORES MATSCANN */
    --matscann-orange: #ffa12e;
    --matscann-orange-hover: #e6911a;
    --matscann-dark: #333;
    --matscann-dark-light: #555;
    --matscann-light: #f7f7f7;
    --matscann-white: #ffffff;
    --matscann-gray: #666;
    --matscann-gray-light: #999;
    --matscann-border: #ddd;
    --matscann-border-light: #eee;
    --matscann-shadow: rgba(0, 0, 0, 0.08);
    --matscann-shadow-hover: rgba(0, 0, 0, 0.15);
}

/* ============================= 2. RESET Y ESTILOS GLOBALES ============================= */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Elementos de texto */
.h2 {
    font-size: 1.875rem;
    font-weight: var(--font-weight-extrabold);
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-muted { color: var(--gray-500) !important; }
.text-dark { color: var(--gray-900) !important; }
.text-secondary { color: var(--gray-600) !important; }

/* Separadores */
hr {
    border: none;
    height: 1px;
    background: var(--gray-200);
    margin: 3rem auto;
    width: 50%;
}

/* ============================= 3. LAYOUT PRINCIPAL Y CONTENEDORES ============================= */

/* Barra de progreso */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: #ebb725;
    z-index: 9997;
    transition: width 0.1s ease;
}

/* Contenedor principal */
.custom-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.equal-height-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* ============================= 4. COMPONENTES DE NAVEGACIÓN ============================= */

/* Breadcrumb profesional */
.custom-breadcrumb {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-breadcrumb:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.breadcrumb {
    margin: 0;
    background: none;
}

.breadcrumb-item a {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: all 0.2s ease;
    position: relative;
    padding: 0.25rem 0;
}

.breadcrumb-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item a:hover::after {
    width: 100%;
}

.breadcrumb-item.active {
    color: var(--gray-400);
}

/* ============================= 5. COMPONENTES DE PRODUCTO ============================= */

/* Contenedor de imagen del producto */
.zoom-container {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.zoom-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.product-image-container {
    padding: 2rem;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    margin: 1rem;
    position: relative;
}

.product-image {
    border-radius: var(--radius-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.product-image:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.12));
}

/* Contador de vistas */
.views-counter {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-3xl);
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    font-weight: var(--font-weight-medium);
    color: var(--gray-700);
}

.views-counter:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.views-counter i {
    color: var(--primary);
}

/* Detalles del producto */
.product-details-wrapper {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 2rem;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.product-details-wrapper:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

/* Rating profesional */
.rating-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.rating-container .text-warning {
    display: flex;
    gap: 2px;
    color: var(--warning);
}

.rating-container .text-warning i {
    transition: all 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(217, 119, 6, 0.2));
}

.rating-container .text-warning i:hover {
    transform: scale(1.1);
}

.rating-container .text-secondary {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Brand */
.card-brand {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    color: var(--gray-600);
}

.label-text {
    color: var(--gray-500);
}

/* Sección título */
.section-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.section-title:hover {
    border-left-color: var(--primary-dark);
}

.section-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

/* Detalles del producto */
.product-details {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-700);
    transition: max-height 0.4s ease;
}

.product-description {
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.product-additional-data h5 {
    color: var(--gray-900);
    font-weight: var(--font-weight-bold);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.product-additional-data p {
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Precio desde */
.desde-precio-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.desde-precio-box:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.desde-label {
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.desde-precio {
    font-size: 2rem;
    font-weight: var(--font-weight-extrabold);
    color: var(--success);
    line-height: 1;
    letter-spacing: -0.025em;
}

/* Market box */
.market-box {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

.market-box:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.market-box h5 {
    font-weight: var(--font-weight-bold);
    margin-bottom: 2rem;
    color: var(--gray-900);
    text-align: center;
    font-size: 1.125rem;
}

/* Precio promedio */
.average-price-container {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.average-price-container:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* Lista de ofertas */
.market-box ul li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.875rem;
}

.market-box ul li:hover {
    background: var(--gray-50);
    padding-left: 0.75rem;
    border-radius: var(--radius-md);
}

.market-box ul li:last-child {
    border-bottom: none;
}

.market-box i.fa-fire {
    color: var(--danger);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* Banners promocionales */
.banner-image {
    height: 200px;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.carousel-inner {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.carousel-item a:hover .banner-image {
    transform: scale(1.02);
}

/* ============================= 6. CARRUSEL MATSCANN (SISTEMA COMPLETO) ============================= */

/* Contenedor principal del carrusel */
.matscann-carousel-container {
    background: var(--matscann-white);
    border: 1px solid var(--matscann-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--matscann-shadow);
    padding: 0;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.matscann-carousel-container:hover {
    box-shadow: 0 12px 48px var(--matscann-shadow-hover);
    transform: translateY(-2px);
}

/* Header del carrusel */
.matscann-carousel-header {
    background: linear-gradient(135deg, var(--matscann-white) 0%, var(--matscann-light) 100%);
    border-bottom: 2px solid var(--matscann-border-light);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.matscann-carousel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--matscann-dark);
}

.matscann-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.matscann-header-icon {
    width: 60px;
    height: 60px;
    background: var(--matscann-dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 161, 46, 0.3);
}

.matscann-header-icon i {
    font-size: 1.5rem;
    color: var(--matscann-white);
}

.matscann-header-text {
    flex: 1;
}

.matscann-carousel-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--matscann-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.matscann-carousel-subtitle {
    color: var(--matscann-gray);
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

/* Contador del header */
.matscann-header-counter {
    background: var(--matscann-white);
    border: 2px solid var(--matscann-dark);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: var(--matscann-dark);
    font-size: 1.125rem;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
}

.matscann-header-counter:hover {
    background: var(--matscann-dark);
    color: var(--matscann-white);
    transform: scale(1.05);
}

.matscann-header-counter .separator {
    color: var(--matscann-dark);
    margin: 0 0.5rem;
}

/* Wrapper del carrusel */
.matscann-carousel-wrapper {
    position: relative;
    padding: 2rem;
    overflow: visible;
}

.matscann-carousel {
    height: 420px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--matscann-light);
    border: 1px solid var(--matscann-border);
}

/* Track del carrusel */
.matscann-carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    will-change: transform;
}

.matscann-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 1rem;
    background: var(--matscann-white);
}

.matscann-slide:nth-child(even) {
    background: linear-gradient(135deg, var(--matscann-light) 0%, var(--matscann-white) 100%);
}

/* Cards de productos del carrusel */
.matscann-product-card {
    width: 280px;
    height: 360px;
    background: var(--matscann-white);
    border: 1px solid var(--matscann-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--matscann-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.matscann-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px var(--matscann-shadow-hover);
}

.matscann-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--matscann-dark);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.matscann-product-card:hover::before {
    transform: scaleX(1);
}

/* Imagen de la card */
.matscann-card-image {
    width: 100%;
    height: 140px;
    border-bottom: 1px solid var(--matscann-border-light);
    overflow: hidden;
    position: relative;
    background: var(--matscann-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.matscann-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 0.75rem;
}

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

/* Badge de descuento */
.matscann-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--matscann-dark);
    color: var(--matscann-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

/* Contenido de la card */
.matscann-card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.matscann-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--matscann-dark);
    line-height: 1.3;
    min-height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.matscann-card-brand {
    font-size: 0.85rem;
    color: var(--matscann-gray);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.matscann-card-brand i {
    color: var(--matscann-dark);
    font-size: 0.8rem;
}

.matscann-card-retailer {
    font-size: 0.8rem;
    color: var(--matscann-gray);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.matscann-card-retailer i {
    color: var(--matscann-dark);
    font-size: 0.75rem;
}

/* Sección de precios */
.matscann-card-price-section {
    margin-bottom: 1rem;
}

.matscann-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--matscann-dark);
    margin-bottom: 0.25rem;
}

.matscann-old-price {
    font-size: 0.9rem;
    color: var(--matscann-gray-light);
    text-decoration: line-through;
    font-weight: 400;
}

/* Botón de la card */
.matscann-card-btn {
    background: var(--matscann-dark);
    color: var(--matscann-white);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.matscann-card-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.matscann-card-btn:hover {
    background: var(--matscann-dark);
    color: var(--matscann-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 161, 46, 0.4);
}

.matscann-card-btn:hover::before {
    left: 100%;
}

/* Controles de navegación del carrusel */
.matscann-navigation-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    pointer-events: none;
    z-index: 1000;
}

.matscann-nav-btn {
    width: 70px !important;
    height: 70px !important;
    cursor: pointer !important;
    pointer-events: all !important;
    user-select: none !important;
    position: relative !important;
    z-index: 1001 !important;
    color: black;
    font-size: 0 !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.matscann-nav-btn:hover {
    color: black;
    transform: scale(1.1) !important;
}

.matscann-nav-btn:active {
    transform: scale(1.05) !important;
}

.matscann-nav-btn i {
    font-size: 1.5rem !important;
    transition: all 0.3s ease !important;
    z-index: 1002 !important;
    position: relative !important;
    pointer-events: none !important;
}

.matscann-nav-btn:hover i {
    transform: scale(1.2) !important;
    color: black;
}

.matscann-carousel-container .matscann-nav-btn {
    z-index: 9999 !important;
}

/* Barra de progreso */
.matscann-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--matscann-border-light);
}

.matscann-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--matscann-dark) 0%, var(--matscann-orange-hover) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Indicadores */
.matscann-indicators {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.matscann-indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--matscann-border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.matscann-indicator:hover {
    background: var(--matscann-gray-light);
    transform: scale(1.2);
}

.matscann-indicator.active {
    background: var(--matscann-dark);
    transform: scale(1.3);
    width: 32px;
}

/* Loading del carrusel */
.matscann-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.matscann-loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.matscann-loading-content {
    text-align: center;
    color: var(--matscann-gray);
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--matscann-dark);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.5s;
    border-top-color: var(--matscann-orange-hover);
}

.spinner-ring:nth-child(3) {
    animation-delay: 1s;
    border-top-color: var(--matscann-gray);
}

.matscann-loading-content p {
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* Footer controls */
.matscann-controls-footer {
    background: var(--matscann-light);
    border-top: 1px solid var(--matscann-border-light);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.matscann-autoplay-btn {
    background: transparent;
    border: 2px solid var(--matscann-dark);
    color: var(--matscann-dark);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.matscann-autoplay-btn:hover {
    background: var(--matscann-dark);
    color: var(--matscann-white);
}

.matscann-view-all-btn {
    color: var(--matscann-dark);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.matscann-view-all-btn:hover {
    color: var(--matscann-dark);
    transform: translateX(4px);
}

.matscann-view-all-btn i {
    transition: transform 0.3s ease;
}

.matscann-view-all-btn:hover i {
    transform: translateX(4px);
}

/* Mensajes informativos */
.matscann-single-slide-message {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 161, 46, 0.1);
    color: var(--matscann-dark);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 161, 46, 0.2);
    z-index: 10;
}

.matscann-swipe-message {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--matscann-dark);
    color: var(--matscann-white);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 15;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 161, 46, 0.3);
    transition: opacity 0.3s ease;
    animation: swipePulse 2s ease-in-out infinite;
}

.matscann-swipe-message i {
    margin: 0 0.5rem;
    animation: swipeAnimation 1.5s ease-in-out infinite;
}

/* Estados de hover adicionales */
.matscann-product-card:hover .matscann-card-title {
    color: var(--matscann-dark);
}

.matscann-product-card:hover .matscann-card-brand i,
.matscann-product-card:hover .matscann-card-retailer i {
    transform: scale(1.1);
}

/* ============================= 7. GRÁFICOS Y VISUALIZACIONES ============================= */

/* Cards de gráficos */
.card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin-bottom: 2rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    background: linear-gradient(135deg, #f9f9f9 25%, #ffffff 25%, #ffffff 50%, #f9f9f9 50%, #f9f9f9 75%, #ffffff 75%, #ffffff 100%);
    background-size: 10px 10px;
}

.chart-container {
    margin-top: 2rem;
}

/* Productos recomendados adicionales */
.recommended-box {
    padding: 1.5rem 1.5rem 4rem;
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
    width: 100%;
}

.recommended-products {
    position: relative;
    width: 100%;
    padding: 0 1rem 2rem;
    overflow: hidden;
}

#recommendedProducts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

#recommendedProducts .product-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    height: 450px;
}

#recommendedProducts .product-imagereco {
    margin-bottom: 1rem;
}

#recommendedProducts .product-imagereco img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1rem;
}

#recommendedProducts .product-name {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    min-height: 44px;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

#recommendedProducts .product-price {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    color: var(--success);
    margin-bottom: 0.5rem;
}

#recommendedProducts .product-retailer {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    flex-grow: 1;
}

#recommendedProducts .btn-view-product {
    display: block;
    width: 100%;
    padding: 8px;
    background: #333;
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px;
}

#recommendedProducts .btn-view-product:hover {
    background: #e1e1e1;
    color: black;
}

/* Información de productos adicional */
.product-info {
    text-align: center;
    padding: 0.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 36px;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.product-price {
    font-size: 0.9rem;
    margin: 0.4rem 0;
}

.current-price {
    color: #198754;
}

.old-price {
    color: #999;
    font-size: 0.8rem;
    text-decoration: line-through;
}

.product-imagereco img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    background-color: #fafafa;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

/* Slick Carousel personalizado */
.slick-prev, .slick-next {
    top: 40%;
    z-index: 3;
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.slick-prev:hover, .slick-next:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.slick-prev:before, .slick-next:before {
    color: var(--gray-700);
    font-size: 1.2rem;
}

.slick-dots {
    bottom: -2.5rem;
    z-index: 3;
}

.slick-dots li button:before {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.slick-dots li.slick-active button:before {
    color: var(--primary);
}

/* ============================= 8. FORMULARIOS Y CONTROLES ============================= */

/* Botones principales */
.btn-cotizador {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--matscann-dark);
    color: var(--matscann-white);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-lg);
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    text-align: center;
    font-size: 0.875rem;
    text-decoration: none;
    display: block;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-cotizador:hover {
    background: var(--matscann-dark);
    color: var(--matscann-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 161, 46, 0.4);
}

.btn-cotizador:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-cotizador::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-cotizador:hover::before {
    left: 100%;
}

.disabled-button {
    background: var(--gray-300) !important;
    color: var(--gray-500) !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* Botón toggle */
.btn-toggle-details {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-3xl);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
}

.btn-toggle-details:hover {
    background: var(--gray-200);
    color: var(--gray-900);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-toggle-details i {
    transition: transform 0.3s ease;
}

/* Botones de acción */
.favoritos-btn {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    color: var(--gray-600);
    text-decoration: none;
    cursor: pointer;
}

.favoritos-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--primary);
    background: var(--gray-50);
}

/* Botones de período */
.btn-periodo {
    border: 1px solid var(--gray-300);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-3xl);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--gray-700);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 80px;
    cursor: pointer;
}

.btn-periodo:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-periodo.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-market-period {
    margin: 0.25rem;
}

/* Otros botones */
.btn-primary {
    background: var(--primary);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-3xl);
    font-weight: var(--font-weight-semibold);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-dark {
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    background: white;
    border-radius: var(--radius-3xl);
    font-weight: var(--font-weight-medium);
    transition: all 0.3s ease;
}

.btn-outline-dark:hover {
    background: var(--gray-900);
    color: white;
    border-color: var(--gray-900);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-light {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-light:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-dark {
    background: var(--gray-900);
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg);
}

.btn-dark:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Controles de cantidad */
.quantity-btn {
    font-weight: var(--font-weight-bold);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
}

.quantity-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
    color: var(--primary);
}

/* Formularios */
.form-control {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.select-periodo {
    font-size: 0.875rem;
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    background: white;
}

.swal2-popup input[type="number"] {
    font-size: 1rem;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
}

/* ============================= 9. ESTADOS E INTERACCIONES ============================= */

/* Estados de focus */
button:focus,
.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Estados de interacción */
.magnetic-hover {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive:hover {
    transform: translateY(-1px);
}

.interactive:active {
    transform: translateY(0);
}

/* Estados de loading */
.loading-shimmer {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer-loading 2s infinite;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-3xl);
    text-transform: none;
}

.bg-success {
    background-color: var(--success) !important;
    color: white;
}

.bg-secondary {
    background-color: var(--gray-400) !important;
    color: white;
}

/* Comentarios */
.comment-box {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.comment-box:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.comment-box h4 {
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin-bottom: 2rem;
    text-align: center;
}

.comment-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-xs);
}

.comment-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    border-color: var(--gray-300);
}

.avatar-circle {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-semibold);
    box-shadow: var(--shadow-sm);
}

/* Modal */
.modal-content {
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}

/* Tooltips */
.tooltip-professional {
    background: var(--gray-900) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
}

/* Alertas */
.alert {
    border-radius: var(--radius-lg);
    border: 1px solid;
    font-size: 0.875rem;
}

.alert-success {
    background-color: rgba(5, 150, 105, 0.05);
    border-color: rgba(5, 150, 105, 0.2);
    color: var(--success);
}

.alert-danger {
    background-color: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--danger);
}

.alert-info {
    background-color: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.2);
    color: var(--primary);
}

/* ============================= 10. RESPONSIVE DESIGN ============================= */

/* Desktop - FLECHAS SIEMPRE VISIBLES Y FUNCIONALES */
@media (min-width: 769px) {
    .matscann-carousel-container {
        margin: 0;
    }
    
    .matscann-navigation-controls {
        display: flex !important;
    }
    
    .matscann-nav-btn {
        display: flex !important;
        pointer-events: all !important;
        cursor: pointer !important;
    }
}

/* Desktop grande */
@media (min-width: 1200px) {
    .matscann-slide {
        gap: 2rem;
    }
    
    .matscann-product-card {
        width: 300px;
        height: 380px;
    }
    
    .matscann-nav-btn {
        width: 60px !important;
        height: 60px !important;
    }
    
    .matscann-nav-btn i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .matscann-nav-btn {
        width: 55px !important;
        height: 55px !important;
    }
    
    .matscann-nav-btn i {
        font-size: 1.3rem !important;
    }
}

@media (max-width: 991px) and (min-width: 769px) {
    .matscann-carousel-header {
        padding: 1.5rem;
    }
    
    .matscann-carousel-wrapper {
        padding: 1.5rem;
    }
    
    .matscann-nav-btn {
        width: 50px !important;
        height: 50px !important;
    }
    
    .matscann-nav-btn i {
        font-size: 1.2rem !important;
    }
}

/* Tablet y móvil - SIN FLECHAS */
@media (max-width: 768px) {
    .custom-container {
        padding: 1rem;
    }
    
    .h2 {
        font-size: 1.5rem;
    }
    
    .desde-precio {
        font-size: 1.75rem;
    }
    
    .card-body, .comment-box {
        padding: 1.5rem;
    }
    
    .favoritos-container .d-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .desde-precio-box {
        order: -1;
    }
    
    .btn-periodo {
        min-width: auto;
        width: 100%;
        margin: 0.125rem 0;
    }
    
    .banner-image {
        height: 160px;
    }
    
    .matscann-carousel-container {
        margin: 0;
    }
    
    .matscann-navigation-controls {
        display: none !important;
    }
    
    .recommended-box {
        min-height: auto;
        margin-bottom: 1rem;
    }
    
    .slick-prev, .slick-next {
        top: 45%;
    }
    
    .product-card {
        width: 180px;
        max-width: 180px;
        margin: 0 0.5rem;
    }
}

@media (max-width: 767px) {
    .matscann-carousel-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.25rem;
    }
    
    .matscann-header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .matscann-carousel-title {
        font-size: 1.5rem;
    }
    
    .matscann-carousel-subtitle {
        font-size: 0.9rem;
    }
    
    .matscann-carousel-wrapper {
        padding: 1rem;
    }
    
    .matscann-carousel {
        height: 380px;
    }
    
    .matscann-slide {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 0.5rem;
        justify-content: flex-start;
        overflow-y: auto;
    }
    
    .matscann-product-card {
        width: 280px;
        height: 340px;
        flex: none;
    }
    
    .matscann-controls-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .matscann-indicators {
        bottom: -45px;
        gap: 0.75rem;
    }
    
    .matscann-indicator {
        width: 14px;
        height: 14px;
        border-radius: 4px;
    }
    
    .matscann-indicator.active {
        width: 36px;
    }
}

@media (max-width: 480px) {
    .matscann-carousel-container {
        margin: 0 0.5rem;
        border-radius: 8px;
    }
    
    .matscann-header-icon {
        width: 50px;
        height: 50px;
    }
    
    .matscann-header-icon i {
        font-size: 1.25rem;
    }
    
    .matscann-carousel-title {
        font-size: 1.25rem;
    }
    
    .matscann-carousel-subtitle {
        font-size: 0.85rem;
    }
    
    .matscann-carousel-wrapper {
        padding: 0.75rem;
    }
    
    .matscann-carousel {
        height: 360px;
    }
    
    .matscann-product-card {
        width: 260px;
        height: 320px;
    }
    
    .matscann-card-image {
        height: 100px;
    }
    
    .matscann-card-content {
        padding: 1rem;
    }
    
    .matscann-card-title {
        font-size: 0.95rem;
        min-height: 2.4rem;
    }
    
    .matscann-card-price {
        font-size: 1.1rem;
    }
    
    .matscann-slide {
        padding: 1rem 0.25rem;
    }
}

@media (max-width: 320px) {
    .matscann-product-card {
        width: 220px;
        height: 300px;
    }

    .matscann-card-title {
        font-size: 0.85rem;
    }

    .matscann-card-price {
        font-size: 1rem;
    }
}

/* ============================= 11. ANIMACIONES Y TRANSICIONES ============================= */

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

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

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

@keyframes matscanSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes swipePulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

@keyframes swipeAnimation {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* Clases de animación */
.reveal-animation {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stagger-animation > * {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.3s; }

.matscann-carousel-container {
    animation: matscanSlideIn 0.8s ease-out;
}

