/* ========================================
   Tienda - Mangle Coins
   Estilos específicos para la página de tienda
   ======================================== */

/* Categories Section */
.categories-section {
    margin-bottom: 24px;
}

.categories-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
}

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

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 2px solid #E8F5E9;
    border-radius: 16px;
    min-width: 80px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.category-btn i {
    font-size: 20px;
    color: #4CAF50;
}

.category-btn span {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.category-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
}

.category-btn.active i,
.category-btn.active span {
    color: white;
}

.category-btn:active {
    transform: scale(0.95);
}

/* Products Section */
.products-section {
    margin-bottom: 80px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sort-dropdown select {
    padding: 8px 12px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #333;
    outline: none;
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FF9800;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.product-icon {
    font-size: 48px;
    color: #4CAF50;
    opacity: 0.8;
}

.product-content {
    padding: 16px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
}

.product-price span {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-left: 4px;
}

.buy-btn {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.buy-btn:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
}

.buy-btn:active:not(:disabled) {
    background: #388E3C;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E8F5E9;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #CCCCCC;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .category-btn {
        min-width: 70px;
        padding: 10px 12px;
    }
}