/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Header - Más compacto */
.header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    height: 80px;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.logo {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
}

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

.title {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.header-info {
    display: flex;
    gap: 20px;
    z-index: 1;
}

.time-display, .date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navegación de categorías - Más compacta */
.categories-nav {
    background: linear-gradient(90deg, #2c3e50, #34495e);
    padding: 8px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 60px;
}

.categories-container {
    display: flex;
    gap: 15px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 100%;
    align-items: center;
}

.categories-container::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.category-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;
}

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

.category-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.category-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* Contenido principal - Sin scroll, todo visible */
.main-content {
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #e74c3c);
}

.section-title i {
    color: #3498db;
    font-size: 1.4rem;
}

/* Productos destacados - Más compacto */
.featured-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 35%;
}

.featured-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    height: calc(100% - 50px);
    overflow: hidden;
}

/* Grid de productos - Más compacto */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    height: calc(100% - 50px);
    overflow: hidden;
}

/* Tarjeta de producto - Más compacta */
.product-card {
    background: white;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card.featured {
    border: 2px solid #f39c12;
    position: relative;
}

.product-card.featured::before {
    content: '⭐ Destacado';
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
}

.product-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #ddd, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-image .placeholder {
    font-size: 2rem;
    color: #bdc3c7;
}

.product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.2;
}

.product-description {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 5px;
}

.product-category {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    align-self: flex-start;
}

/* Footer removido para optimizar espacio en TV */

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #3498db;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 500;
}

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

.product-card {
    animation: fadeInUp 0.4s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive para TV */
@media (min-width: 1920px) {
    body { font-size: 16px; }
    .title { font-size: 2.2rem; }
    .section-title { font-size: 1.6rem; }
    .product-name { font-size: 1.1rem; }
    .product-price { font-size: 1.3rem; }
    .category-btn { font-size: 1rem; padding: 10px 22px; }
    .header { height: 90px; }
    .categories-nav { height: 70px; }
}

@media (min-width: 2560px) {
    body { font-size: 18px; }
    .title { font-size: 2.5rem; }
    .section-title { font-size: 1.8rem; }
    .product-name { font-size: 1.2rem; }
    .product-price { font-size: 1.4rem; }
    .category-btn { font-size: 1.1rem; padding: 12px 25px; }
    .header { height: 100px; }
    .categories-nav { height: 80px; }
}

/* Optimización para pantallas 4K */
@media (min-width: 3840px) {
    body { font-size: 20px; }
    .title { font-size: 3rem; }
    .section-title { font-size: 2rem; }
    .product-name { font-size: 1.3rem; }
    .product-price { font-size: 1.5rem; }
    .category-btn { font-size: 1.2rem; padding: 15px 30px; }
    .header { height: 120px; }
    .categories-nav { height: 100px; }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
}
